3D Transformations - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

3D Transformations

Description:

Rotation about a major axis. z. x. y. z. x. y. z. x. y. 11/26/09. Week 9-3D Transformations. 7 ... Rotate the axis of rotation so it lies on some major axis. ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 15
Provided by: chrisw6
Category:

less

Transcript and Presenter's Notes

Title: 3D Transformations


1
3D Transformations
2
3D homogeneous coordinates
  • In 2D, we added a dimension so translations could
    be computed by matrix multiplication, just like
    all the other transformations.
  • In 3D, well do the same trick, projecting up
    into a 4D space to do transformations, then
    projecting back down after.

3
Translation
(x,y,z)
T(tx,ty,tz)
(x,y,z)
4
Scaling
5
Rotation
  • How should we specify rotations?
  • In 2D, it was always counterclockwise in the
    xy-plane.
  • In 3D, we have more choices.
  • xz-plane, yz-plane, an arbitrary plane.
  • We could specify these in terms of the vector
    perpendicular to the plane of rotation.
  • z axis, y-axis, x-axis, arbitrary axis

6
Rotation about a major axis
y
y
z
x
z
y
x
z
x
7
Rotation about an arbitrary axis
  • How do we specify this?
  • R(rx, ry, rz, ?)
  • So we need a vector and an angle
  • The axis of rotation is from the origin and
    through the point r
  • The rotation is counterclockwise about the axis

y
z
x
8
What are the steps?
  • Rotate the axis of rotation so it lies on some
    major axis.
  • Apply specified rotation about major axis.
  • Apply inverse rotation to return axis or rotation
    to original orientation.

y
y
x
z
x
z
9
Math!
  • We need to figure out the rotations to align the
    axes.
  • First, compute a unit vector pointing in the same
    direction as the axis of rotation.
  • Now we can compute the rotation directly from the
    unit vector.

10
More math!
  • First, rotate u into the xz-plane rotation
    around the x-axis.
  • We can temporarily ignore the x component of u to
    do this

y
u lt0,b,cgt
ulta,b,cgt
?
uzlt0,0,1gt
z
x
ulta,0,dgt
11
Picture this
Second, rotate u onto the z-axis rotation
around the y-axis.
?
uzlt0,0,1gt
ulta,0,dgt
12
Putting it together
  • Dont forget the rotation about the z-axis!
  • P R(ux,?) R(uy,?) R(uz,?) R(uy,?)
    R(ux,?) P

13
Other rotations
  • What if the axis of rotation does not pass
    through the origin?
  • Similar process as in 2D, translate to the
    origin, rotate as normal, translate back.
  • We just need to know a point on the axis that we
    can translate to the origin.
  • Only way to specify such a rotation is to give
    two points on the line or one point and a
    direction, so the requirement is easily satisfied.

14
Another way to get the rotation matrix
  • We can compute it as a coordinate system
    transformation

y
uz
uy
ux
z
x
Write a Comment
User Comments (0)
About PowerShow.com