3 D Transformation Translation Rotation Scaling What we

  • Slides: 17
Download presentation
3 D Transformation • Translation • Rotation • Scaling

3 D Transformation • Translation • Rotation • Scaling

What we mean by a 3 -D coordinate space y axis y P z

What we mean by a 3 -D coordinate space y axis y P z x z axis x axis Right-Hand Reference System

Translation of a point p(X, Y, Z) means shifting the point along a straight

Translation of a point p(X, Y, Z) means shifting the point along a straight line path to new position p’(X’, Y’, Z’). P (x, y, z) Object translated by factor T(tx, ty, tz) P’ (x’, y’, z’) Hence in equ, X’=X + tx Y’=Y + ty Z’=Z + tz In matrix form =

Scaling Changing the size of an object in 3 D by scaling factors, Sx

Scaling Changing the size of an object in 3 D by scaling factors, Sx , Sy , Sz, for the x , y and z coordinates respectively. Object scaled by factor S(Sx, Sy, Sz) P(x, y, z) P (x’, y’, z’) Scaled Position Hence in equ, X’=X * Sx Y’=Y * Sy Z’=Z * Sz In matrix form =

Rotation Repositioning the object along the circular path. Depending on axis of rotation :

Rotation Repositioning the object along the circular path. Depending on axis of rotation : -Axis as any principal axis Axis other than principal axis • Z-Axis • Parallel to any of the Principal Axis • X-Axis • Y-Axis • Not parallel to any of the Principal Axis

Axis as any principal axis As Z-axis Plane of rotation is XY-Plane In equ

Axis as any principal axis As Z-axis Plane of rotation is XY-Plane In equ form x’ = x·cosθ - y·sinθ y’ = x·sinθ + y·cosθ z’ = z In matrix form Rz( )

Axis As X-axis Plane of rotation is YZ-Plane In equ form x’ = x

Axis As X-axis Plane of rotation is YZ-Plane In equ form x’ = x y’ = y·cosθ - z·sinθ z’ = y·sinθ + z·cosθ In matrix form Rx( )

Axis As Y-axis Plane of rotation is XZ-Plane In equ form x’ = z·sinθ

Axis As Y-axis Plane of rotation is XZ-Plane In equ form x’ = z·sinθ + x·cosθ y’ = y z’ = z·cosθ - x·sinθ In matrix form Ry( )

Axis other than principal axis • Parallel to any of the Principal Axis STEP

Axis other than principal axis • Parallel to any of the Principal Axis STEP 1 Let axis parallel to X-axis Translate so that axis coincide with the X Axis

STEP 2 Rotate w. r. t x-axis STEP 3 Retranslate to it’s original position

STEP 2 Rotate w. r. t x-axis STEP 3 Retranslate to it’s original position So sequence of transformations are = *

 • Not Parallel to any of the Principal Axis Let the axis vector

• Not Parallel to any of the Principal Axis Let the axis vector v=ai+bj+ck The length of the line = √(a 2 +b 2+c 2)

STEP 1 Translate to origin by (-x 1, -y 1, -z 1) =

STEP 1 Translate to origin by (-x 1, -y 1, -z 1) =

STEP 2 Rotate w. r. t x-axis Rx( 1) = c (a, b, c)

STEP 2 Rotate w. r. t x-axis Rx( 1) = c (a, b, c) a b Y axis r In right triangle pqr cos(Ѳ 1)= c/√(b 2 + c 2 ) sin(Ѳ 1)= b/ √(b 2 + c 2 ) p q (0, b, c)

STEP 3 Rotate w. r. t y-axis Ry(- 2) = In right triangle pqr

STEP 3 Rotate w. r. t y-axis Ry(- 2) = In right triangle pqr cos(Ѳ 2)= √(b 2 + c 2 ) / √(a 2+b 2 + c 2 ) sin(Ѳ 2)= a/ √(a 2+b 2 + c 2 )

STEP 4 Rotate w. r. t z-axis y axis Rz( ) =

STEP 4 Rotate w. r. t z-axis y axis Rz( ) =

STEP 5 Re-Rotate w. r. t y-axis by angle ( 2) Ry( 2) STEP

STEP 5 Re-Rotate w. r. t y-axis by angle ( 2) Ry( 2) STEP 6 Re-Rotate w. r. t x-axis by angle (- 1) Rx(- 1) STEP 7 Re-translate by factor Sequence of transformation is * Rx(- 1) * Ry( 2) * Rz( ) * Ry(- 2) * Rx( 1) * OBJECT

r q p

r q p