3D Transformations 2D coordinates3D coordinates x y x y z x z y Right-handed coordinate system:
3D Transformations (cont.) 1.Translation in 3D is a simple extension from that in 2D: 2.Scaling is similarly extended:
3D Transformations (cont.) 3.The 2D rotation introduced previously is just a 3D rotation about the z axis. similarly we have: X Y Z
Composition of 3D Rotations In 3D transformations, the order of a sequence of rotations matters!
More Rotations We have shown how to rotate about one of the principle axes, i.e. the axes constituting the coordinate system. There are more we can do, for example, to perform a rotation about an arbitrary axis: X Y Z P 2 (x 2, y 2, z 2 ) P 1 (x 1, y 1, z 1 ) We want to rotate an object about an axis in space passing through (x 1, y 1, z 1 ) and (x 2, y 2, z 2 ).
Rotating About An Arbitrary Axis Y Z P2P2 P1P1 1). Translate the object by (-x 1, - y 1, -z 1 ): T(-x 1, -y 1, -z 1 ) X Y Z P2P2 P1P1 2). Rotate the axis about x so that it lies on the xz plane: R x ( ) X X Y Z P2P2 P1P1 3). Rotate the axis about y so that it lies on z: R y ( ) X Y Z P2P2 P1P1 4). Rotate object about z by : R z ( )
Rotating About An Arbitrary Axis (cont.) After all the efforts, don’t forget to undo the rotations and the translation! Therefore, the mixed matrix that will perform the required task of rotating an object about an arbitrary axis is given by: M = T(x 1,y 1,z 1 ) Rx(- )R y (- ) R z ( ) R y ( ) R x ( )T(-x 1,-y 1,-z 1 ) Finding is trivial, but what about ? The angle between the z axis and the projection of P 1 P 2 on yz plane is . X Y Z P2P2 P1P1