CMPS 160, Spring 2004

Programming Assignment 4 Handout

Objectives

Lighting

where,

·        GL_LIGHT0 is a constant used by OpenGL to specify a light source (there can be a minimum of 8 light sources in a scene specified as GL_LIGHT0, GL_LIGHT1 … )

·        GL_POSITION specifies that the next vector specifies where to position the light source.

·        light_position specifies the actual position of the light source. You will need to position your light source at a fixed position that does not change with the modelview transformations. For extra credit however, you need to provide additional rollers/sliders for moving the light source.

where,

·        GL_FRONT indicates the side of the polygon.(each polygon has 2 sides front and back)

·        GL_SPECULAR specifies the specular attribute to be changed.

·        mat_specular specifies the actual position values for the specular component.

For more details on lighting read Chapter 5 on Lighting.

Shading

More details in Chapter 4 on Colors.

Tessellation