3 d transformations
TRANSCRIPT
From 2D to 3D
• Translation is simple as in 2D
• Use of Homogeneous coordinate in 3D– In 3D transformation always use Matrices: 4x4
• All transformation in 3D is simple but only Rotation transformation is complex in 3D transformation.
3D Translation
Translate using (tx, ty, tz ):
x’=x+ tx, y’=y+ ty , z’=z+ tz
or
x
y
P
P+TT
z
z
y
x
t
t
t
z
y
x
z
y
x
TPP
TPP'
en ,
'
'
'
'
met ,
3D Translation 2
In 4D homogeneous coordinates:
x
y
P
P+TT
z
11000
100
010
001
1
'
'
'
or ,
z
y
x
t
t
t
z
y
x
z
y
x
MPP'
3D Rotation 1
z
P
x
yP’
1000
0100
00cossin
00sincos
)(
with,)(
Or
'
cossin'
sincos'
:as- around angleover Rotate
z
z
zz
yxy
yxx
z
R
PRP'
2D Rotation about the origin.
y
x
r
r
P’(x’,y’)
P(x,y)
y
sin.
cos.
ry
rx
x
cos.sin.sin.cos.)sin(.
sin.sin.cos.cos.)cos(.
rrry
rrrx
3D Rotation 3
z
x
yz
x
y z
x
y
zy
yx
xz
xz
zy
yx
Rotation around axes:Cyclic permutation coordinate axes
xzyx
3D Rotation
zy
yx
xz
1000
0100
00cossin
00sincos
)(
with,)(
Or
'
cossin'
sincos'
:as- around angleover Rotate
z
z
zz
yxy
yxx
z
R
PRP'
1000
0cossin0
0sincos0
0001
)(
with,)(
Or
'
cossin'
sincos'
:as- around angleover Rotate
x
x
xx
zyz
zyy
x
R
PRP'
11000
000
000
000
1
'
'
'
or ,
z
y
x
s
s
s
z
y
x
z
y
x
SPP'
3D scaling
Scale with factors sx, sy,sz :
x’= sx x, y’= sy y, z’= sz z
or