In this section you will learn about what tools OpenGL provide for specifying geometry. The basic OpenGL shapes (such as triangles and lines) are covered, and later we go through some additional GLU shapes (e.g. the sphere).
This section is a little bit more theoretical than the first section,
since it is aimed at giving you the basic tools for drawing 3D geometry
with OpenGL.
|
Lesson 5: OpenGL Primitives
In this lesson, you will learn about all the OpenGL primitives (point, line, triangle, quad and polygon), and how you can draw them in different ways. You will also encounter the glPushMatrix and glPopMatrix commands for the first time, which can be used for specifying different transformations for different objects. This lesson is quite comprehensive, but not really crucial for understanding OpenGL. You should at least browse through it to get an overview of the available OpenGL primitives, but do not get hooked up on details. lesson05.zip (HTML & program source) |
|
Lesson 6: 3D Objects and the Depth Buffer
It is time to draw solid 3D objects! In this lesson you will learn how to enable and use the depth buffer, which is essential for drawing 3D objects and worlds correctly. lesson06.zip (HTML & program source) |
|
Lesson 7: Quadrics objects
This time we have a look at the GLU quadrics objects, which can be used to draw spheres and cylinders instead of dull polygons. Now we can draw more complex objects with fewer lines of code. The program does not give us that visually stunning experience that we expect from an OpenGL application, but hey, we are still at the basic shapes. lesson07.zip (HTML & program source) |