SLIDE 2
What did we talk about last time? Euler angles Quaternions Started vertex blending and morphing
SLIDE 3
SLIDE 4
SLIDE 5
SLIDE 6
SLIDE 7
SLIDE 8
If we animate by moving rigid bodies around each other, joints
won't look natural
To do so, we define bones and skin and have the rigid bone
changes dictate blended changes in the skin
SLIDE 9 The following equation shows the effect that each bone i (and
its corresponding animation transform matrix Bi(t) and bone to world transform matrix Mi ) have on the p, the original location of a vertex
Vertex blending is popular in part because it can be computed
in hardware with the vertex shader
∑ ∑
− = − = −
= =
1 1 1
1 where ) ( ) (
n i i n i i i i
w t w t p M B u
SLIDE 10 Morphing is the technique for interpolating between two
complete 3D models
It has two problems:
▪ What if there is not a 1 to 1 correspondence between vertices?
▪ How do we combine the two models?
SLIDE 11 We're going to ignore the correspondence problem (because
it's really hard)
If there's a 1 to 1 correspondence, we use parameter s∈[0,1]
to indicate where we are between the models and then find the new location m based on the two locations p0 and p1
Morph targets is another technique that adds in weighted
poses to a neutral model
1
) 1 ( p p m s s + − =
SLIDE 12
Finally, we deal with the issue of projecting the points into
view space
Since we only have a 2D screen, we need to map everything to
x and y coordinates
Like other transforms, we can accomplish projection with a 4 x
4 matrix
Unlike affine transforms, projection transforms can affect the
w components in homogeneous notation
SLIDE 13 An orthographic projection maintains
the property that parallel lines are still parallel after projection
The most basic orthographic projection
matrix simply removes all the z values
This projection is not ideal because z
values are lost
- Things behind the camera are in front
- z-buffer algorithms don't work
= 1 1 1 P
SLIDE 14 To maintain relative depths and allow for
clipping, we usually set up a canonical view volume based on (l,r,b,t,n,f)
These letters simply refer to the six
bounding planes of the cube
- Left
- Right
- Bottom
- Top
- Near
- Far
Here is the (OpenGL) matrix that translates
all points and scales them into the canonical view volume
− + − − − + − − − + − − = 1 2 2 2 n f n f n f b t b t b t l r l r l r P
SLIDE 15
OpenGL normalizes to a
canonical view volume from [-1,1] in x, [-1,1] in y, and [- 1,1] in z
Just to be silly, MonoGame
normalizes to a canonical view volume of [-1,1] in x, [- 1,1] in y, and [0,1] in z
Thus, its projection matrix is: − − − − + − − − + − − = 1 1 2 2 n f n n f b t b t b t l r l r l r P
SLIDE 16
A perspective projection does not preserve parallel lines Lines that are farther from the camera will appear smaller Thus, a view frustum must be normalized to a canonical view
volume
Because points actually move (in x and y) based on their z
distance, there is a distorting term in the w row of the projection matrix
SLIDE 17
Here is the MonoGame projection matrix It is different from the OpenGL again because it only uses [0,1]
for z
− − − − − − + − − + − = 1 2 2 n f fn n f f b t b t b t n l r l r l r n P
SLIDE 18
SLIDE 19
SLIDE 20
SLIDE 21
Light Materials Sensors
SLIDE 22 Read Chapter 5 for Monday Finish Project 1
- Due tonight by 11:59 p.m.!
Keep working on Assignment 2