CSS 450: Programming Assignment #5

Hierarchical Modeling and Direct Manipulation

 

Due time: Please refer to our course web-site

 

Objectives

This assignment aims at letting your familiarize with hierarchical modeling and practice with the very many coordinate systems involved by implementing a direct manipulation tool.

 

Note: The number of lines of code required for this assignment is not large, but you must understand the system we are working with, the math for transformation, and the GUI binding. Make sure you understand what you are doing!

 

Approach

You will build a web-site that defines a hierarchical model with no explicit a user interface. Your hierarchical model must satisfy the following conditions:

1.       At least four SceneNodes organized into three generations (so there will be one pair of siblings in the hierarchy)

2.       At least three of the SceneNodes must be instances of the same data type

3.       All SceneNodes must have at least four Renderables.

 

Here is an example of SceneNode, consisting of four SquareRenderable and one CircleRenderable and satisfies the “at least four Renderable” requirement:

 

 

Here is an example of a hierarchical model that is build based on the above SceneNode and almost satisfy the specified requirement:

This model has three generations of SceneNode, with three instances of the same data type. However, the base node only has two Renderables.

 

To help manipulate this hierarchy, you will build a direct manipulator. A direct manipulator is a graphics GUI element that is defined to manipulate the Transform of a SceneNode. The direct manipulator is activated whenever the center position of a SceneNode is LMB clicked on.

 

Notice the three square knobs on the manipulator, the knob at the origin controls translation, the knob on the right controls scaling, and the knob to the top controls rotation. You user must be able to LMB on any of these knobs and controls the Transform object of the SceneNode.

 

The above image shows the SceneNode after user manipulated the translation, scale, and rotation of the SceneNode.

 

Hints:

·         My implementation is based on Example 7.3.

·         To detected mouse click on the control knobs, you would need to transform manipulator knob positions into the WC

o    In order to perform this transform, the manipulator must record the concatenated transformation of the Scene Tree, this is the objToWC transform.

o    Note that, Manipulator is defined to manipulate the Transform of a SceneNode, this means, first matrix of the objToWC transform will change. You must support this.

o    In my implementation, my manipulator keeps the concatenated results of all ancestor transformations except the SceneNode being manipulated. This last transform is concatenated each time when I need to detect if a knob is clicked on.

·         There is no explicit GUI requirements for this MP, but, you can show explicit GUI to allow testing of your hierarchical model.

·         Note: explicit GUI does not need to work in conjunction with direct manipulation (mine does not work together, because my manipulator caches objToWC transform).

 

Credit Distribution

Here is how the credits are distributed in this assignment:

 

1.

Hierarchical Model (very different from mine!):

 

35%

a.       At least three instances of the same data type

b.       Each SceneNode contains at least four different Renderables

c.        At least three generations

d.       Your model looks similar to mine

 

NOTE: you will receive zero credit if your direct manipulator does not work and there is no GUI to show the proper function of this hierarchy.

15%

10%

15%

-25%

2.

Proper showing of the Manipulator at correct mouse click positions

 

15%

 

 

 

 

a.       Able to show the manipulator before any operations at root node

b.       Able to show the manipulator before any operations at any node

c.        Able to show the manipulator after manipulation at any node

 

5%
10%

5%

3.

Proper support for direct manipulated translation

 

15%

 

a.       Able to grab and move the selected SceneNode the first time

b.       Able to grab and move the root SceneNode after manipulations

c.        Able to grab and move any SceneNode after manipulations

5%

10%

5%

4.

Proper support for direct manipulated scaling

 

15%

 

a.       Able to grab and scale the selected SceneNode the first time

b.       Able to grab and scale the root SceneNode after manipulations

c.        Able to grab and scale any SceneNode after manipulations

 

5%

10%

5%

5.

Proper support direct manipulated rotation

 

15%

 

 

 

a.       Able to grab and rotate the selected SceneNode the first time

b.       Able to grab and rotate the root SceneNode after manipulations

c.        Able to grab and rotate any SceneNode after manipulations

5%

10%

5%

6.

Submission:

 

5%

a.       proper zip file and project name

b.       No useless files submitted

 

 

Extra Credit:

 

Make sure your extra efforts are related to this assignment: examples:

·         Create multiple instances of your hierarchical model: 5pt

·         With multiple instances

o    Support selection of instance: 10pt (e.g., via mouse click)

o    Support direct manipulator on any of the SceneNodes on any of the instances: 20pt

·         Proper coordination between GUI and direct manipulation such that both are bind properly and works in collaboration: 20pt

 

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