Assignment 4 due by 03/17/2013
[150 points] This assignment will help you learn the basic OpenGL commands related to both modeling transformations and basic viewing transformations. The material you will need for doing the homework is found mainly in chapter 3 of the OpenGL programming guide.
You are to implement an OpenGL program that performs the following functions. There are several aspects you should try to include, and they will be worth varying numbers of points. But, you may get significant partial credit by doing some parts, even if others are skipped.
Note: we have not discussed lighting, so most of your models will look very "flat" don’t worry about this. We’ll add lighting stuff in later on. But, you should use different colors to highlight different parts, so that they can be distinguished.
As a reminder, you are not to use outside code to do these tasks. However, you may use the source code included in the OpenGL programming guide or in Hearn and Baker, and this might give you a good starting point.
You should submit, along with your code, a README file that tells what the controls for the system are. Your controls should not be too complicated, and should make some sense (i.e. not just random motions). A common way is to use a key command to set a mode (e.g. move hand mode, or zoom mode, etc.), then make the mouse control the motion. Your instructions should make it clear how you met the various components of the assignment, when options were given. At least some motion must be specified by a mouse. Below is the detail instruction for the second part:
a. Create a 3D hierarchical model of an "insect".
You can use the example provided in the book (pages 152-154) for the robot arm as a starting point. The insect, of course, will be more complicated than this. Specifically, your insect should include:
You should model this with reasonable shapes - see appendix D for some of the shapes GLUT provides for you (these will be sufficient) scaling/translating/rotating these will allow you to build a very basic, but still reasonably complex model. Ideally, you could use things like spheres at the joints to hide the “separation” that will occur as the pieces move. Your model does not need to be particularly accurate or precise, or even look that much like a real insect (in fact, it almost certainly won’t).
b. Allow the user to control the motion of the insect.
That is, the user should be able to make the insect move at the various joints. The way you implement this motion is up to you, but it is suggested that you limit the motion in some fashion. At least one joint should have at least two degrees of freedom i.e. be able to rotate in two orthogonal directions (think your wrist vs. your finger joints). The head would be an obvious choice here.
c. Allow the user to change the view parameters.
That is, you must allow the user to actually change things like the direction and orientation being viewed from. For the purposes of this assignment, the view changes do not need to be too complicated (e.g., you don’t need a full fly-through). There are several ways you can change viewing parameters. These include, but are not limited to:
You should implement at least 3 different view changes. They may chosen from the above list, but are not limited to them. That is, you should allow the user to change at least 3 different parameters in the way they look at the model. These should affect the view only, not the model itself. You should have at least one that affects the projection matrix, and at least one that affects the modelview matrix.
d. Include hidden surface removal (see the very beginning of chapter 5 of the OpenGL programming guide).
Without hidden surface removal, things could look quite wrong, with the most recently drawn thing always appearing in front. You should use opengl functions to do hidden surface removal. You should run both backface culling and Z-buffer algorithm.
f. Subjective Evaluation.
A portion of your grade will be based on a subjective evaluation of "how good" of a job you have done on the previous parts: modeling the insect, providing reasonable controls for the insect movement, and providing reasonable view controls. For example, when modeling the insect, specifying additional parts/joints, choosing good shapes for the parts, etc. will earn more points. Specifying only the minimum number of parts using only rectangular boxes will earn you no subjective points.
g. Additional Features.
You have the chance to earn extra credit on this assignment by implementing additional features. Note that the amount of effort to get these bonus points is not necessarily proportional to the amount of work they’ll require (i.e. it can be quite a bit of work for not too many bonus points).
1) Put together a motion animation for the insect. The insect should “walk” forward (or around) in some pattern by moving its legs (note that you do not need to allow a user to specify individual joint motion while this is happening. The walking motion of the legs should be “natural” looking, and the insect should move forward as its legs move.
2) Allow the user to control the “walking” of the insect. This could be by giving directions (such as turn to the left/right by moving the mouse), giving a goal position (e.g. clicking at some point in front of it), etc. In doing so, the insect should be able to turn in different directions. Note that the walking motion should still be “natural” i.e. the turning should correspond with different leg movements.
In your README file, you should clearly explain what (if anything) you have implemented additionally.
a. Overall: [10 points]
[5 points] Basic requirements met, including README, window, etc.
[5 points] At least some movement (model or view or both) specified using mouse.
b. Model Specification: [30 points]
[15 points] Insect put into place, with minimum number of pieces
[15 points] Pieces specified in good configuration
[5 points] Variation in coloring to distinguish (some) different parts
c. Model Movement: [35 points]
[30 points] User control over joint motion
[5 points] At least one joint with at least two orthogonal rotational motions
d. View Modification: [35 points]
[30 points] Three view changes specified (10 points each), and working correctly
[5 points] At least one change in projection and at least one in modelview matrix
e. Hidden Surface Removal: [10 points]
[10 points] Hidden surface removal included
f. Subjective Evaluations: [30 points]
[10 points] Insect is modeled well part shapes are reasonable, proportional, etc.
[5 points] Controls over joint motion are intuitive
[5 points] Joint motion is limited to appropriate ranges
[5 points] Choices of view changes are reasonable
[5 points] Controls over view are intuitive
g. Additional Features: [up to 20 bonus points]
[10 points] Basic walking motion implemented
[10 points] Walking direction specification