Preparation for the midterm
Here is a list of the items you'll want to
study up on for the midterm, which will be on Wednesday, March 24,
during the regular class time.
Everything on the midterm will be something
we covered in class.
Then further down below is a preliminary description of
the homework that will be due on Wednesday, March 31.
If you like, you can hold off on working on that
until after the midterm.
Topics to study up on for the midterm:
- Know the equations for intersecting a ray with a sphere
- Given the intersection of a ray with object A
(represented as a sequence of line segments),
and the intersection of the same ray ray with another object B,
know how to find the intersection of the same ray with
the shape (A intersect B).
- Be familiar with how the different parts of a 4x4 homogeneous
transformation matrix work (eg: how do you make a
translation, or rotation, or scale, or skew transformation)?
- Know what an orthonormal matrix is, and whether
different kinds of matrix transformations are commutative.
Understand how to combine transformation matrices by
matrix multiplication.
- Be prepared to describe a vector representation of a simple
three dimensional shape, such as a pyramid, cube, or prism,
as a set of vertex coordinates and a set of edges
(where each edge is just the index of a pair of vertices).
- Know how to find the the point in a plane where two given lines intersect,
or the line in a plane that contains two given points.
- Know what the dual of a shape is.
- Know how to make a system that will allow a user to
create simple polygons, drag them around on the screen,
and delete them.
Initial description of the homework
that will be due on Wednesday, March 31:
Your next homework will be to
write a Java applet that implements a simple
ray tracer to a flying saucer shape.
In this homework you should take the code you wrote
for ray tracing to the flying saucer, and
apply that, pixel by pixel, to render an image of
a flying saucer.
You will not yet need to create shading for the flying saucer.
You will be doing that in a later assignment.
Instead, for this assignment, you should assign a color to
each pixel of:
- White if the ray hits the first sphere surface of the flying saucer
- Gray if the ray hits the second sphere surface of the flying saucer
- Black if the ray misses the flying saucer
You can paint a single pixel a color (eg: gray) by doing (for example):
g.setColor(Color.gray);
g.drawRect(x, y, 1, 1);