CS 4554- Computer Graphics I: Assignment 3

This project will build on the current project and allow improved control of viewpoint and rendering. In this lab the viewer will start in the middle of a room with objects from the 3D model library at various places in the room. The viewer should be able to look up, down, left right, and move through the room using simple commands. The viewer should not be able to go through (penetrate) the walls of the room..

Requirements

1. Render a room with 4 walls, ceiling and floor.

2. Place several objects in the room.

3. Objects should have appropriate normals and back face removal.

4. Be able to move around the room using keyboard keys (arrows)

5. Be able to change the direction you are looking with the mouse or keyboard (up, down, left, right)

6. Render objects using shaders including at least:

a. Phong illumination (per-pixel rendering)

b. Texture mapping of room walls



Notes:

1. Use the camera position to see if you are behind walls (vector from camera to wall center vs. wall normal).

2. Use the provided code as a starting point for loading shaders and textures.

a) Windows

b) Mac

c) Files you need: brick_color_map.PNG brick_normal_map.PNG lattice.frag lattice.vert

3. To access the new OpenGL functions to load and compile shaders on the Mac you have to include . On Mac you will also need to add the libpng package to your computer if you do not already have it (this is for loading textures)

4. On windows, you have to use the OpenGL extension wrangler in order to get pointers to all the functions you are going to use. The wrangler can be found at:

a. http://glew.sourceforge.net/

b. Instructions (also online):

// Download GLEW from http://glew.sourceforge.net/install.html

// build in release mode or get pre-built windows binaries.


// copy glew\glew-1.5.3\bin\glew32.dll to your windows\system32 directory


// Put the GLEW library and header files forwhere the compiler can see them,

// such as the visual studio include and library directories:


// copy glew\glew-1.5.3\lib\glew32.lib (VC_ROOT)/lib

// copy glew\glew-1.5.3\include\GL\glew.h {VC ROOT}/Include/GL

// copy glew\glew-1.5.3\include\GL\wglew.h {VC ROOT}/Include/GL


// My copy of visual studio 8 has these directories (VC_ROOT) here:

// C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\gl

///C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib


// In your program include before or

// call the glew initialization function right after window creation:

// glutCreateWindow (argv[0]);

// GLenum err = glewInit();

// if (GLEW_OK != err)

// return 0;

// }

// If you do not include the glew library, you will get link errors (opngl

// functions not found)

// If you do not call glewInit() you will get runtime errors (NULL pointers)


Above and beyond the call of duty:

1. Add multiple light sources to the room

2. Add additional rendering effects, such as reflection, light maps, shadows, or something of your own choosing.

3. Move smoothly through the room. Turn along an arc instead of pivoting

4. Add additional rooms and the ability to visit them

5. Incorporate ability to shoot objects, and show visually where the hit occurs