CSE 160 -- Prog 4
Due before midnight, Sunday, May 23, 2021.
Late submissions will not be accepted/graded.
Objectives:
Learn about camera control and perspective projection.
Description:
Again building on what you have from your previous program,
allow users to interactively navigate through your virtual world
by moving the camera, point it different ways, zoom in/out, etc.
Also allow users to switch between orthographic view (what you have
all this time) and a more natural looking perspective view.
Camera control allows very exciting views of your virtual world
and is used from flight simulators, riding on a roller coaster,
controlling your drone, or jumping into warp drive.
We will have a contest for the project with the slickest camera control/animation.
Details:
-
Camera Control:
-
The basics are very similar to object transformation.
Using a combination of translate, rotate, scale you will
be controlling your camera and allowing the user to navigate
your virtual world.
However,
unlike object transformation where you're transforming objects
within the world, you will be transforming the camera instead.
You can think of the process as specifying a position in space
for the camera "object" to be at, and a frame of reference for
the camera i.e. where is it looking at, and what is its orientation?
In reality, what we're going to do is to transform the entire world
so that everything will be with respect to the camera's view.
More about this in the labs.
-
Animating your camera movement, etc. simply involves interpolation.
Using drones as an example, you would typically specify way points
that the drone needs to visit during its flight. Along the way,
the drone camera could simply be pointing downwards.
Obviously, you can add bells and whistles to this basic setup.
For example, travelling in a straight line from one point to
the next may not make sense in some scenarios e.g. gopro/helmet-cam
on downhill skier.
In this case, you may want to use a fancier interpolation to create
a smoother path (we'll talk about curves in lecture).
Likewise, the helmet-cam may be pointed towards where the skiier wants
to go rather than just straight down.
Once you have the path planned out, your animation would simply be
transformation of the world to the camera view for each camera setup along the path.
-
Zoom is not only for remote learning, it's also a parameter used with cameras.
This is achieved by simply changing the amount of the world that's visible to the
camera via the "field of view" (FOV) parameter. The smaller the FOV, the larger the zoom factor.
Note that zooming in/out is different than moving the camera closer/farther away.
How can you tell the difference?
Hint: what visual effect would depend on viewer (camera) position?
-
To get a new perspective of your world,
you can toggle between perspective and orthographic projection.
Lecture will cover the math, but this can be done with a simple webGL call.
Note: you may want to do this before you implement zooming or you might think
you have a bug.
Resources:
Grading:
-
Rubric:
You start off with 100 points.
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, or inadequate comments or bad code
- up to 10 points off for not following instructions or needing special handling to
grade your homework.
- functionality points depending on importance (remaining 80 points)
For this program, building upon your previous assignment (i.e. you can create a
lit and shaded scene with at least 2 cylinders), new functionality requirements are:
- Camera control: (30 points)
allow user to modify camera viewing frames
- Interaction with lights: (20 points)
view dependent lighting effects i.e. specular highlights must be correct
- Modify view volume: (20 points)
support setOrtho and setPerspective calls
- Animation: (10 points)
support for basic linear interpolation
- Animation BONUS: (10 points)
support for cubic curve interpolation
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:
Thomas Cannon: thwcanno@ucsc.edu
Submission:
Put materials in a folder named prog4 and zip it up.
Read the
for instructions on how to submit your work.
Last modified
Monday, 31-May-2021 08:06:34 PDT.