BCSE3011 Computer Graphics: 3D Transformations

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 22

BCSE3011

COMPUTER GRAPHICS

3D Transformations
3D Transformations.

• Use homogeneous coordinates, just as in 2D case.


• Transformations are now 4x4 matrices.
• We will use a right-handed (world) coordinate system -
( z out of page ).

Note:
Convenient to think of display as
Being left-handed !!
x
( z into the screen )
z (out of page)
Simple extension to the 3D case:
Scale in 3D.

Simple extension to the 3D case:

s x 0 0 0
0 sy 0 0
S (s x , s y , s z )  
0 0 sz 0
 
0 0 0 1
Rotation in 3D
• Need to specify which axis the rotation is about.
• z-axis rotation is the same as the 2D case.

cos  sin  0 0
 sin  cos 0 0
R z ( )  
 0 0 1 0
 
 0 0 0 1
Rotation around an axis parallel to x-axis

H&B p271
Rows of upper-left 3x3 submatrix, when rotated by R lie on the x,y
and z axes

 r11  1  r21  0  r31  0


 r  0  r  1  r  0 
R  12     R  22     R  32    
 r13  0 r23  0  r33  1
           
 1  1  1  1  1  1
Scaling an object with this transformation will
also move its position relative to the origin - so
move it to the origin, scale it, then move it back...

You might also like