CS 5610/6610 – Spring 2016

Homework Assignment 1

CS 5610 / CS 6610

Spring 2016

 

Shader based Geometry and Lighting (100 points)

Handed out: January 21, 2016
Due: 11:59pm, February 10, 2016  THIS
IS AN UPDATED DUE DATE!

 

The gettingStarted.zip file has a basic program that renders a spinning cube.  The arcball works by using the left mouse button to rotate the scene (it updates the modelview matrix), the right mouse button to translate the scene (it updates the modelview matrix), the shift+right mouse button to zoom in/out the scene (it dollies the camera in/out in the lookat direction).  Sorry MAC users, you’ll have to get a multibutton mouse J. Use this Arcball implementation in your assignment.  It should be clear what to keep and how to maintain your matrices by the example.  This is a VS 2013 project.  To run in VS 2015, do the following:

1.      Right click the solution and then select retarget solution.

2.      Properties -> Linker -> add the lib legacy_stdio_definitions.lib

 

This will be the simplest program this semester.  It really is just getting things setup for you to have a framework for the following assignments.  You will write an OpenGL program which modifies the gettingstarted.zip program.  You should add the following geometry:

1.      Make a room (4-walls, a ceiling and a floor).  Use face culling to see into the room.

2.      Place a colored cube, like the getting started example but make the colors vertex attributes, on the floor with a sphere (also with color attributes, use an interesting color or use the superbible sphere model which has them) sitting on top of it.

3.      Have the ability to switch between vertex and fragment phong shading (use the superbible example to see an example shader code).  The ‘v’ key should change between these shading modes (switching shader programs).

4.      Use a point light above and slightly to the right of the camera. Not directly at the camera, you want to see shading on the sphere.

5.      Add the ability to move the camera with mouse interactions (arcball) in the window.  Left button should rotate the camera, right button should translate the camera with respect to the scene.   Use a key (shift) plus right mouse to move the camera in/out of the scene.

6.      Provide a reset with the ‘R’ key to a known camera position.

7.      Provide a ‘C’ key to switch between colors in the vertex attribute to a constant color for shading the sphere.

8.      Use perspective projection of course.

9.      Write up one page on what you have done, how long it took, issues you had and how  you overcame them, how to run your program and interaction modes.

CS 6610:

For this assignment, there is not an extra CS 6610 part.

 

Output

The program should draw its output to an OpenGL window of size 512x512 as in the example program.

You can feel free to change this.

 

Submission

Use Canvas to hand in your assignment. You can with zip or tar your solution. You should comment your code appropriately and hand in a web-page that will serve as complete documentation. Please include a writeup which should be a paragraph or two of difficulties and a paragraph or two of what you learned in this assignment along with some screen shots (or images).  A PDF or HTML file is best for this.

 

Windows users should use the Zip utility and handin a single zipped file. Unix users should use the tar program to do the same. We will recompile the programs to grade them. Make sure your workspace/program will compile for us. That is, be careful about your user-specific pathname variables! If you do this on a home machine, please allow sufficient time for porting to the CADE machines. We will grade based on compiling and running on the CADE machines.

Due to a bug in the handin program, do not include spaces in the names of the files that you submit, otherwise we will not receive them. For instance, "no spaces.txt" is not a valid filename and would not be received, while "no_spaces.txt" is valid. Please keep this in mind while handing in your assignment.

 

Points:

100 total:

Write up                         20

Correct scene                 50

Face Culling                   15

Lighting                          15