Professional Documents
Culture Documents
Objectives
• Introduce the classical views
• Compare and contrast image formation by computer with
how images have been formed by architects, artists, and
CLASSICAL VIEWING engineers
• Learn the benefits and drawbacks of each type of view
Slides modified from Angel book 6e
Introduction
A painting [the projection plane] is the intersection of a visual pyramid
Classical Viewing
[view volume] at a given distance, with a fixed center [center of
projection] and a defined position of light, represented by art with lines • Viewing requires three basic elements
and colors on a given surface [the rendering]. (Alberti, 1435) • One or more objects
• A viewer with a projection surface
• Projectors that go from the object(s) to the projection surface
• Classical views are based on the relationship among these
elements
• The viewer picks up the object and orients it how she would
like to see it
• Each object is assumed to constructed from flat principal
faces
• Buildings, polyhedra, manufactured objects
center of
projection rays/
projection
projectors
COSC4328/5327 Computer Graphics 7 8 COSC4328/5327 Computer Graphics
vanishing point
• consider the view plane position w.r.t. X,Y,Z axes • two if only two axes are intersected
• one if only one axis is intersected
Objectives
• Introduce the mathematics of projection
• Introduce viewing in OpenGL
• Look at alternate viewing APIs
COMPUTER VIEWING
• Need a camera coordinate system (eye/camera space) • camera position & parameters
• projection matrix • problem:
• Selecting a lens • how to arrange objects in space,
• Need a complete camera model where we want them to be?
• Clipping
• Setting the view volume
Model-View Transformation Model-View Transformation
• 1st idea: transform all objects and camera into one world • 2nd idea: transform objects directly into camera (also called
coordinate system y eye) coordinates
y y
(½√2, ½√2)
(5+½√2, 1+½√2)
y (½√2, ½√2)
(7+½√2, ½√2)
x
x x
(-2, 1) z object (0, 0)
x coordinate z camera (eye) z object
world system coordinate coordinate
z coordinate system system
system
• combine model and view transformation in a single model-
view transformation
• Projection is:
• Given a point (x, y, z) to be projected
• Find projected point (xp, yp, d)
y (x, y, z)
image x z x
plane Similar triangles xp Same for y
xp d z/d
(xp, yp, d)
x y
COP
(x p , y p , z p ) , ,d
z/d z/d
(0, 0, 0)
z
focal distance d
front plane
aspect = w/h
} init();
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
glutReshapeFunc( reshape );
glutMainLoop();
return 0;
}
Objectives
PROJECTION MATRICES
clipping projection
3D 2D
against default cube
Orthogonal Normalization
Notes
• We stay in four-dimensional homogeneous coordinates Ortho(left,right,bottom,top,near,far)
through both the modelview and projection
transformations
normalization find transformation to convert
• Both these transformations are nonsingular
specified clipping volume to default
• Default to identity matrices (orthogonal view)
• Normalization lets us clip against simple cube regardless
of type of projection
• Delay final projection until end
• Important for hidden-surface removal to retain depth information
as long as possible
73 COSC4328/5327 Computer Graphics 74 COSC4328/5327 Computer Graphics
1 0 cot θ 0
1 cot φ 0
H(q,f) = 0
0 0 1 0
Projection matrix 0 0 0 1
General case:
P = Morth H(q,f)
P = Morth STH(q,f)
79 COSC4328/5327 Computer Graphics 80 COSC4328/5327 Computer Graphics
DOP
DOP
x = -1
x=1
far plane
z = -1
clipping near plane
volume distorted object
(projects correctly)
P = NSH