CMPS 160 -- Programming Assignment 4 (viewing transformations)
Due date:
Midnight, Friday, May 29, 2015
Early bonus: before midnight, May 28.
Late submission until midnight, May 30.
Objectives:
Learn camera control and how it differs from object transformations.
Description:
Implement different camera functionality.
Note: camera and viewer are used synomymously.
Requirements:
-
General requirement is that functionality for object selection (i.e. picking
between two sharks) and object transformations (i.e. translate, scale, and
rotate the selected shark) is still present. The following list are additional
requirements on top of those listed in prog3.
Note that you may need to combine the following user interface specs with a
key input (e.g. with `c' for camera or `v' for viewer) to distinguish them
from what you have in prog3.
-
20% of functionality: (zooming)
Allow the camera to zoom in and zoom out in the scene using the
middle button and mouse movements.
Move the mouse up to zoom in and down to zoom out.
There's two ways to do this:
(i) translate the camera along the positive Z-axis in the viewing coordinate
frame to zoom in, or
(ii) change the fov of the camera (smaller to zoom in, and larger to zoom out).
You can pick either way.
Note that there will be noticeable difference based on lighting.
If the camera is actually translated, the specular lighting will change
since the viewer is taken into account.
If the camera is fixed in place and only the fov is changed,
then the lighting should be the same.
Note that this is also different from scaling as that changes the positions
of the object coordinates and hence affects diffuse lighting as well.
-
40% of functionality: (panning)
Allow the camera to translate horizontally and vertically on the image plane
(XY-plane of the viewing coordinate frame).
The user achieves this with left button held down and mouse is moved left-right
(horizontal translation of camera) or moved up-down (vertical translation of camera).
The effect appears opposite to what you saw with object translation.
To distinguish between the two,
panning the camera should affect only the specular lighting, but not the diffuse lighting.
While translating the object affects both specular and diffuse lighting.
-
20% of functionality: (examine an object)
Provide a GUI button labeled "examine".
When this button is pressed, the camera is rotated 360 degrees around
the center of the currently selected object. By default, the first shark
is the selected object if none has been selected prior to clicking on the
"examine" button.
Assume that the camera is currently at some location (Cx,Cy,Cz) in world coordinates.
The center of the selected object is at location (Ox,Oy,Oz) in world coordinates.
The camera will go around this object using the distance from its current location
as the radius. The path of the camera will trace out a circle on the z = Cz plane.
Points on this circle are the LookFrom points, while (Ox,Oy,Oz) is the LookAt point.
-
20% of functionality: (look around)
Provide a GUI button labeled "look around".
When this button is pressed, the camera is rotated 360 degrees around
its current position in world space.
That is, rotate around the vertical axis (of the world) by 360 degrees.
-
Note that all the requirements from prog3 still applies.
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
16 camera zooming
32 panning
16 examine mode
16 look around mode
Who graded your assignment:
jiayu: ahosick -- jbernay
matthew: jchen160 -- tmlinejo
Submission:
Submission must be done using the "submit" command from CATS.
- submit cmps160-ap.s15 prog4 prog4.tar, or
- submit cmps160-ap.s15 prog4 prog4.zip
This command should work from unix.ic.ucsc.edu.
Create and submit a subdirectory called prog4.
IT SHOULD CONTAIN ALL THE FILES NECESSARY FOR THIS PROGRAM TO RUN.
Tar or zip up prog4 before submitting.
Last modified
Wednesday, 27-May-2015 21:21:57 PDT.