What we discussed on Tuesday April 2:
On Tuesday April 2 we discussed splines.
First we talked about cubic splines in general,
then three ways of allowing users to specify cubic splines:
Hermite, Bezier and B-splines.
We showed how to transform from each of these to
the canonical form
at3 +
bt2 +
ct + d,
where 0 ≤ t ≤ 1.
You won't be responsible for splines
until next week's assignment.
I will be posting more detailed course notes for this material
together with next week's course notes.
What we discussed on Thursday April 4:
On Thursday April 4 we started off discussing how
to create surface normals for general purpose polygon smooth shaded meshes.
The general idea is to proceed in two steps:
-
Construct un-normalized
face normals
for each polygon face,
by adding up the cross products of all pairs of adjacent
edges, going around the polygon counterclockwise.
-
For each vertex, sum up the face normals for all
faces adjacent to that vertex, and
then normalize.
This method has the nice property that
the normals it produces at each vertex are more aligned with
the adjoining faces of greater area,
which results in more realistic surface shading.
You won't be responsible for constructing mesh normals
until next week's assignment.
We spent the bulk of the class modifying our
shader code to allow multiple shapes to
be rendered in the same scene,
each with its own transformation matrix
and surface material properties.
Also, at the suggestion of a student,
we also packaged up lighting to be easier
to specify and to animate.
The code we developed to do this is in
shader7.zip.
Homework, due before class Thursday April 11:
Your homework, due on Thursday April 11 before the start
of class, is fairly easy and should be a lot of fun.
Build from the code in shader7
to create your own original animated scene.
Try to use
m.save()
and
m.restore()
to create
hierarchical movements,
like we did when we created that walking person
several weeks ago.
As usual,
have a good time with it.
Use your imagination.
Be creative.
Surprise me. :-)
|