COMP 321 ODELNotes Viewing
COMP 321 ODELNotes Viewing
6. O T H E R GRAPHICS CONCEPTS
6.3.1: INTRODUCTION
Note that two dimensional viewing involves transferring positions from
the world co-ordinate plane to pixel positions on the 2D view surface
(plane) of the screen, and clipping the scene against boundaries of the
view port.
Operations in Viewing
A series of three computer operations convert an object’s three
dimensional co-ordinates to pixel positions on screen. They are
transformations (modeling, viewing and projection), clipping, and
viewport transformation.
6.3.2: TRANSFORMATIONS
Transformations include modeling, viewing and projection
transformations.
glLoadIdentity();
(b) Projections
Definition
Projection transformations are used to specify the field of view (e.g.
wide angle, normal, etc), what objects/portions of objects will be inside
the view volume (specification of portion to be seen), and how
objects are projected onto the screen.
Parallel projections
In a parallel projection, the distance between the center of projection
and the projection plane is infinite as shown in the diagram below
whereby a line AB is projected into a line A’B’ from an infinite center of
projection.
3
Line AB
Line A’B’
Center of
projection
at infinity
Projection
Projectors Plane
Orthographic projections
The direction of the projection is perpendicular to the projection plane.
Elevation projections are used to produce the front, side, and top
views of an object.
Plan view projections are used to produce the top view of an object.
Oblique projections
The direction of the projection is not perpendicular to the projection
plane.
Perspective projections
In a perspective projection, the distance between the center of
projection and the projection plane is finite as shown in the diagram
below whereby a line AB is projected into a line A’B’ from a finite
center of projection.
Line AB
Line A’B’
Center of
projection
Projection
Plane Projectors
View Volumes
A view volume is a specification about the parts of the object that will
appear in the window. Only the parts inside the view volume appear in
the display, all the others are clipped.
In this case, the volume consists of four sides. These fours sides are
planes that pass through the edges of the window. The size of the
5
volume therefore depends on the size of the window, while the shape
of the volume depends on the type of the projection.
Clipping
All portions outside the view volume are discarded (ignored).
Illustration
right
top
left
Center of
projection
bottom
near
far
6
height
width
Center of
projection
fovy
near
far
Aspect=(width/height)
top
far
left
right
bottom
near
far
Before a projection matrix is called, some preparations are usually
done. For example we need to specify that the current matrix is for a
projection transformation. This is done using the following function.
glMatrixMode(GL_PROJECTION);
Definition
The viewport transformation specifies the shape of the available
screen area into which the image is mapped. This transformation can
be thought of as defining the size and location of the final processed
image e.g. whether it should be enlarged or shrunk.