CSCE 441 Lecture 12

From Notes
Jump to navigation Jump to search

« previous | Monday, February 10, 2014 | next »


3D Transformations

The following transformations are the same:

  • Transformations
  • Uniform Scaling
  • Non-Uniform Scaling


Rotation

Rotation in 3D is slightly different.

Given a unit vector , a point , which is the 'origin' of , and a point to rotate,

  1. Compute
  2. Decompose into its components parallel () and perpendicular () to using vector projections:
  3. Compute cross product to define the basis for a plane perpendicular to with as an axis.
  4. Use and as a new 2D coordinate system.
  5. Find a new rotated form of with
  6. Add and to this rotated vector to get the rotated point:

Mirror Image

A new transformation for 3D space.

Given unit vector , a point , which is the 'origin' of reflection, and a point , we will mirror about the plane defined by the normal vector and point .

  1. Compute
  2. Decompose into its components parallel () and perpendicular () to :
  3. Subtract from to get the vector from to its reflection:
Note: This is identical to non-uniform scaling with a scale factor of

Orthogonal Projection

Useful for projecting 3D objects onto the screen for rendering.

Given a point , which is the 'origin' (like in mirror image), the orthogonal projection of a point is given by:

  1. Compute
  2. Decompose into its components parallel () and perpendicular () to as above
  3. Subtract from (instead of like in above)

Thus

Note: This is identical to non-uniform scaling with a scale factor of

Perspective Projection

Using a new point , which is the eye of the observer, is the intersection of and the plane defined by and .

  1. The equation of the plane is
  2. The equation of the line from to is
  3. Substitute the line equation for in the plane equation and solve for :
  4. evaluate to find the intersection point

Precondition: cannot be parallel to the plane? (since denominator wold be zero)

Perspective projection of vectors is not defined because we would get different projections depending on the location of the vector to project.

Warning: Perspective transformation is not affine

3D Transformations as Matrices

Exactly like 2D, but the matrices are now 4 × 4

Similar block-structure , but is a 3 × 3 matrix.

Dot Product

Still .

Cross Product

Component Decomposition

Translation

Uniform Scaling

What's multiplied by ?

What's added to ?

and

Non-Uniform Scaling

What's multiplied by ?

What's added to ?

and


Next time

Continue with rotation about an arbitrary axis.