Beruflich Dokumente
Kultur Dokumente
3D
TRANSFORMATIONS
What is a Transformation
• Translation
• Rotation
• Reflection
• Scaling
• Shearing
Translation
Translation means moving an object to new
postion.
It is also called off-setting
Translation
• If a point p(x,y,z) in 3D is moved to p’(x’,y’,z’) by
translated vector=<tx,ty,tz>,tx,ty,tz are
displacments of P along three principal directions
x,y,z resp.
Algebraically,
x’=x+tx
y’=y+ty
z’=z+tz
Matrices
Representation y
x 1 0 0 tx x P
y 0
1 0 t y y x
P
z 0 0 1 tz z z
y
1 0 0 0 1 1
x
P T P z
Scaling
Scaling means either reduces or enlarges an
object.
z
y
P S P
x
z
Scaling with respect to a
Fixed Point
The process of scaling w.r.t fixed point involves
following steps:
1. Translate fixed point to origin.
2. Perform scaling.
3. Translate fixed point back to its original
postion.
Scaling with respect
to a Fixed Point
P T( x f , y f , z f ) S T( x f , y f , z f ) P
y y x
y y
x
x x
z z z
z
0 0 1 z f 0 0 s z s z z f
0 0 0 1 0 0 0 1
sx 0 0 x f (1 s x )
0 sy 0 y f (1 s y )
T( x f , y f , z f ) S T( x f , y f , z f )
0 0 sz z f (1 s z )
0 0 0 1
ROTATION
x x x
z z z
z=׳zcosө- xsinө
x=׳ysinө +xcosө
y=׳y
Rotation around the
coordinate axes
• ROTATION ABOUT Z-AXIS
rotation of any point P(x,y,z) about z-axis by
an amount Ө is represented by
x=׳xcosө-ysinө
y=׳xsinө+ycosө
z=׳z
Matrices
Representation
• Around x 1 0 0 0 P R x ( ) P
0 cos sin 0
R x ( )
0 sin cos 0
0 0 0 1
cos 0 sin 0
0 1 0 0
• Around y R y ( ) P R y ( ) P
sin 0 cos 0
0 0 0 1
cos sin 0 0
sin cos 0 0
• Around z R z ( ) P R z ( ) P
0 0 1 0
0 0 0 1
ROTATION AROUND A
PARALLEL AXIS
• Rotating the object around a line parallel to one of
the axes: Translate to axis, rotate, translate back.
P T(0, y p , z p ) R x ( ) T(0, y p , z p ) P
y y y y
x
x
x x
z z z
z
V
u (a, b, c)
V
Where the components a,b,c of unit
vecter u are the direction cosines for
rotation axis
a=x2-x1
|V|
b=y2-y1
|V|
c=z2-z1
|V|
Reflection
• A reflection is transformation that produces a
mirror image of obect.