CG Lesson07 (En)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Lesson 7

Projection
Transformation

Trinh Thanh Trung School of ICT, HUST


Content
1. 3D viewing and projection
2. Parallel projection
3. Perspective projection
1.
3D viewing and projection
3D viewing

■ Part of the difficulty lies in trying to display three


dimensional objects on a 2D display
■ Different views on the same object eventually
lead to different 2D representations at the
projection stage
□ The projected 2D image of a 3D object is viewer
dependent
■ Different views can be specified based on several
parameters e.g. position, orientation, field of view
3D viewing methods

■ On 2D displays:
□ perspective and depth of field
□ depth cueing
□ visible line/surface identification
□ surface rendering
□ exploded/cutaway scenes, cross-sections
3D viewing
6
3D viewing can be faked?
3D viewing methods (cont.)

■ On 3D display
□ Hologram display
Stereoscopic display

■ Faking depth in a 2D image


■ Based on natural stereoscopic eye-brain system.
■ Objects are not viewed with just one eye, but
two eyes.
■ Each eye looks at the object from a slightly
different location.
Stereoscopic display
Projections transform
points in n-space to
m-space, where m<n.
Projections

■ In 3-D, we map points from 3-space to the


projection plane (PP) (a.k.a., image plane) along
projectors (a.k.a., viewing rays) emanating from
the center of projection (COP):

■ There are two basic types of projections:


□ Perspective – distance from COP to PP finite
□ Parallel – distance from COP to PP infinite
2.
Parallel projection
Parallel projection

■ Parallel projection is the projection which the


projection lines are parallel or start from infinity
■ Points on the object are projected to the viewing
plane along parallel lines
■ Preserves relative dimensions of the object but
does not give a realistic presentation
A
A’ B
B’
D
D’
C
C’
projection
centre of plane
projection at
infinity
Parallel projection properties

■ Are actually a kind of affine transformation


□ Parallel lines remain parallel
□ Ratios are preserved
□ Angles not (in general) preserved
■ Not realistic looking
■ Good for exact measurements
Most often used in
▫ CAD,
▫ architectural drawings,
▫ etc.,
where taking exact measurement is important
Homogeneous transform

■ For projections, we specify a direction of


projection (DOP) instead of a COP.
■ We can write orthographic projection onto the
z=0 plane with a simple matrix, such that x’=x, y’=y.

 x
 x ' 1 0 0 0  
 y '  = 0 y
 1 0 0  
 z
 

1   
0 0 0 1
 1 
 
Orthographic projection

■ Orthographic projection is a form of parallel


projection which all the projection lines are
orthogonal to the projection plane
Orthographic projection

■ For each projection plane we have a


corresponding transformation matrix

1 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0
0 0 1 0 1 0 0
[Ty ] =  [Tx ] =  [Tz ] = 
0 0 1 0 0 0 1 0 0 0 0 0
     
0 0 0 1 0 0 0 1 0 0 0 1
Axonometric projection

■ Axonometric projection
is a type of orthographic
projection, where the lines
of sight are perpendicular
to the plane of projection,
and the object is rotated
around one or more of its
axes to reveal multiple
sides.
Axonometric projection
Isometric
■ Three axes of space appear equally foreshortened
(~120°)
■ Corresponding rotating angles are 35.26° and 45°

1 − 2 sin 2 
sin  =
2

1 − sin 2 
f = cos 2  = 2 / 3 = 0.8165
sin 2 
sin  =
2

1 − sin 2 
sin 2  1 /3
sin  =
2
= = 1 /2
1 − sin 
2
1 − 1 / 3
1
sin  = 
3
Axonometric projection
Dimetric
■ Two of the three axes of space appear equally
foreshortened
[T ] = [Ry ][ Rx ][ Pz]
cos 0 − sin  0  1 0 0 0  1 0 0 0
 0 1 0 0  0 cos sin  0  0 1 0 0 
= . .
 sin  0 cos 0  0 − sin  cos 0  0 0 0 0
     
 0 0 0 1  0 0 0 1  0 0 0 1

cos sin  sin  0 0


 0 cos 0 0
[T ] = 
 sin  − cos sin  0 0
 
 0 0 0 1
Axonometric projection
Trimetric
■ All of the three
axes of space
appear unequally
foreshortened
Oblique projections

■ Combine the properties of Orthographic and


Axonometric
■ Preserves the object face
■ Gives a better sense of the 3D nature.
3.
Perspective projection
Perspective projection

▪ Parallel lines in 3D will meet at a


vanishing point
▪ Lines that pass behind the eye of the
camera cause a catastrophic “passage
through infinity”.
▪ Perspective projections usually
produce geometrically realistic pictures.
Perspective projection properties

■ Here are some properties of projective


transformations:
□ Lines map to lines
□ Parallel lines do not necessarily remain parallel
□ Ratios are not preserved
■ One of the advantages of perspective projection
is that size varies inversely with distance – looks
realistic.
■ A disadvantage is that we can't judge distances
as exactly as we can with parallel projections.
Vanishing points

■ Each set of parallel lines (=direction) meets at a


different point: The vanishing point for this direction
■ Sets of parallel lines on the same plane lead to
collinear vanishing points: the horizon for that plane
■ Easy examples
□ corridor
□ higher = further away
■ Good way to spot faked images
Vanishing points
Clipping and the viewing frustum

■ The center of projection and the portion of the projection


plane that map to the final image form an infinite pyramid. The
sides of the pyramid are clipping planes.
■ Frequently, additional clipping planes are inserted to restrict
the range of depths. These clipping planes are called the near
and far or the hither and yon clipping planes.

■ All of the clipping planes bound the viewing frustum.


Field of View (FOV)

■ Assume a symmetric volume


Left Clip
Near Clip Plane
xv
Plane
Far Clip
View Plane
Volume
FOV
f -zv

Right Clip
Plane
Projection summary
Thanks!
Any questions?
Credits

Lecture notes provided by School of Information and


Communication Technology, Hanoi University of Science and
Technology.
Composed by Huynh Quyet Thang, Le Tan Hung, Trinh Thanh
Trung and others
Edited by Trinh Thanh Trung

Special thanks to all the people who made and released these
awesome resources for free:
■ Presentation template by SlidesCarnival
■ Photographs by Death to the Stock Photo (license)
■ Diverse device hand photos by Facebook Design
Resources

You might also like