This is esentially the same thing as the code from 3D wireframe except now it has textures. Instead of GL_LINE_LOOP as in the last example, the solid was rendered using GL_POLYGON and colored accordingly.

The wireframe you see here is nothing more than the 3d plot of the function f(x,z) = 4*cos(sqrt(x*x+z*z)) rendered using GL_LINE_LOOP and a little math. As of now, is is still untextured and without lighting. Though in 3D Wireframe Solids, I added that functionality as well.

This is a simple program to show dynamic lighting. The heavy lifting is done in the shadePolygons() function which determines the luminosity of the surface of the cube according to the angle.Continue reading

The textures in this small program were generated procedurally and added to 3 sides of a cube. If you look at the sourcem the createTexture functions actually create the three textures. After created, the textures are then added onto a GL_POLYGON. Finally, simple lighting and rotation is added.

This is a walkthrough with a bunch of random items. Included are: a giant pyramid (hide it by pressing the p key!), a snowman, a bird, a torus, a rotating texture, and a golden spiral of teapots in the background.

Look at the myKeyboard() function to see what keys move. This program also relies upon texture.bmp as well as grass.bmp and BitmapLoader.h in order to run.