Professional Documents
Culture Documents
Graphics
Three-Dimensional
ee
e s o a Graphics
G ap cs
system
Right
g
Handed Space
p
Homogeneous representation of a
point in 3D space:
po
p
P | x y z w |
(w 1, for a 3D point)
Transformations will thus be
represented by 4x4 matrices:
P = A.P
a b
d e
A
g i
l m
a b
d e
g i
c
f
j
n
where,
li
shearing,
h
i
reflection
fl ti
f scaling,
and rotation.
j
K = [p q r]T, produces translation
s, is
=
i responsible
ibl for
f
uniform
if
scaling
li
1
0
0
0
0
1
0
0
0 t x Sx
0 ty 0
1 tz 0
0 1 0
Translation
1
0
Sh x
Sh y
Sh z
0
Sy
0
0
0
0
Sz
0
0
0
0
1
Scale
0
Shear
0
0
Origin is unaffected
3D Reflection:
3
e ect o
The following matrices:
1
0
TXY
0
0 0 0
1
1 0 0
0
TYZ
0
0 1 0
0 0 1
0
0 0 0
1
1 0 0
0
TZX
0
0 1 0
0 0 1
0
0 0 0
1 0 0
0 1 0
0 0 1
YZ
plane
respectively.
p
y
ZX
plane
0
0
1
0 cos( ) sin( )
0 sin( ) cos( )
0
0
0
0
0
0
1
cos(( )
0
sin( )
0
X-axis
cos sin
sin
i cos
0
0
0
0
0 sin(( ) 0
1
0
0
0 cos( ) 0
0
0
1
Y-axis
0
0
1
0
0
0
0
1
Z-axis
Around
Z-axis
Z
axis
X
Around
X-axis
X
axis
Y
Around
Y-axis
Y
axis
Z
Around
X-axis
Y
Around
Z-axis
X
Around
Y
Y-axis
i
Z
0
0
1
0 cos( ) sin( )
0 sin( ) cos( )
0
0
0
0 X
0 Y
0 Z
1
cos sin
sin cos
0
0
0
0
0 X
0 Y
0 Z
1
cos( )
0
sin( )
0
0
0
1
0
0 sin( ) 0 X
1
0
0 Y
0 cos( ) 0 Z
0
0
1
degrees, about
d
b t an axis
i in
i
space passing
i
through the point (x0, y0, z0) with direction
cosines
i
( x, cy, cz).
(c
)
1 First of all
1.
all, translate by:
|T| = - (x0, y0, z0)T
2 Next,
2.
Next we rotate the axis into one of the
principle axes, let's pick, Z (|Rx|, |Ry|).
First step
p of Rotation:
cy
d
cz
0
y
x
cx
R t ti
Rotation
about
b t x by
b :
How do we determine ?
Project
j
the unit vector,, along
g OP,, into
the yz plane.
The y and z components, cy and cz, are
the direction cosines of the unit vector
along
l
th arbitrary
the
bit
axis.
i
o the diagram,
g
, that :
It can be seen from
d sqrt C C
Cz
cos
d
Cy
sin
d
2
y
2
z
sin
i [
1
cy
c c
2
y
2
z
cy
d
cx
0
P(cx, 0,
0 d)
x
cx
0
d
cz
Rotation by
y about y
y:
How do we determine ?
Steps are similar to that done for :
Determine the angle
g to rotate the
result into the Z axis:
The x component
p
is cx and the z
component is d.
cos()= d = d/(length of the unit vector)
sin()= cx = cx/(length of the unit vector).
Final Transformation for 3D rotation, about an
arbitrary
bit
axis:
i
M = ||T|| |R
| x| |R
| y| |R
| z| |R
| y|-1 ||Rx|-1 ||T||-1
1
0
T
0
d
0
Ry
Cx
1
0
0
1
x0
y0
;
z0
0 C x 0
1 0 0
;
0 d 0
0 0 1
0
1
Cz
0
Rx C d
y
0
d
0
0
0
Cy
Cz
d
0
cos sin
sin cos
Rz
0
0
0
0
0
;
0
1
0 0
0 0
;
1 0
0 1
C [Rz] C-1
degrees, about
d
b t an axis
i in
i
space passing
i
through the point (x0, y0, z0) with direction
cosines
i
( x, cy, cz).
(c
)
1 First of all
1.
all, translate by:
|T| = - (x0, y0, z0)T
2 Next,
2.
Next we rotate the axis into one of the
principle axes, let's pick, Z (|Rx|, |Ry|).
cy
d
cx
0
P(cx, 0,
0 d)
x
cx
0
d
cz
1
0
T
0
d
0
Ry
Cx
1
0
0
1
x0
y0
;
z0
0 C x 0
1 0 0
;
0 d 0
0 0 1
0
1
Cz
0
Rx C d
y
0
d
0
0
0
Cy
Cz
d
0
cos sin
sin cos
Rz
0
0
0
0
0
;
0
1
0 0
0 0
;
1 0
0 1
V x1 x 0
z z
1
c x x / |V |
c y y / |V |
c z z / | V |,
x
Reflection through
g an arbitrary
y plane
p
Method is similar to that of rotation
about an arbitrary axis.
Spaces
Object Space:
definition of objects. Also called
M d li
Modeling
space.
W ld S
World
Space:
g
where the scene and viewing
specification is made
Eyespace (Normalized Viewing Space):
where eye point (COP) is at the origin
looking down the Z axis.
3D Image Space:
A 3D Projective
j
space.
p
Dimensions: [-1:1] in X & Y, [0:1] in Z.
This is where image space hidden
surface algorithms work.
work
Screen Space (2D):
Range of Coordinates [0 : width],
width] [0 : height]
Projections
We will look at several planar geometric
3D to 2D projection:
- Parallel Projections
Orthographic
Oblique
- Perspective
Perspective
Oblique
Orthographic
Cabinet
Top
(plan)
Front
elevation
l
ti
Side
elevation
l
ti
Axonometric
Isometric
Other
One-point
Twopoint
Other
Cavalier
Threepoint
Perspective Projections
Distance from COP to projection
plane is finite. The projectors are not
parallel & we specify a center of
projection (COP).
(COP)
Center of Projection is also called
the Perspective Reference Point
COP = PRP
Perspective foreshortening:
The
size
of
the
perspective
projection of the object varies inversely
j
from the
with the distance of the object
center of projection.
Vanishing Point:
The perspective projections of any
set of parallel lines that are not parallel
to the projection plane converge to a
vanishing point.
Z-axis vanishing
g point
p
Z-axis
vanishing point
x
z
x
z
Projection
plane
Center of
projection
Projection
Plane normal
Projection plane
x-axis
varnishing point
z-axis
varnishing point
C t off P
Center
Projection
j ti
X or Y
P(X,Y,Z)
PP
xp or yp
O (COP)
f
Perspective
p
Geometry
y and Camera Models
X or Y
P(X,Y,Z)
IP
X or Y
P(X,Y,Z)
(
)
PP
xp or yp
(COP) O
P(X,Y,Z)
PP
xp or yp
O (COP)
X or Y
Z
P(X,Y,Z)
PP
xp or yp
O
(COP)
(
)
xp
X ;
f
Z
1
0
Mper
0
yp
Y ;
f
Z
0
0 1 0
0 1 f 0
0
1
0
0
P = Mper.P;
P
where P = [X Y Z 1]T
where,
Equations of
Perspective geometry
xp
X yp
Y
;
;
f Zf f Zf
Mper
1
0
0
0
0 1 f 1
0
1
0
0
0
1
Generalized formulation of
perspective projection:
X or Y
PP
(COP)
L
Q
(0, 0, Zp)
Qd z
t
Z (Z p Qd z )
Now subsitute to
obtain xp and yp.
obtain,
dx
dx
X Z Zp
dz
dz
xp
Zp Z
1
Qdz
dy
dy
Y Z
Zp
dz
dz
yp
Zp Z
1
Qd z
Q
M gen
0
1
0
0
dx
dz
dy
dz
Zp
Qd z
1
Qd z
dx
zp
dz
dy
zp
dz
2
Zp
Zp
Qd z
Zp
1
Qd z
Matrix
M
t i
Type
Zp
Morth
Infinity
[0, 0, -1]
Mper
[0 0,
[0,
0 -1]
1]
Mper
[0, 0, -1]
P
Parallel
ll l Projection
P j ti
Distance from COP to projection
plane is infinite.
p
Therefore, the projectors are parallel lines
& we need to specify a:
direction of projection (DOP)
Orthographic:
th direction
the
di
ti
off projection
j ti
and
d the
th
normal to the projection plane are the same.
(direction of projection is normal to the
projection plane).
Perspective
Oblique
Orthographic
Cabinet
Top
(plan)
Front
elevation
l
ti
Side
elevation
l
ti
Axonometric
Isometric
Other
One-point
Twopoint
Other
Cavalier
Threepoint
Projection
j
Plane
((top view))
Projectors for
top
t view
i
Projection
Plane
(front view)
Projectors
P
j t
for
f
front view
Projectors
for
side view
Projection
Plane
((side view))
Example
E
l off Orthographic
O th
hi Projection
P j ti
ProjectionP
j ti
plane normal
Oblique projections :
projection plane normal and the
direction of projection differ.
Plane of projection is normal to a
Principle axis
Projectors are not normal to the
projection
p
j
p
plane
Projection
y
plane
Projector
Projection-plane normal
( , 0,, 1))
P(0,
General oblique
q projection
p j
of a point/line:
p
Projection Plane: x-y plane; P is the
projection
j
i
off P(0,
(0 0
0, 1)
) onto x-y plane.
l
l is the projection of the z-axis unit
`l
vector onto x-y plane and is the angle
th projection
the
j ti
makes
k
with
ith the
th x-axis.
i
When DOP varies,
varies both `l
l
vary.
and
will
y
P
( , 0,, 1))
P(0,
View Specifications:
VP, VRP, VUP, VPN, PRP, DOP, CW, VRC
v
VUP
(umax, vmax)
VP
CW
VRP
u
(umin, vmin)
VPN
VP
CW
VRP
u
VPN
n
COP/PRP
/
BCP
VP
DOP
VRP
FCP
VPN
Finite pyramid
view volume for
perspective projection
VP
CW
DOP
PRP
VRP
VPN
n
Finite parallelopiped
view volume for
parallel projection
BCP
VP
DOP
VRP
FCP
VPN