This toturial was written for me by Imran Khan (imranahmedkhan82@hotmail.com,
iak1982@yahoo.com). |
||
Entering the World of 3D: In this Tutorial we will made 3D objects rather then 2D. This tutorial is in continuation with the previous one. In this section we will change the same method ' DrawGLScene ' to draw 3D objects. We will create cube by adding left, right, back, top and bottom to the squar and make pyramid by adding left, back, and right side to the triangle.Here is the code for pyramid.
First 6 lines are same.We have already draw the front side of the triangle in our previous tutorial. As u can see in the remaining part of the code we did nothing , just made 3 more sides(right, back , left ) with different colors. You can also use shades of different colors as we defined in our previous tutorial. Here is the code for Cube.
Same as previous we made other more 5 sides(back,botton,top,left,right) to draw a Cube. Your output will be like .
|
metadata block |
|
see also: | |
Correspondence about this page |
This site may have errors. Don't use for critical systems.
Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.