CMPS 160 -- Lab Assignment 4
Due date:
Midnight, Friday, May 8, 2015
Objectives:
Pick an object.
Description
-
Picking allows you to select an object in a scene.
An object can be an entire model (e.g. shark) or part of a model (e.g. a polygon).
For this assignment, our object is an entire model.
This assignment is based on Prog2 where we only have 1 object -- the shark.
So, there's just one object to pick.
To test if your picking works or not,
you will toggle the shading of the shark when it's repeatedly picked.
If you click elsewhere on the screen, nothing should happen.
The shark will initially be rendered using flat shading.
When it's picked, rendering is changed to smooth shading.
when it's picked again, rendering reverts back to flat shading.
And so on...
Picking is done with the left mouse button.
-
There are 2 general ways to implement shading:
(i) a ray casting approach, or
(ii) a framebuffer approach.
You can use either approach to implement your picking.
Here's some blog exchange with
info and links
.
Here's a
working example.
-
Bonus (20 points more for Lab 4):
If you use the right mouse button to pick on the object,
the projection is toggled between perspective and orthographic.
The initial projection is perspective projection, just like prog2.
Changing projection does not change the current shading option
(unless the object is picked again with the left mouse).
Grading:
This program will form part of your CMPS 160 grade.
The other components of CMPS 160 grade are your midterms and final project.
The header block should contain at least the following information:
name, cruzid, date, and brief description of your program.
This will be true for all future assignments and programs.
Rubric:
5 header blocks
5 code readability
10 inline comments
80 left pick: toggle shading
20 right pick: toggle projection (bonus)
Who graded your assignment:
matthew: ahosick -- jbernay
jiayu: jchen160 -- tmlinejo
Submission:
Submission must be done using the "submit" command from CATS.
- submit cmps160-ap.s15 lab4 lab4.tar, or
- submit cmps160-ap.s15 lab4 lab4.zip
This command should work from unix.ic.ucsc.edu.
Create and submit a subdirectory called lab4.
IT SHOULD CONTAIN ALL THE FILES NECESSARY FOR THIS PROGRAM TO RUN.
Tar or zip up prog1 before submitting.
Last modified
Friday, 01-May-2015 09:08:48 PDT.