5

3d transformation

Embed Size (px)

Citation preview

Page 1: 3d transformation
Page 2: 3d transformation

3D Transformations

• Same idea as 2D transformations

– Homogeneous coordinates: (x,y,z,w)

– 4x4 transformation matrices

wz

yx

ponm

lkji

hgfedcba

wz

yx

''

''

Page 3: 3d transformation

Basic 3D Transformations

wz

yx

wz

yx

1000010000100001

'

''

w

z

y

x

t

t

t

w

z

y

x

z

y

x

1000

100

010

001

'

'

'

w

z

y

x

s

s

s

w

z

y

x

z

y

x

1000

000

000

000

'

'

'

wz

yx

wz

yx

1000010000100001

'

''

Identity Scale

Translation Mirror about Y/Z plane

Page 4: 3d transformation

Basic 3D Transformations

w

z

y

x

w

z

y

x

1000

0100

00cossin

00sincos

'

'

'

Rotate around Z axis:

w

z

y

x

w

z

y

x

1000

0cos0sin

0010

0sin0cos

'

'

'

Rotate around Y axis:

wz

yx

wz

yx

10000cossin00sincos00001

'

''

Rotate around X axis:

Page 5: 3d transformation

Reverse Rotations

• Q: How do you undo a rotation of R( )?

• A: Apply the inverse of the rotation… R-1( ) = R(- )

• How to construct R-1( ) = R(- )– Inside the rotation matrix: cos( ) = cos(- )

• The cosine elements of the inverse rotation matrix are unchanged

– The sign of the sine elements will flip

• Therefore… R-1( ) = R(- ) = RT( )