WPI Computer Science Department

Computer Science Department
------------------------------------------

CS 4731, D Term 2014 Homework 3


Homework 3: Due Thursday, April 17, 2014, 11.59PM (12.5/100 points)

Homework 3 Overview

In this project, we will explore hierarchical modeling of 3D meshes. We will also implement flexible camera control allowing the user to view our scenes from various angles. You should extend your project 2 submission to implement homework 3. If you did not finish homework 2, use the starter code from homework 2 as a starting point for this homework.

Homework 3

Flexible Camera Control: In this part of the project, we want to allow the user to move the camera and view our mesh from various points. You should develop a camera class to store information about your camera. The minimal controls/keystrokes are as follows:
"n": Slide camera 1 unit in the +ve n direction
"N": Slide camera 1 unit in the -ve n direction
"v": Slide camera 1 unit in the +ve v direction
"V": Slide camera 1 unit in the -ve v direction
"u": Slide camera 1 unit in the +ve u direction
"U": Slide camera 1 unit in the -ve u direction
"j": Change camera yaw by 2 degrees in the clockwise direction
"J": Change camera yaw by 2 degrees in the anticlockwise direction
"k": Change camera roll by 2 degrees in the clockwise direction
"K": Change camera roll by 2 degrees in the anticlockwise direction
"l": Change camera pitch by 2 degrees in the clockwise direction
"L": Change camera pitch by 2 degrees in the anticlockwise direction

Note: 1 unit of movement for the slide depends on your camera distance from the objects and should be chosen so that each slide movement is not too much or too little.

Next, we shall explore hierarchical modelling. The goal of this part of the assignment is to familiarize yourself with transformations and hierarchical modeling in OpenGL using a matrix stack. You will be modeling and animating a kinetic sculpture such as Alexander Calder's hanging mobiles. Example images are given below:


 

Here is a [ Video ] that shows such a kinetic sculpture in motion. Your task is to model and animate a kinetic sculpture. In order to do so, you need to first construct a scene containing several objects, then you need to organize them hierarchically and simulate their motions according to the hierarchy you define. Use several of the PLY models you rendered in project 2 in your hierarchy. All models should be properly sized so that they do not look disproportionate or display awkwardly. All models should have approximately the same size. In the video, you should have noticed multiple axes of movement for each model, where the PLY model may rotate about it's own axis while rotating around a larger arm off which it is hanging. Implement this effect!! To draw the arms connecting the meshes, you can just draw horizontal lines and to connect the meshes to the ends of the arm, just draw vertical lines. You can continue to draw the meshes as wireframes. Also, make sure you set up perspective projection

Matrix stack You will need to implement a matrix stack, including PushMatrix( ) and PopMatrix( ) routines. You may use a simple linked list to store the stack or use a more sophisticated tree structure.

Animation Define a suitable frame rate such as 30 FPS and animate your model at that speed. Every 1/30 of a second, the animator will call the display callback function to re-draw everything. By displaying objects at slightly different locations (corresponding to camera or object movements) every frame, you can simulate an animation. Be mindful of performance issues while you implement this homework. As your scene size grows, avoid unnecessary re-initialization, buffer recopying, file reopening that could slow down your program considerably.

Requirements: Your sculpture must consist of at least 8 unique meshes with interesting colors. Each mesh should have a different color. Your sculpture must contain at least 4 levels of hierarchy. See the second image at the top of the page. The animation should move all parts of the sculpture. It should be physically motivated and make sense. --- that is, there are no magical, free-flying shapes or disjointed movements. Objects should remain connected in whatever way you connected them as you animate them.

All mesh models should rotate counter-clockwise about their own Y axis. The arm of Level 1 of the hierarchy should rotate clockwise, the arm of level 2 of the hierarchy should rotate counter-clockwise, the arm of level 3 should rotate clockwise, and so on. Basically, the arms of consecutive levels of the hierarchy should alternate between rotating clockwise and counter-clockwise.

Additional Keystrokes

Also implement the following additional keystrokes. Important Note: Once you decide how objects in your hierarchy should be connected, they should remain connected in that way. For instance, even when objects start to move in a sinusoidal pattern, they should still be connected to the arm and the arm should move up and down accordingly too. No magical or disjointed movements. The simulated movements should all be plausible.

Submitting Your Work

Make sure to double-check that everything works before submitting. Submit all your executable and source files. Put all your work files (Visual Studio solution, OpenGL program, shaders, executable and input files into a folder and zip it. Essentially, after your project is complete, just zip the project directory created by Visual Studio. Submit your assignment using web-based turnin

Create documentation for your program and submit it along with the project inside the zip file. Your documentation can be either a pure ASCII text or Microsoft Word file. The documentation does not have to be long. Briefly describe the structure of your program, what each file turned in contains. Explain briefly what each module does and tie in your filenames. Most importantly, give clear instructions on how to compile and run your program. MAKE SURE IT RUNS before submission. Name your zip file according to the convention FirstName_lastName_hw3.zip. Make sure your final submission runs in the zoolab before submission!!!


[Feedback] [Search Our Web] [Help & Index]

[Return to the WPI Homepage] [Return to CS Homepage]

mailto:emmanuel@cs.wpi.edu