ROTATION
Unlike 2D, rotation in 3D is carried out around any line. The most simple rotations could be around coordinate axis. As in 2D positive rotations produce counter-clockwise rotations.
Rotation in term of general equation is expressed as
Where,
R = Rotation Matrix
Rotation matrix when an object is rotated about X axis can be expressed as:
Rotation matrix when an object is rotated about Y axis can be expressed as:
Rotation matrix when an object is rotated about Z axis can be expressed as:
| |
SCALING
Scaling an object in three-dimensional is similar to scaling an object in two-dimensional. Similar to 2D scaling an object tends to change its size and repositions the object relative to the coordinate origin. If the transformation parameter are unequal it leads to deformation of the object by changing its dimensions. The perform uniform scaling the scaling factors should be kept equal
i.e.
Where,
NOTE: A special case of scaling can be represented as reflection.
if the value of Sx, Sy or Sz be replaced by -1 it will return the reflection of the object against the standard plane whose normal would be either x axis, y axis or z axis respectively.
| |
REFLECTION
In 3D-reflection the reflection takes place about a plane whereas 2D reflection it used take place about an axis. The matrix in case of pure reflections, along basic planes, viz. X-Y plane, Y-Z plane and Z-X plane are given below:
Transformation matrix for a reflection through X-Y plane is:
Transformation matrix for a reflection through Y-Z plane is:
Transformation matrix for a reflection through Z-X plane is:
|
| |
GENERAL 3-D ROTATION
Rotation in three dimension is more complex than the rotation in two dimensions. Three dimensional rotations require the prescription of an angle of rotation and an axis of rotation. The canonical rotations are defined when one of the positive x,y,zcoordinate axis is chosen as the axis of rotation. then the construction of rotation transformation proceeds just like that of a rotation in two dimensions about the origin.
Steps to be performed
Translate origin to A1
Align vector with axis (say, z)
Rotate to bring vector in yz plane
Rotate to bring vector along z-axis
Rotate line P1P2 about z-axis which is already aligned with the Rotation axis.
Reverse steps 2
Reverse step 1
| |
GENERAL 3-D REFLECTION
Some orientations of a three dimensional object cannot be obtained using pure rotations; they require reflections. In three dimensions, reflection occur through a plane. By analogy with the previous discussion of of two dimensional reflection three dimensional reflection through a plane is equivalent to rotation about an axis in three dimensional space out in to four dimensional space and back into three dimensional space. For pure reflection the determinant of the reflection matrix is identically -1
Steps to be performed
Translate origin to A1
Align vector with axis (say, z)
Rotate to bring vector in yz plane
Rotate to bring vector along z-axis
Reflect the line P1P2 through the standard y-z plane.
Reverse steps 2
Reverse step 1
|
|
|
|