CS 5610/6610 - Fall 2009

Homework Assignment 1

Texture Mapping (150 points)

Handed out: Sept 9, 2009

Due: Thursday 11:50pm (just before midnight), Sept 24, 2009

You will write an OpenGL program which lets you advance your skills in texture mapping.

Use the getting started program to help with GLUI

1. A white point light source (positional) using the OpenGL lighting model. Placed such that you can see shading (such as a location (45 deg up/right of the viewer).   A light placed at the viewer won’t work nor will a light orthogonal to the viewing direction.

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). You should have brick walls similar to the floor’s wood by using the brick texture (again, 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. (Hint for images to texture-maps: use GIMP to modify/convert images into something you can import for the texture, example code given below).

3. You should place a sphere in the center of the room floating slightly above the floor. This sphere should be appropriate scaled and texture-mapped with the image of the earth.  The earth texture should map around the sphere so that it looks like a globe.  The texture as an RGBA texture.

4. Include Glui functions that control the speed of a dissolve using the alpha channel.  You should dissolve the earth image to another image of your face (use your cell-phone or camera to get this image and GIMP to size it appropriately).  The Glui interface controls should start/stop/reset the dissolve and provide a speed control for the dissolve.  Reset means to put the earth image back on the sphere.

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.  10 points Extra credit for changing the size of the light-map.

6. You should provide Glui controls for the 4 main modes of texturing: modulate, replace, blend, decal and apply these to the earth’s texture on the sphere.  We’ll test these with the dissolve turned off so that’s what you’ll have to try out.  There will be weird interactions between the dissolve and some of the texturing modes (obviously).

CS6610 For the 6xxx courses, I expect there to be a perfectly reflective sphere in the scene. 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 ... a virtual track-ball).

Submission

Please handin from the CADE system. The handin name for this lab is "openGL1". Name your zip/tar openGL1.[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