3D Geometric Transformations: M.A.K Jailani Assistant Professor Dept. of Computer Applications Sastra University
3D Geometric Transformations: M.A.K Jailani Assistant Professor Dept. of Computer Applications Sastra University
TRANSLATION
In 3D coordinates representation, a point is translated from position P=(x, y, z) to p=(x, y, z) with the matrix operation
Translation (cont..)
Equ(1)
(or)
P = T.P
Translation (cont..)
The parameter tx, ty and tz specifying distances for the coordinate directions x, y, z are assigned any real values. The matrix representation of the above equ (1) X = x + tx Y = y + ty z = z + tz An object is translated in three dimensional by transforming each of the defining points of the objects.
Rotation
Need to specify which axis the rotation is to be performed To specify the amount of an angular rotation. The Positive rotation directions about the coordinates axes are counterclockwise, when looking toward the origin from a positive coordinate position on each axis as follows
Fig ( a )
Rotation (cont)
Rotation about X axis:
Fig ( b )
Rotation (cont)
Rotation about Y axis:
Fig ( c )
Coordinate-Axes rotation
2 dimensional Z axis rotation equation are easily extended to 3D x = x cos y cos y = x sin + y cos z = z Here specifies the rotation angle
Eqs 1
In homogeneous coordinate form, the three dimensional z-axis equation are expressed as follows Which can write compactly as p = Rz( ) . p
Cyclic permutation of the Cartesian coordinate axes to produce the three sets of coordinates axis rotation equation
Fig (a)
The transformation equation for rotations about the other two coordinates can be obtained with a cyclic permutation of the coordinate parameter x, y, and z in the eqs (1) Thats, using the following replacement x y z x
we get the equations for an x-axis rotation y = y cos - z sin z = y sin + z cos x = x
Equ 6
Or
p=Rx().p
Equ 7
Rotation of an object around the x axis is demonstrated in the following fig (b)
Fig (b)
Cyclically permutation coordinates in equ (5) give us the transformation equation for y-axis rotation ( y ->z -> x -> y)
z = z cos - x sin x = z sin + x cos y = y The matrix representation for y-axis rotation is
Equ 8
Equ 9
Or
P = Ry() . P
An inverse rotation matrix is formed by replacing the rotation angle by -. We can calculate the inverse of any rotation matrix R by evaluating its transpose R 1 = R T
the object so that the rotation axis coincides with the parallel coordinate axis the specified rotation about that axis the object so that the rotation axis is moved back to its original position
3.Translate
P '= T
( ) T P
) T
An object is to be rotated about an axis that is not parallel to one of the coordinate axes the object so that the rotation axis passes through the coordinate origin.
2.Rotate 1.Translate
the object so that the axis of rotation coincide with one of the coordinate axes. axis. the specified rotation about that coordinate
3.Perform 4.Apply
inverse rotations to bring the rotation axis back to its original orientation. the inverse Translation to bring the rotation axis back to its original position.
5.Apply
Scaling
Scaling with respect to the coordinate origin
x' sx y ' 0 = z' 0 1 0 0 sy 0 0 0 0 sz 0 0 x 0 y 0 z 1 1
P' = S P
Scaling
Scaling with respect to a selected fixed position (xf, yf, zf) 1. Translate the fixed point to origin 2. Scale the object relative to the coordinate origin 3. Translate the fixed point back to its original position
sx 0 T ( x f , y f , z f ) S ( s x , s y , s z ) T ( x f , y f , z f ) = 0 0
0 sy 0 0
0 0 sz 0
(1 s x ) x f (1 s y ) y f (1 sz ) z f 1
Scaling
Reflections
1 0 RFz = 0 0 0 1 0 0 0 1 0 0 0 1 0 0
Shears
1 0 SH z = 0 0 0 a 0 1 b 0 0 1 0 0 0 1
Composite transformations
Carried out from right to left, where the rightmost matrix is the first transformation to be applied to an object and the leftmost matrix is the last transformation.