Chapter 4
Chapter 4
Outline Contents
2
1. 3D Coordinate System
2. Vector Fundamentals
3. 3D Homogeneous Coordinate
4. 3D Geometric Transformations
5. 3D Inverse Transformations
6. 3D Coordinate Transformations
7. Composite transformations
3 3D Viewing Pipeline
World space
Viewing Transformation
Camera space
3D-Clipping
Projection
Normalized view space
Scan conversion, Hiding
Image space,
Fig 1 Device coordinates
Image
5 3D Coordinate System
3D coordinate system consists of a reference point called
origin and three mutually perpendicular passing through
origin. y axis
z
x
is
At a distance of x units from YZ-plane y
At a distance of y units from XZ-plane
At a distance of z units from XY-plane
P
z
x
z axis x axis
7 Vector Fundamentals
In 3D there are 3 natural coordinate vectors I, J and K having
unit along X, Y and Z axis respectively.
y axis
z axis x axis
8 Vector Fundamentals
If P(x0,y0,z0) and Q(x1,y1,z1) are two points in space then
PQ = (x1 – xo)I+ (y1 – yo)J+ (z1 – zo)K
y axis
u u -v
v
u-v
Vector Fundamentals
11
u 2u
-3u
13 Vector Fundamentals
IxJ=K
JxK=I
I x K = -J
or K x I = J
K I
Right-Hand
Reference System
17 3D Homogeneous Coordinates
Similar to the 2-D situation we can use homogeneous
coordinates for 3-D transformations - 4 coordinate
y axis
column vector
y
All transformations can
then be represented
as matrices x P
y
P(x, y, z) =
z
1 z
x
z axis x axis
18 3D Homogeneous Coordinates
Transform a point:
px
M py d
pz
vx
M vy
vz
Translation
Scaling
Rotation
Reflection
Shearing
24 3D Geometric Transformations
Once we have an object described, transformations are used
to move that object, scale it and rotate it
3D Geometric Translation
25
(x, y, z)
(x’, y’, z’)
Translated Position
27 3D Geometric Translation
The translation of a point P(x,y,z) by (tx, ty, tz) can be
written in matrix form as:
1 0 0 tx x x
0 y
1 0 ty y
T v P ' P
0 0 1 tz z z
0 0 0 1 1 1
28 3D Geometric Scaling
Scaling is the process of expanding or compressing the
dimensions of an object determined by the scaling factor.
29 3D Geometric Scaling
To scale a point in three dimensions by sx, sy and sz simply
calculate the new points as follows:
x’ = sx*x y’ = sy*y z’ = sz*z
Scaled Position
30 3D Geometric Scaling
The scaling of a point P(x,y,z) by scaling factors Sx, Sy and
Sz about origin can be written in matrix form as:
P Ssx, sy, sz( P ) where
sx 0 0 0 x x
0 sy 0 y
0 y
Ssx, sy, sz P ' P
0 0 sz 0 z z
0 0 0 1 1 1
x sx 0 0 0 x sx x
y
0 sy 0 0 y sy y
such that '
z 0 0 sz 0 z sz z
1 0 0 0 1 1 1
31 3D Geometric Rotations
It changes the orientation of an object around a specified axis
(X, Y, or Z) using rotation matrices.
When we performed rotations in two dimensions we only had
the choice of rotating about the z axis
In the case of three dimensions we have more options
Rotate about x – pitch
Rotate about y – yaw
Rotate about z - roll
3D Geometric Rotations
32
Roll is known as the rising or dipping of the airplane's wing. The movement is done
about Longitudinal axis. The Ailerons controlling the roll are located on the trailing
edge of both wings.
Pitch refers to the movement of the airplane's nose either up or down. It movement is
done about Lateral axis. The elevator controls the pitch is also located on the rear of
the aircraft on the tail, along with the rudder.
Yaw allows the airplane to move towards the left or right while in flight. The
movement is done about a ventricle axis. The yaw is controlled by the rudder located
in the rear of the aircraft on the tail.
x
x
z
Inverse Transformations
41
1
Inverse Translation: Tv T v
1
Inverse Scaling: S sx,sy,sz S1/ sx,1/ sy,1/ sz
1
Inverse Rotations: R , p R , p
1
M plane M plane
Inverse Reflections:
3D Coordinate Transformations
42
Coordinate Translation: 1
T v Tv T v
1
Coordinate Scaling: S sx,sy,sz S sx,sy,sz S1/ sx,1/ sy,1/ sz
1
Coordinate Rotations: R , p R , p R , p
1
M plane M plane M plane
Coordinate Reflections:
47 Composite Transformation
1 0 0 a sx 0 0 0 1 0 0 a
0 1 0 b 0 sy 0 0 0 1 0 b
S sx, sy, sz ( a ,b ,c )
0 0 1 c 0 0 sz 0 0 0 1 c
0 0 0 1 0 0 0 1 0 0 0 1
sx 0 0 a.sx a
0 sy 0 b.sy b
0 0 sz c.sz c
0 0 0 1
52 Exercise 2
Where
1 0 0 0
0 cos sin 1 0
R1 , I 1
0 sin 1 cos 1 0
0 0 0 1
b
sin 1
b2 c2
c
cos 1
b2 c2
R(0,0,a2+b2+c2)
Step2: Rotate V’ about Y-axis by an angle of
Q’(0,0,b2+c2)
– 2 , so that V’ aligns with +ve Z axis. V”=
V’
R ,I(V) a P’(0,b,c)
1
Q(a,0,b2+c2) C P(a,b,c)
Let Q’ be projection of Q(a,0,b2+c2) on Z 2 V
axis, Q’↔(0,0, b2+c2 ). If 2 be the angle
that OQ’ makes with +ve Z-axis, then from
O B
OQQ’ a Y axis
sin 2 A
a2 b2 c2
b2 c2
cos 2 X axis
a2 b2 c2
58 Exercise 3
0 0 0 1 1
b2 c2 a
2 0 0 a
2 2 2 2 2
a b c a b c
0 1 0 0 0
2 2
.
b c
2 2
a b c
0 0
2
a b c 2 2 2
a b c 2 2
1
0 0 0 1
a b2 c2 a b2 c2
2 2 2
0
a b c
0
0
2
a b c 2 2
a b c 2 2 2
2 2 2
a b c 1
1
Exercise 3
60
ab ac
a V 0
V 0 0 1 0 0 0 V V
V c b
0 0 0 c b
0 b2 c2
a0 1 0
0 .
b c where
0
0 0 0 a b c V a 2 b2 c2
V V 0
0
0 0 1 0 0 0 1 V V V
0 0 0 1
Exercise 3
61
Corollary I: If both b = c =0
then 0, V a and 2 900
a
0 0 0
a
AV , K a0 1 0 0 .
0 0 0
a
0 0 0 1
R 2 , J
Exercise 3
62
A 1V , K ( R 2 , J . R1 , I ) 1
1 1
R 1 , I .R 2 ,J
T T
R 1 , I .R 2 ,J
T
( R 2 , J . R1 , I )
T
( AV , K )
T
A V ,K
Exercise 4
63
Find transformation AV,N that aligns vector V = 2I – J – K with
another N = I+J+K.
2 2 2 1 1
0 0 0
6 6 3 2 3 2 3
2 1 1 1 1
0 AK ,N 0 0
AV ,K 2 6 2 6 2 2
2 1 1 1
1 1 0
0
2 6 2 6 3 3 3
0 0 0 1 0 0 0 1
4 1 1
0
18 18 18
1 2 1 2 1
0
AV ,N 18 18 2 18 2
1 2 1 2 1
0
18 18 2 18 2
0 0 0 1
64 Exercise 5
Thus P5 = T-1-P0(P4)
= T-1-P0.A-1V,K(P3)
= T-1-P0.A-1V,K. R,K(P2)
2 1 1 1 1 1 2
0 1
2 2 2 2 2 2
1 2 2 2 2 2 2
2 2 2 4 2
1
2 2
R450 , L
1
4 4 4 A' B' C ' D' 4 4 2
2 2 2 2 2 2 2 2
2 4 2
2 4 4 4 0
0 0 0 1 4 4 2
1 1 1 1
68
Thank you!