CSS 451: Programming Assignment #2

Hierarchical Modeling and 3D Viewing

 

Due Time: Refer to the course web-site

 

Objective

In this programming assignment we refresh our memory of hierarchical modeling and practice using the math we have perfected in mp1 to set the parameters of spotlight and camera (3D Viewing).

 

Approach

Our world has three views with (at least) three objects, a hero object, a relatively high resolution floor (refer to HiResFloor.x) and one other mesh object. We need a sufficiently high resolution mesh floor with enough vertices for us to examine the finer results of illumination and shading. Make sure you include the HiResFloor or a mesh with at least a few thousand triangles.

 

The three views we have are:

World View: Through this view, the hero object and the mesh objects must be visible.

Observe View: Through this view, we can see the World View camera.

Hero View: Through this view, we can see what the hero object would see (please refer to the following).

 

Your hero object must consist of at least four components, a base, a lower frame, an upper frame and a head. These components must be connected into (at least) a 4-level deep scene node graph, where parent transformation effects the child transformation in a natural and expected manner. If you remember from CSS450, this is exactly the same hero-object specification from your final project, only now, we work in 3D space.

 

In addition:

 

1.      Head Geometry and Spotlight: The geometric shape of the head must convey a sense of front. You will place a spotlight in the head, with the spotlight pointing in the direction towards the front of the head. The relative position and orientation of the spotlight with respect to the head must remain constant at all times. This is to say, when the head is transformed, the spotlight must follow.

2.      Spotlight Hero View: You will map the parameters of the spotlight in the head to the camera for Hero View. The spotlight position will be the eye position, spotlight direction will be the viewing direction, and the angle-phi will be the fields of view. In addition, the camera’s up vector must properly reflect the head’s orientation changes. In this way, the Hero View always displays what the spotlight would illuminate.

3.      Spotlight drawing: You must support the drawing of the spotlight as a cone and a line pointing from the cone towards the spotlight shining direction. The flat side of the cone should point towards the spotlight shining direction. The cone and the color of the line must reflect the Diffuse component of the spotlight.

 

You must allow the user to alter the head spotlight’s phi-angle, and the color values. As in all our assignments, you should provide options for toggling axis frames for each components of the hero object, and under the user mouse control, you should support the rotation of your  camera about the world x and y axis (in the World View only). You should also provide a slider bar to allow user the option of zooming in the World View. Note that the Hero View is strictly controlled of the spotlight in the head component of the Hero Object and the user has no direct control over it. Finally, you must support a reset button to reset your world back to initial condition.

 

Credit Distribution

Here is how the credits are distributed in this assignment:

 

1.      Hero Object:                                                                                              25%

a.      At least 4 SceneNode deep                               10%

b.      Proper Transformation Support                       10%

c.      Rotation                                                            7%

 

 

2.      Head Spotlight:                                                                                         30%

a.      Fix orientation wrt to the head                         10%

b.      Drawing the Spotlight cone                             10%

c.      Drawing the Spotlight line                               5%

d.      Cone/line in right color                                    5%

 

 

3.      Hero View:                                                                                                25%

a.      Camera respect spotlight position/direction   10%

b.      Proper Up vector changes                                5%

c.      Phi/fov mapping                                               5%

d.      Proper update/display                                      5%

 

4.      Misc:                                                                                                          15%

a.      Axis Frame Drawing (on/off)                          2%

b.      Camera Manipulation                                      2%

c.      Observer View                                                  5%

d.      Reset Button                                                     5%

e.      Include at least 1 other D3DX Mesh                5%

f.      Style/correct submission etc.                                         5%        

 

7.   The following will cause serious credit lost:

a.      No High Resolution Floor                                -20%

b.      Camera does not rotate                                    -20%

c.      Hero looks remotely like mine                        -15%

 

 

 

Extra Credit:

 

(5%)      Constraint the transformation of your hero component so that you cannot transform the components apart (like mine).

 

(5%)      Support tracking, where the head (spotlight) will follow the last mesh object. Your implementation should, under the user control (think flying tiger, or driving car), allow the last mesh object to move forward and the head-spotlight will always track the moving object and thus shining the spot on the object as it moves.

 

This programming assignment will count 17% towards your final grade for this class.

 

 

WARNING: The number of lines of code for this assignment is not as large. However, it can be tricky figuring out the camera parameter for Hero View (from the spotlight). I expect you to spend more time on figuring out the math than coding.

 

Reminder: To support proper lighting, you should work with version 18 of the library (tutorials from Appendix A).