Reference no: EM132261866
Assignment: In this assignment, you will write a 3D graphics program to display hierarchical kinematic models. You can make use of a starter program provided on the CS 408 website.
1. Create a program to display a 3D wooden model similar to the one shown in the notes. If working in C++/OpenGL, you can download the "simple model of a person" (Main.cpp, Main.h) from the Notes / Hierarchical Kinematic Modelling part of the online notes.
The given model has a spherical head, a cylindrical neck, a cylindrical torso, a left leg made of two cylinders, and a left arm made of two cylinders.
Your displayed model should have the above features plus (1) right arm, (2) right leg, (3) nose, (4) two ears, (5) two feet - on the end of the legs!, and (6) some other body part(s) of your choosing.
Add motion to the right arm, right leg, two feet, and any other body part(s).
2. Draw the tree corresponding to the model corresponding to your program from question 1. Show the Constant, Variable, and Node transformations on the diagram. You do not have to show any transformations in the display_cylinder or display_* functions, where * is some body part. We will consider those transformations to be part of the objects. Your picture can be submitted as a neatly hand drawn picture or a picture drawn with some drawing software. Hand drawn pictures can be scanned as PDFs/JPGs and submitted to URCourses or submitted in paper in lecture on Thursday or slipped under my office door.
3. Construct a table with columns for the Node Index, Object Model (e.g., "Neck"), Parent Index, Constant Transformation, Variable Transformation, Node Transformation, and Child Indices for your program from question 1. See example table in notes (but add more columns). For the Constant Transformation, you should have X, Y, and Z columns, and for the Variable Transformation, you should have one column that indicates whether the transform is Rx (meaning rotation around the X axis), Ry, or Rz and two other columns giving the minimum and maximum amounts of rotation that you think are reasonable for a human-like body. See also question 4. Submit the answer in a Word/txt/pdf/Excel file showing the table. It can also be submitted on paper.
4. Change the program from question 1 to use separate minimum and maximum values for every limb (instead of just giving them all minimum 0 and maximum 45). Adjust the minimum and maximum values in your table for question 3 according to your experience of what a human body is capable of in these types of motions. Suggestion: add two arrays, one for max and one for min. For each joint, the figure should progress from its current setting to the maximum and then down to the minimum and then back to the maximum, etc.
5. A pose vector gives the current values for the parameters of the Variable Transformations. For example, the angle by which the wooden figure is leaning forward its neck is given by theta[1] in the program. Determine the pose vector corresponding to the following configurations:
a. pose 0: figure standing straight with legs straight down and arms straight out;
b. pose 1: figure standing with upper right arm straight out and lower right arm turned straight up; right leg out in kicking motion;
c. pose 2: figure standing with upper left arm straight out and lower left arm turned straight up; lower part of right leg back
Submit the answer in a Word/txt/pdf/Excel file showing three pose vectors. It can also be submitted on paper.
6. Change the program from question 1 to perform animations between poses. Animation can be performed by gradually changing the angle parameters of the Variable Transformations between one pose and another and back and repeat. Create three possible animations by setting the initial and final poses:
a. On input ‘f', set one pose to be pose 0 and the other to be pose 1.
b. On input ‘b', set one pose to be pose 0 and the other to be pose 2.
c. Add more poses of your choice and choose a keyboard key to cause the figure to animate motion between those two poses.