1 / 13

Transformations in 3D

Transformations in 3D. Lecture 17 Mon, Oct 6, 2003. 3D Affine Transformations. In 3-dimensional scenes we have the same three kinds of transformation. Translations. Rotations. Scalings. Points have three coordinates (x, y, z), with a fourth coordinate w = 1 added: (x, y, z, 1).

gaura
Download Presentation

Transformations in 3D

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transformations in 3D Lecture 17 Mon, Oct 6, 2003

  2. 3D Affine Transformations • In 3-dimensional scenes we have the same three kinds of transformation. • Translations. • Rotations. • Scalings. • Points have three coordinates (x, y, z), with a fourth coordinate w = 1 added: (x, y, z, 1)

  3. 3D Translations • The translation T(dx, dy, dz). =

  4. 3D Scalings • The scaling S(sx, sy, sz). =

  5. 3D Rotations • Rotations in space are a little more complicated. • A rotation in space is about an axis, not a point. • Any line may be the axis of rotation. • Generally we rotate about the x, y, and z axes.

  6. 3D Rotations about the z-axis • The rotation Rz(). =

  7. Example: Rotation about the z-axis • Rotate 90 about the z-axis. • What is the image of (3, 4, 5)? Rz(90) = (3, 4, 5)  (-4, 3, 5)

  8. 3D Rotations about the x-axis • The rotation Rx(). =

  9. Example: Rotation about the x-axis • Rotate 90 about the x-axis. • What is the image of (3, 4, 5)? Rx(90) = (3, 4, 5)  (3, -5, 4)

  10. 3D Rotations about the y-axis • The rotation Ry(). =

  11. Example: Rotation about the y-axis • Rotate 90 about the z-axis. • What is the image of (3, 4, 5)? Ry(90) = (3, 4, 5)  (5, 4, -3)

  12. Direction of Rotation • For each axis (x, y, z), the positive direction of rotation is determined by the right-hand rule. • Point the thumb of your right hand in the positive direction of the axis. • Curl your fingers. • The direction of curl is the positive direction of rotation.

  13. 3D Transformations in OpenGL • OpenGL uses the functions • glTranslatef(dx, dy, dz) • glRotatef(angle, vx, vy, vz) • v = (vx, vy, vz) is a vector indicating the axis of rotation. • glScalef(sx, sy, sz)

More Related