3D viewing concepts, 3D viewing pipeline, Transformation from world to viewing coordinates,
Projection transformation, orthogonal projections, perspective projections, OpenGL 3D viewing functions.
1. COMPUTER GRAPHICS & VISUALISATION (BCG402) MODULE 5
Dr.PUSHPARANI MK, AIET,MOODABIDRI Page 1
MODULE-5
Part-B
3D Viewing and Visible Surface Detection
3D Viewing
Q.What is 3D Viewing? With the help of a block diagram explain 3D viewing pipeline
architecture
• When we model a three-dimensional scene, each object in the scene is typically
defined with a set of surfaces that form a closed boundary around the object interior.
• In addition to procedures that generate views of the surface features of an object,
graphics packages sometimes provide routines for displaying internal components or
cross sectional views of a solid object.
• Many processes in three-dimensional viewing, such as the clipping routines, are similar
to those in the two-dimensional viewing pipeline.
• But three-dimensional viewing involves some tasks that are not present in two
dimensional Viewing
Viewing a Three-Dimensional Scene
• To obtain a display of a three-dimensional world-coordinate scene, we first set up a
coordinate reference for the viewing, or “camera,” parameters.
• This coordinate reference defines the position and orientation for a view plane (or
projection plane) that corresponds to a camera film plane
2. Dr.PUSHPARANI MK, AIET,MOODABIDRI Page 2
COMPUTER GRAPHICS & VISUALISATION (BCG402) MODULE 5
The Three-Dimensional Viewing Pipeline
Figure above shows the general processing steps for creating and transforming a three
dimensional scene to device coordinates.
Construct the shape of individual objects in a scene within modeling coordinate, and
place the objects into appropriate positions within the scene (world coordinate).
World coordinate positions are converted to viewing coordinates.
Convert the viewing coordinate description of the scene to coordinate positions on the
projection plane.
A two-dimensional clipping window, corresponding to a selected camera lens, is defined
on the projection plane, and a three-dimensional clipping region is established. This
clipping region is called the view volume.
Objects are mapped to normalized coordinates, and all parts of the scene outside the view
volume are clipped off.
The clipping operations can be applied after all device-independent coordinate
transformations. Then viewport is specified in device coordinates and that normalized
coordinates are transferred to viewport coordinates, following the clipping operations.
The final step is to map viewport coordinates to device coordinates within a selected
display window
3. Dr.PUSHPARANI MK, AIET,MOODABIDRI Page 3
COMPUTER GRAPHICS & VISUALISATION (BCG402) MODULE 5
Three-Dimensional Viewing-Coordinate Parameters
Select a world-coordinate position P0 =(x0, y0, z0) for the viewing origin, which is called
the view point or viewing position and we specify a view-up vector V, which defines
the yview direction.
Figure below illustrates the positioning of a three-dimensional viewing-coordinate frame
within a world system.
The View-Plane Normal Vector
5. Dr.PUSHPARANI MK, AIET,MOODABIDRI Page 5
COMPUTER GRAPHICS & VISUALISATION (BCG402) MODULE 5
Transformation from World to Viewing Coordinates
Q.Design the transformation matrix from world to viewing coordinate system with matrix
representation
In the three-dimensional viewing pipeline, the first step after a scene has been
constructed is to transfer object descriptions to the viewing-coordinate reference frame.
This conversion of object descriptions is equivalent to a sequence of transformations that
superimposes the viewing reference frame onto the world frame
Transformation sequences
1.Translate the view reference point to the origin of the WC system (Figure b)
1 0 0 x0
0 1 0
T y0
0 0 1 z0
0 0 0 1
2.Apply rotations to align the xv, yv, and zv axes with the world xw, yw,and zw axes,
respectively.
7. The coordinate transformation matrix is then obtained as the product of the preceding
translation and rotation matrices:
These matrix elements are evaluated as
8. Projection Transformations
Graphics packages generally support both parallel and perspective projections.
Parallel Projection
Parallel Projection transforms object positions to the view plane along parallel lines.
A parallel projection preserves relative proportions of objects, and this is the method used
in computer aided drafting and design to produce scale drawings of three-dimensional
objects.
All parallel lines in a scene are displayed as parallel when viewed with a parallel
projection.
Parallel Projection Classification: Orthographic Parallel Projection and Oblique Projection
o Orthographic parallel projections are done by projecting points along parallel lines that
are perpendicular to the projection plane.
o Oblique projections are obtained by projecting along parallel lines that are NOT
perpendicular to the projection plane.
10. Orthogonal Projections
Q. Explain Orthogonal Projection in details
A transformation of object descriptions to a view plane along lines that are all parallel to the
view-plane normal vector N is called an orthogonal projection also termed as orthographic
projection
Classification of Orthographic Projection
Different types of orthographic projections
• Front Projection
• Top Projection
• Side Projection
• Axonometric Projection – Isometric
Front, side, and rear orthogonal projections of an object are called elevations
Top orthogonal projection is called a plan view
11. Axonometric orthogonal projections
We can also form orthogonal projections that display more than one face of an
object, such views are called Axonometric projection
The most commonly used axonometric projection is the isometric projection, which
is generated by aligning the projection plane (or the object) so that the plane
intersects each coordinate axis in which the object is defined, called the principal
axes, at the same distance from the origin
15. Normalization Transformation for an Orthogonal Projection
Once we have established the limits for the view volume, coordinate descriptions inside this
rectangular parallelepiped are the projection coordinates, and they can be mapped into a
normalized view volume without any further projection processing.
Some graphics packages use a unit cube for this normalized view volume, with each of the
x, y, and z coordinates normalized in the range from 0 to 1.
Another normalization-transformation approach is to use a symmetric cube, with
coordinates in the range from −1 to 1
17. Perspective Projection
Perspective Projection transforms object positions to the view plane while converging to
a center point of projection.
Perspective projection produces realistic views but does not preserve relative proportions.
Projections of distant objects are smaller than the projections of objects of the same size
that are closer to the projection plane.
Perspective-Projection Transformation Coordinates
Q. Explain in detail perspective projection transformation coordinates
20. Vanishing Points for Perspective Projections
Q.Explain the perspective projection with reference and vanishing point with
neat diagram
The point at which a set of projected parallel lines appears to converge is called a
vanishing point.
Each set of projected parallel lines has a separate vanishing point.
• Based on the number of vanishing points, the perspective projection is of three types
– One point perspective projection(Figure b)
– Two point perspective projection(Figure c)
• One point - When the cube is projected to a view plane that intersects only the z axis, a
single vanishing point in the z direction
• Two point -When the cube is projected to a view plane that intersects both the z and x
axes, two vanishing points are produced.
21. Perspective-Projection Transformation Matrix
Q.Design a Transformation matrix for perspective projection
Three-dimensional, homogeneous-coordinate representation to express the perspective-
projection equations in the form
Second after other processes have been applied, such as the normalization transformation
and clipping routines, homogeneous coordinates are divided by parameter h to obtain the
23. Symmetric Perspective-Projection Frustum
Q.Explain in detail symmetric perspective projection Frustum
The line from the projection reference point through the center of the clipping
window and on through the view volume is the centerline for a perspective projection
frustum.
If this centerline is perpendicular to the view plane, we have a symmetric frustum
(with respect to its centerline)
24. Another way to specify a symmetric perspective projection is to use parameters that
approximate the properties of a camera lens.
In computer graphics, the cone of vision is approximated with a symmetric frustum, and
we can use a field-of-view angle to specify an angular size for the frustum.
For a given projection reference point and view-plane position, the field-of view angle
determines the height of the clipping window from the right triangles in the diagram of
Figure below,
26. Oblique Perspective-Projection Frustum
Q.Explain in detail oblique perspective projection Frustum
If the centerline of a perspective-projection view volume is not perpendicular to the view
plane, we have an oblique frustum
In this case, first transform the view volume to a symmetric frustum and then to a normalized
view volume.
An oblique perspective-projection view volume can be converted to a symmetric frustum
by applying a z-axis shearing-transformation matrix.
Taking the projection reference point as (xprp, yprp, zprp) = (0, 0, 0), we obtain the
elements of the required shearing matrix as
27. • Similarly, with the projection reference point at the viewing-coordinate origin and with
the near clipping plane as the view plane, the perspective-projection matrix is simplified
to
28. Concatenating the simplified perspective-projection matrix with the shear matrix we have
Normalized Perspective-Projection Transformation Coordinates
The final step in the perspective transformation process is to map this parallelepiped to a
normalized view volume.
The transformed frustum view volume, which is a rectangular parallelepiped, is
mapped to a symmetric normalized cube within a left-handed reference frame
31. The Viewport Transformation and Three-Dimensional ScreenCoordinates
Once we have completed the transformation to normalized projection coordinates,
clipping can be applied efficiently to the symmetric cube then the contents of the
normalized view volume can be transferred to screen coordinates.
Positions throughout the three-dimensional view volume also have a depth (z
coordinate), and we need to retain this depth information for the visibility testing and
surface rendering algorithms
32. OpenGL Three-Dimensional Viewing Functions
Q. Explain OpenGL 3D Viewing functions
OpenGL Viewing-Transformation Function
OpenGL Orthogonal-Projection Function
OpenGL General Perspective-Projection Function
OpenGL Viewports and Display Windows
OpenGL Viewing-Transformation Function