Computer Graphics
Summer 2007
G22.2270-001

Tuesdays, 6pm - 8:20pm
WWH 101



Assigment 3
DUE: Wednesday 6/20/06 midnight (11:59pm)



In this assignment you will set up an environment with textured objects.

Your program should display a scene placed inside a cube. Interior of each face of the cube should have texture mapped to it. Each object on the scene will also have a texture. You are free to use any texture you want.


The scene should contain at least the following objects:
Position the objects and camera such that the whole scene is visible.  Make sure to transform the cylinder at the scene such that the caps will be visible. Also tilt the sphere slightly to have the poles visible.

User Interaction

Up/Down Keys : Moves camera away from/towards the center of the scene.
Left/Right Keys : Moves camera to the left/right of the scene.
Key 'm'               : Toggle mipmaps for textures
Key  'f'                : Toggle filters between linear and nearest neighbor.


Restrictions

Do not use the following commands in this assignment:
*glutSphere, gluSphere
*glutCylinder, gluCylinder


Note: Feel free to use all these commands for debugging your code. Once you are sure everything else works replace these calls with your versions.


Implementation Help


The following two files, tga.cpp and tga.h provide functions to read/write tga files. You can use function calls within these files to load texture data from images. Note that tga files encode images using BGRA instead of RGBA. After you read the image, make sure to write a function that flips the red component with the blue component.

Note that you can convert any image to tga format using ImageMagick convert tool or GIMP.  Or of course feel free to look for tga files online.

If you're having trouble with finding images with an alpha channel you can add one to any image of your own using some image manipulation program. One set of instructions to do so using Adobe Photoshop can be found at this link: http://www.artifice.com/tips/alpha_textures.html . There is an abundance of such instructions on the web so feel free to search yourself if this is not very clear.



Adapted from one of Denis Zorin's assignments.