Download presentation
Published byLeonard Davidson Modified over 9 years ago
0
CSCE441: Computer Graphics 3D Transformations
Jinxiang Chai
1
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
We will still use column vectors to represent points. Homogeneous coordinates of a 3D point (x,y,z,1) Transformation will be performed using 4x4 matrix
2
Right-handed Coordinate System
Left hand coordinate system Not used in this class and Not in OpenGL
3
Homogenous coordinates
3D Transformation Very similar to 2D transformation Translation transformation Homogenous coordinates
4
Homogenous coordinates
3D Transformation Very similar to 2D transformation Scaling transformation Homogenous coordinates
5
3D Transformation 3D rotation is done around a rotation axis
Fundamental rotations – rotate about x, y, or z axes Counter-clockwise rotation is referred to as positive rotation (when you look down negative axis) y + x z
6
3D Transformation Rotation about z – similar to 2D rotation
Keep z constant! y + x z
7
3D Transformation Rotation about y: z -> y, y -> x, x->z z y
8
3D Transformation Rotation about x (z -> x, y -> z, x->y) x z
Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters, y x z
9
Inverse of 3D Transformations
Invert the transformation In general, X= AX’-->X’=A-1X T(-tx,-ty,-tz) T(tx,ty,tz)
10
3D Rotation about Arbitrary Axes
Rotate p about the by the angle Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters, 10
11
3-D Rotation General rotations in 3-D require rotating about an arbitrary axis of rotation Deriving the rotation matrix for such a rotation directly is a good exercise in linear algebra The general rotation matrix is a combination of coordinate-axis rotations and translations!
12
3D Rotation about Arbitrary Axes
Rotate p about the by the angle
13
3-D Rotation General rotations in 3-D require rotating about an arbitrary axis of rotation Deriving the rotation matrix for such a rotation directly is a good exercise in linear algebra Standard approach: express general rotation as composition of canonical rotations Rotations about x, y, z
14
Composing Canonical Rotations
Goal: rotate about arbitrary vector r by θ Idea: we know how to rotate about x,y,z Set up a transformation that superimposes rotation axis onto one coordinate axis Rotate about the coordinate axis Translate and rotate object back via inverse of the transformation matrix
15
Composing Canonical Rotations
Goal: rotate about arbitrary vector r by θ Idea: we know how to rotate about x,y,z So, rotate about z by - until r lies in the xz plane Then rotate about y by -β until r coincides with +z Then rotate about z by θ Then reverse the rotation about y (by β ) Then reverse the rotation about z (by ) 15
16
3D Rotation about Arbitrary Axes
Rotate p about the by the angle Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
17
3D Rotation about Arbitrary Axes
Translate so that rotation axis passes through the origin Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
18
3D Rotation about Arbitrary Axes
Rotation by about z-axis to place the rotation vector on xoz plane Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
19
3D Rotation about Arbitrary Axes
Rotation by about y-axis to align the rotation vector with z axis Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
20
3D Rotation about Arbitrary Axes
Rotation by about z-axis (rotation vector) Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
21
3D Rotation about Arbitrary Axes
Rotation by about y-axis Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
22
3D Rotation about Arbitrary Axes
Rotation by about z-axis Transformation equations for rotations about the other two coordinate axes can be obtained with a cyclic permutation of the coordinate parameters,
23
3D Rotation about Arbitrary Axes
Translate the object back to original point
24
3D Rotation about Arbitrary Axes
Final transformation matrix for rotating about an arbitrary axis
25
3D Rotation about Arbitrary Axes
Final transformation matrix for rotating about an arbitrary axis 25
26
3D Rotation about Arbitrary Axes
Final transformation matrix for rotating about an arbitrary axis
27
3D Rotation about Arbitrary Axes
Final transformation matrix for rotating about an arbitrary axis A 3 by 3 Rotation matrix—orthogonal matrix
28
Rotation Matrices Orthonormal matrix:
orthogonal (columns/rows linearly independent) normalized (columns/rows length of 1)
29
Rotation Matrices Orthonormal matrix:
orthogonal (columns/rows linearly independent) normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose:
30
Rotation Matrices Orthonormal matrix:
orthogonal (columns/rows linearly independent) normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose:
31
Rotation Matrices Orthonormal matrix:
orthogonal (columns/rows linearly independent) normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose:
32
Rotation Matrices Why? is a 3-by-3 identity matrix
33
Rotation Matrices Why? is a 3-by-3 identity matrix
34
Rotation Matrices Why? is a 3-by-3 identity matrix
35
Rotation Matrices Why? is a 3-by-3 identity matrix
36
Rotation Matrices Orthonormal matrix:
orthogonal (columns/rows linearly independent) normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose: e.g.,
37
Next Lecture 2D coordinate transformations
Lots of vector and matrix operations! 37
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.