Project2Fall14

From Immersive Visualization Lab Wiki
Revision as of 01:05, 18 October 2014 by Jschulze (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Project 2: Viewing 3D Scenes

This homework assignment consists of three parts, but only the first two are mandatory to get full credit (100 points). In the first part you will need to implement camera matrices and apply them to a simple scene. In the second part you will need to load 3D point clouds and display them with your viewer. In the third, optional part you will be asked to improve the visual quality of your point clouds.

This assignment is due on Friday, October 24th at 3:30pm and needs to be presented to the course staff on the due date.

The project will be discussed by the TAs on Monday, October 20th at 5pm in Peterson Hall 102.

1. The Camera Matrix (50 Points)

1a. Creating the Camera Matrix (25 Points)

As described in the lecture slides, create a camera class Camera with member variables for a 'center of projection' e, a 'look at point' d, and an 'up vector' up (10 points). The class should have an internal camera matrix C, derived from e, d and up (10 points).

Add a method called something like getGLMatrix to your camera class to access the components of the camera matrix C as an array of 16 values of type GLdouble in the order OpenGL expects them (column-major). Note that many of your Matrix4 classes use row-major order. You will need this method in part 1b. If your camera matrix already stores the matrix components in column-major order, you do not need to do a conversion but can directly pass the pointer to the matrix array instead. (5 points)

1b. Testing (25 Points)

As a basis you can use your source code from last week. We provide source code to generate a simple scene with a house to test your camera matrix implementation. Add this code to render the house (10 points).

Update: If you can, add the house to your existing software application and support keyboard keys to switch to it (eg, F8 and F9, which are not used in part 2 of this project).

Make sure the OpenGL's projection matrix is set as it was in the Cube example from assignment 1.

In your GLUT Display callback, set OpenGL's model-view matrix to your camera matrix C:

  glMatrixMode(GL_MODELVIEW);
  glLoadMatrixf(camera.getCameraMatrix().getValues());

Do not use the gluLookAt function in this homework assignment (this is a one time exception).

Render two images of the scene using these two sets of parameters for your camera matrix:

  • Image 1:
    • Center of projection: 0, 10, 10
    • Look at point: 0, 0, 0
    • Up vector 0, 1, 0
  • Image 2:
    • Center of projection: -15, 5, 10
    • Look at point: -5, 0, 0
    • Up vector 0, 1, 0.5

Compare your implementation to the correct result images shown below. If you can accurately re-create the images you will receive 5 points for each image. Note that you need to set OpenGL's lighting to 'off' with glDisable(GL_LIGHTING) to match your results.

House1-half.png House2-half.png
Image 1 Image 2