Let's put up the equation and the parameters and see what everything means.
twTeddyBear is done. We can even
how twColor is implemented, as well.
TW has several simplifications that help in certain simple situations:
GLfloat gray50 = (0.5, 0.5, 0.5) glLightfv(GL_LIGHT0,GL_LIGHT_AMBIENT,gray50)This means that for each kind of light, you only have to supply 1 number instead of 3. That reduces the 9 parameters to 3, and those parameters can be supplied just to twGrayLight. The following specifies a light at (1,2,3) with 0.3 for ambient, 0.4 diffuse and 0.5 specular:
GLfloat lightPos = ( 1, 2, 3, 1 ) twGrayLight(GL_LIGHT0, lightPos, 0.3, 0.4, 0.5)
twTriple objColor = (0.2, 0.3, 0.4)
twColor(objColor,0.9,20)
Today, let's try to replicate the orange ring, using the tutors, and then, if possible, an OpenGL program.
Next time, we'll look at the following issues and demos:
Front View
Top View
It's important to interact with this:
Written by Scott D. Anderson
scott.anderson@acm.org

This work is licensed under a Creative Commons
License.