3D Geometric Transformation: - Point in 3D Space

You might also like

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

3D Geometric Transformation

Point in 3D space
Position (x, y, z) Color (r, g, b) Normal (Nx, Ny, Nz)

N
(x,y,z)

Homogenous Coordinates
Position (x,y,z,w) Usually (x,y,z,1)

Transformations
Translation Scaling Rotation Projection

3D Translation
T(dx,dy,dz)= 1 0 0 0 0 1 0 0 0 0 1 0 dx dy dz 1

(x,y,z)

To translate the point (x,y,z) by the offset (dx, dy, dx) T(dx,dy,dz) . (x,y,z,1)T

(x,y,z)

=(x+dx, y+dy, z+dz,1)

3D Scaling
(x,y,z)

S(sx,sy,sz)=

sx 0 0 sy 0 0 0 0

0 0 sz 0

0 0 0 1

(x,y,z)

To scale the vector (x,y,z) by the factors sx,sy,and sz S(sx,sy,sz) . (x,y,z,1)T

=(x*sx, y*sy, z*sz,1)

3D Sheering
Sheer along one or more axes Sz(hx,hy)= 1 0 0 0 0 1 0 0 hx hy 1 0 0 0 0 1

(x,y,z)

(x,y,z)

To sheer the point (x,y,z) along the x and y axes H(hx,hy) . (x,y,z,1)T =

(x+hx*z, y+hy*z, z, 1)

3D Rotation
To rotate a point (x,y,z) around the x axis by angle j Rx(j) = 1 0 0 cos(j) 0 sin(j) 0 0 0 -sin(j) cos(j) 0 0 0 0 1

(x,y,z)

x
(x,y,z)

A 90o Rotation

of (0,1,0,1) will produce (0,0,1,1)

3D Rotation
To rotate a point (x,y,z) around the y axis by angle j Ry(j) = cos(j) 0 -sin(j) 0 0 1 0 0 sin(j) 0 cos(j) 0 0 0 0 1

(x,y,z)

(x,y,z)

A 90o Rotation of (1,0,0,1) will produce (0,0,1,1)

3D Rotation
To rotate a point (x,y,z) around the z axis by angle j Rz(j) = cos(j) -sin(j) sin(j) cos(j) 0 0 0 0 0 0 1 0 0 0 0 1

(x,y,z)

x A 90o Rotation of (1,0,0,1) will produce (0,1,01)


(x,y,z)

Composition of 3D Transformations
General 3D transformation looks as the following

T=

t00 t10 t20 t30

t01 t11 t21 t31

t02 t12 t22 t32

t03 t13 t23 t33

We should split the transformation into its generic composing transformations. Then carry these transformation one by one.

Composition of 3D Transformations

You might also like