Download presentation
Presentation is loading. Please wait.
Published byClinton Richard Modified over 8 years ago
1
Week 5 - Monday
2
What did we talk about last time? Lines and planes Trigonometry Transforms Affine transforms Rotation Scaling Shearing Concatenation of transforms
7
The matrix used to transform points will not always work on surface normals Rotation is fine Uniform scaling can stretch the normal (which should be unit) Non-uniform scaling distorts the normal Transforming by the transpose of the adjoint always gives the correct answer In practice, the transpose of the inverse is usually used
8
Because of the singular value theorem, we can write any square, real-valued matrix M with positive determinant as: M = R 1 SR 2 where R 1 and R 2 are rotation matrices and S is a scaling matrix (M -1 ) T = ((R 1 SR 2 ) -1 ) T = (R 2 -1 S -1 R 1 -1 ) T = (R 1 -1 ) T (S -1 ) T (R 2 -1 ) T = R 1 S -1 R 2 Rotations are fine for the normals, but non-uniform scaling will distort them The transpose of the inverse distorts the scale in the opposite direction
9
1. With homogeneous notation, translations do not affect normals at all 2. If only using rotations, you can use the regular world transform for normals 3. If using rotations and uniform scaling, you can use the world transform for normals However, you'll need to normalize your normals so they are unit 4. If using rotations and non-uniform scaling, use the transpose of the inverse or the transpose of the adjoint They only differ by a factor of the determinant, and you'll have to normalize your normals anyway
10
For normals and other things, we need to be able to compute inverses Rigid body inverses were given before For a concatenation of simple transforms with known parameters, the inverse can be done by inverting the parameters and reversing the order: ▪ If M = T(t)R( ) then M -1 = R(- )T(-t) For orthogonal matrices, M -1 = M T If nothing is known, use the adjoint method
11
We can describe orientations from some default orientation using the Euler transform The default is usually looking down the –z axis with "up" as positive y The new orientation is: E(h, p, r) = R z (r)R x (p)R y (h) h is head, like shaking your head "no" ▪ Also called yaw p is pitch, like nodding your head back and forth r is roll… the third dimension
12
One trouble with Euler angles is that they can exhibit gimbal lock In gimbal lock, two axes become aligned, causing a degree of freedom to be lost Euler angles can describe orientations in multiple ways, however the wrong choice of rotations may cause gimbal lock
13
Sometimes you want to rotate around some arbitrary axis r To do so, create an orthonormal basis r, s, and t as follows Take the smallest component of r and set it to 0 Swap the two remaining components and negate the first one Divide the result by its norm, making it a normal vector s Let t = r x s This basis can be made into a matrix M The final transform X transforms the r-axis to the x-axis, does the rotation by α and then transforms back to r X = M T R x (α)M
14
Quaternions are a compact way to represent orientations Pros: Compact (only four values needed) Do not suffer from gimbal lock Are easy to interpolate between Cons: Are confusing Use three imaginary numbers Have their own set of operations
15
A quaternion has three imaginary parts and one real part We use vector notation for quaternions but put a hat on them Note that the three imaginary number dimensions do not behave the way you might expect
16
Multiplication Addition Conjugate Norm Identity
17
Inverse One (useful) conjugate rule: Note that scalar multiplication is just like scalar vector multiplication for any vector Quaternion quaternion multiplication is associative but not commutative For any unit vector u, note that the following is a unit quaternion:
18
Take a vector or point p and pretend its four coordinates make a quaternion If you have a unit quaternion the result of is p rotated around the u axis by 2 Note that, because it's a unit quaternion, There are ways to convert between rotation matrices and quaternions The details are in the book
19
Short for spherical linear interpolation Using unit quaternions that represent orientations, we can slerp between them to find a new orientation at time t = [0,1], tracing the path on a unit sphere between the orientations To find the angle between the quaternions, you can use the fact that cos = q x r x + q y r y + q z r z + q w r w
21
Vertex blending Morphing Projections
22
Keep reading Chapter 4 Exam 1 next Friday
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.