CS 5610/6610 - Fall 2007

Homework Assignment 2

Texture Mapping (150 points)

Handed out: Sept 20, 2007

Due: Tuesday noon, Oct 16, 2007

 You will write an OpenGL program which introduces you to texture mapping.

1. A white point light source (positional) using the OpenGL lighting model. Placed as in the first assignment (45 deg up/right of the viewer). Please provide an intensity control with a Glui control to increase/decrease the light intensity.

2. Include a 4-sided room such that one wall does not appear (think about culling). The floor should be texture mapped with the wood-floor plank. Have the wood as it would appear on an actual floor (Hint: use GL_REPEAT). Pay attention to the 'size' of the planks. You should include mip-mapping for this textured polygon. The Mip-Mapping should provide reasonable antialiasing. It is your job to determine how to achieve this.

3. You should place a cone in the center of the room. This cone should be texturemapped with the image of the earth that includes alpha. This cone should be white with an emmisive component of 0.3 and semi-transparent with a default opacity of 50%. Make the image of the earth appear twice on the cone (front and back). We will modify this image to have a better alpha after Sept 24.

4. Add the following Glui controls for texturing the cone:

a: texture modulate

b: texture decal

c. texture replace

d: texture blend

Use a red environment color for texture Blend. These controls should impact only the cone with the earth textures.

5. Include a lightmap with multi-texturing for the floor. This lightmap should only light a small spot on the floor. It will act like a 'flashlight'. Provide a Glui control to toggle it on and off. Provide Glui translation so that you can translate the center of the lit area on the floor.

CS6610 For the 6xxx courses, I expect there to be a perfectly reflective sphere balanced on the cone. You should environment map this sphere. Provide a Glui control such that you can update the environment map when clicked. You should use either the OpenGL 1.2 spheremap or Cube Maps. I would recommend the Cube Map.

CS5610 and CS6610

Output

The program should draw its output to an OpenGL window and have full functionality through the Glui interface described above (allowing camera movement as in the sample program).

Submission

Please handin from the CADE system. The handin name for this lab is "openGL2". Name your zip/tar openGL2.[zip|tar.gz] where tar is used for Linux and win for Windows. Handin your executable along with the source code and documentation describing how your user interface works, design choices you made and why you made them. Windows users should use the Zip utility and handin a single zipped file. Unix users should use the tar program followed by gzip to do the same.

Additional Resources

header for read routine SGI's "RGB" image format
source for read routine of SGI's "RGB" image format
example of how to use the image read routine
NewPlank.bmp
NewPlank.png
lightmap.png
lightmap.rgb