Lab 5: A Walk Through A Museum
CS 445: Computer Graphics, Fall 2008


[previous lab][schedule][next lab]

Goals


Practice

  • Download and run the TextureCube program. Read through it so that you understand what it is doing. Try changing the values of the texture coordinates. Try modifying the checkerboard texture to get something different, e.g. horizontal or diagonal stripes, sin waves, etc.
  • Collect together a set of 4-5 related pictures. They could be pictures of your family or friends, pictures of the campus, or pictures of different varieties of trees, dogs, musical instruments, etc. The only requirement is that they be related to each other in some way (and they are tasteful). You will also use these in the next part of the lab. In order to use an image as a texture in OpenGL, its width and height need to be powers of two (for OpenGL versions before 2.0) and not be too large (ideally at most 128x128). You will need to use some photo editing software to convert your images into the proper size. Place the resized images into the "images" folder in the TextureCube project.
  • In the code, replace percy with one of your images. If it doesn't show when you run the program, it is probably because it was not resized properly. Try adding additional choices for images.

Your Virtual Museum

In this part of the lab, you are going to create a virtual museum containing the images you collected from the first part of this lab. To do this, you will be combining, expanding, and modifying components of your navigation code and the TextureCube program.

Navigation and Room Geometry

Texturing the Floor and Pictures

Add Lighting

Add at least one light to the center top of the room. Look at the last lab to remember what code needs to be added.

Setting the Mode

In order to mix lighting and texturing, you need to set the environment mode. Experiment with different settings for the mode. For example, to set the mode to GL_DECAL, add the line

gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE,GL.GL_DECAL);
In general, the mode may be on of the following and where

Deliverables:


[top]  [Schedule]  [Home]