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.

3D insect

You are to implement an OpenGL program that performs the following functionsThere are several aspects you should try to include, and they will be worth varying numbers of pointsBut, 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" dont worry about thisWell add lighting stuff in later onBut, 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 tasksHowever, 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 areYour 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 motionYour instructions should make it clear how you met the various components of the assignment, when options were givenAt least some motion must be specified by a mouse. Below is the detail instruction for the second part:

aCreate 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 pointThe insect, of course, will be more complicated than thisSpecifically, your insect should include:

  • Six legs, each leg with at least 2 segments
  • At least one "body" piece
  • A "head" piece
  • 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 modelIdeally, you could use things like spheres at the joints to hide theseparationthat will occur as the pieces moveYour model does not need to be particularly accurate or precise, or even look that much like a real insect (in fact, it almost certainly wont).

    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 jointsThe way you implement this motion is up to you, but it is suggested that you limit the motion in some fashionAt 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 fromFor the purposes of this assignment, the view changes do not need to be too complicated (e.g., you dont need a full fly-through).  There are several ways you can change viewing parametersThese include, but are not limited to:

  • Pan: moving the viewpoint and eyepoint from left to right or up and down
  • Object centered rotation: moving the eyepoint around the object, but with same focal point.
  • Rotating in place: letting the eyepoint stay in a fixed position, but change the direction of view.
  • Zooming: Zooming in on an object (from same position)
  • Driving: moving eypoint forward/backward
  • You should implement at least 3 different view changesThey may chosen from the above list, but are not limited to themThat is, you should allow the user to change at least 3 different parameters in the way they look at the modelThese should affect the view only, not the model itselfYou 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 controlsFor example, when modeling the insect, specifying additional parts/joints, choosing good shapes for the parts, etc. will earn more pointsSpecifying only the minimum number of parts using only rectangular boxes will earn you no subjective points.

    gAdditional Features.

    You have the chance to earn extra credit on this assignment by implementing additional featuresNote that the amount of effort to get these bonus points is not necessarily proportional to the amount of work theyll 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 insectThe insect shouldwalkforward (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 happeningThe walking motion of the legs should benaturallooking, and the insect should move forward as its legs move

    2)      Allow the user to control thewalkingof the insectThis 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), etcIn doing so, the insect should be able to turn in different directionsNote that the walking motion should still benaturali.e. the turning should correspond with different leg movements.

    In your README file, you should clearly explain what (if anything) you have implemented additionally

    Grading:

    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