Course notes for November 13
Procedurally animating a mesh over time: In class we showed an example of the procedurally animated face mesh of my Interactive Fish java applet.
Here is the source code.
Note that I define a
If you implement something like this in JavaScript, you will need to keep two copies of your mesh: The original unmodified mesh, and the one that gets copied from the original and then vertex-filtered at every animation frame. When you modify the mesh, you will end up needing to change the vertex normals. To recompute vertex normals for a mesh, you can use the following algorithm:
If you are feeling ambitious, you can also try implementing this sort of filter in a vertex shader. In that case, you will need to be a bit more clever about modifying vertex normals. For example (since you will have greater compute power to work with), you can do finite differences to compute the new surface normals.
Layered keyframe animation: I showed a simple example of layered animation in this java applet. One thing to take away from this example is the way it allows its users to create layered transparency for parts of movement, in a way analogous to how PhotoShop lets you do layered transparency for just some pixels of an image but not others.
Two link inverse kinematics:
I went over, in some detail,
a simpler way to implement two-link inverse kinematics,
given a two-link chain at the origin,
with limb lengths
c = C•C
x = ((a2-b2)/c + 1)/2
D -= C(C•D)/c
y = √max(0, a2 - x2c)
D = xC + yD/|D|
The last line requires a square root, to compute |D| .
For efficiency, we can get the algorithm down to a single
square root by modifying the last two lines:
y = √max(0, a2 - x2c)/(D•D)
D = xC + yD
Homework: For homework due by class on Wednesday November 20, feel free to pick and choose from among the above directions in this week's homework. This is your chance to explore ideas in keyframe animation, character animation, procedural animation, creature animation, and related topics.
|