CMPS 160 -- Lab 4
Early if time stamp is before midnight Nov 12, 2016.
On time if time stamp is before midnight Nov 13, 2016.
Late submissions will not be accepted/graded.
Objectives:
Add camera control
Description:
Allow the user to change the viewpoint using GUI.
Bonus:
Full 3D rotations involve roll, pitch, and yaw
(e.g. from
point of view of pilot).
-
Look around.
When the user double clicks on an object,
the camera (LookFrom) is moved to the center of the object and a full 360
animated view is generated.
The required rotation is around the yaw axis (which is aligned with the
y-axis of the viewing coordinate frame).
-
Examine.
When an object is selected (left clicked)
and the user right clicks on the background,
the LookAt point is moved to the center of the object and a full 360
animated view looking at the selected object from different vantage points is generated.
This time, the required rotation is around the vertical axis of
the viewing coordinate system.
That is, you need to position the camera (LookFrom) around a circle
on the xz-plane.
Details:
-
Zooming.
Allow the user to zoom in and out. This is achieved by modifying the fov
parameter in your perspective call. Note that the camera position does not change.
To specify zooming, no objects must be selected (e.g. left click on the background
to deselect any previously picked objects).
Scrolling the wheel is then mapped to fov --
as the wheel is scrolled up, the fov is reduced thereby creating a zoom-in effect;
when the wheel is crolled down, the fov is increased thereby creating a zoom-out effect.
-
Panning.
Again with no objects selected,
when the user left clicks on the background and moves the mouse,
it will move the camera horizontally and vertically on XY-plane of the image plane.
Note that the image plane is not always aligned with the world coordinate frame
e.g. after the view has been rotated (see below).
Panning the camera produces an effect somewhat opposite
to what you saw with object translation.
For example, when the camera is panned to the right, objects appear to move to the left.
-
Move the camera in or out.
This functionality allows the camera to be moved forward or backward along
its current view direction.
If the user clicks on the background with the
middle mouse and scrolls the wheel, it will move the camera in or out along the z-coordinate of
the viewing coordinate frame.
Unlike the zooming operation mentioned above, fov is unchanged,
but this will actually change the position of the camera.
Resource:
Detecting
double clicks
Read the examples in chapter 7 of the Matsuda-Lea book.
Grading:
-
Rubric:
You start off with 100 points. You earn additional credit by turning in your assignment
early and/or implement additional features. You lose credit for missing functionality,
incorrect results, poorly documented or formatted code, or not following instructions.
Below is a partial list:
up to 10 points off for poor features.html file
up to 10 points off for inadequate comments or hard-to-read code
up to 10 points off for not following instructions
up to 10 points off for special handling
functionality points depending on importance
Make sure you:
a. submit the right files you want us to grade,
b. have tested your code on the browsers in the lab.
c. follow the general instructions described in overview.html
-
Who graded your assignment:
andy: aagrawa6 -
aashwin: drooney -
victor: mespirit -
Submission:
See
course overview
for instructions on what to submit and what not to submit.
Put materials in a folder named lab4 and zip it up.
Submission must be done using the "submit" command from unix.ic.ucsc.edu
- submit cmps160-ap.f16 lab4 lab4.zip
Last modified
Tuesday, 22-Jan-2019 09:42:16 PST.