Unit 4 - CG
Unit 4 - CG
COMPUTER GRAPHICS
Three Dimensional Concepts
3D display methods
3D object representations
3D SHAPES
2D SHAPES
Three-Dimensional Display
Methods
3D graphics deals with generating and display 3D objects in a 2D space(display
screen)
To obtain a display of a three dimensional scene that has been modelled in world
coordinates, we must setup a coordinated reference for the camera
This coordinate reference defines the position & orientation for the plane of the
camera film, which is the plane we want to use to display a view of the object in
the scene.
Object descriptions are the transferred to the camera reference coordinate &
projected onto the selected display plane.
The objects can be displayed in wire frame (outline), or we can apply lightining
and surface rendering techniques to shade the visible surfaces
3D computer graphics are graphics that utilize a three
dimensional representation of geometric data that is stored in the
computer for the purposes of performing calculations and
rendering 2D images. Such images may be for later display or for
real-time viewing.
3D display methods – different types of techniques
Parallel Projection.
Perspective Projection
Depth Cueing
Parallel Projection
A parallel projection is a projection of an object in three-dimensional space
onto a fixed plane, known as the projection plane or image plane, where the
rays, known as lines of sight or projection lines, are parallel to each other.
a) Orthographic Projection
b) Oblique Projection
This is the way that our eyes and a camera lens form images and so
the displays are more realistic
The disadvantage is that if the object has only limited variation, the
image may not provide adequate depth information and ambiguity
appears.
Differences between Parallel & Perspective Projection
Depth Cueing :
Depth cueing is implemented by having objects blend into the background
color with increasing distance from the viewer.
The range of distances over which this blending occurs is controlled by the
sliders.
The parts of the objects closest to the viewing position are displayed with
the highest intensities and objects farther away are displayed with
decreasing intensities. This effect is known as ‘depth cueing’.
Note:
Sweep Representation
This simplifies and speeds up the surface rendering and display of object since all surfaces
can be described with linear equations.
3d Object Representation :
Polygon Surfaces
Three ways to represent polygon surfaces
1.Polygon Tables
2.Plane Equations
3.Polygon Meshes
Polygon Tables
The polygon surface is specified with a set of vertex coordinates and associated attribute parameters.
For each polygon input, the data are placed into tables that are to be used in the subsequent processing.
Polygon data tables can be organized into two groups: Geometric tables and attribute tables.
Geometric Tables
Contain vertex coordinates and parameters to identify the spatial orientation of the polygon surfaces.
Attribute tables
Contain attribute information for an object such as parameters specifying the degree of transparency of the
object and its surface reflectivity and texture characteristics.
The object is store by using three tables
1. Vertex Table
2. Edge Table
3. Polygon-surface table
Polygon Tables - Vertex Table
Vertex Table
Coordinate values for each vertex in the object are stored inthis table.
It store x, y, and z coordinate information of all the vertices as v1: x1, y1, z1.
Polygon Tables - Edge table
Edge table
The Edge table is used to store the edge information of the polygon.
In the following figure, edge E1 lies between vertex v1 and v2 which is represented in the table
as E1: v1, v2.
Polygon Tables - Polygon Surface
table
Polygon-Surface table
Polygon surface table stores the number of surfaces present in the polygon.
From the following figure, surface S1 is covered by edges E1, E2 and E3 which can be
represented in the polygon surface table as S1: E1, E2, and E3
Listing the geometric data in three tables provides a convenient to the individual component
(vertices, edges and polygons) of each object.
The object can be displayed efficiently by using data from the edge table to draw the
component lines.
Extra information can be added to the data tables for faster information extraction. For
instance, edge table can be expanded to include forward points into the polygon table so that
common edges between polygons can be identified more rapidly.
E1 : V1, V2, S1
E2 : V2, V3, S1
E3 : V3, V1, S1, S2
E4 : V3, V4, S2
E5 : V4, V5, S2
E6 : V5, V1, S2
This is useful for the rendering procedure that must vary surface shading smoothly
across the edges from one polygon to the next. Similarly, the vertex table can be
expanded so that vertices are cross-referenced to corresponding edges.
Additional geometric information that is stored in the data tables includes the slope
for each edge and the coordinate extends for each polygon. As vertices are input,
we can calculate edge slopes and we can scan the coordinate values to identify the
minimum and maximum x, y and z values for individual polygons.
The more information included in the data tables will be easier to check for errors.
Some of the tests that could be performed by a graphics package are:
5. That if the edge table contains pointers to polygons, every edge referenced by a
polygon pointer has a reciprocal pointer back to the polygon.
Sweep Representations
Used to construct 3D objects from 2D shape
Sweep representations are useful for constructing 3D objects that
possess transitional, rotational, or other symmetries.
Objects are specified as 2D shape and a sweep that moves that shape
through a region of space.
Sweep representations are useful for both surface modeling and solid
modeling
Two ways to achieve sweep:
1. Translational Sweep
2. Rotational Sweep
Solid modeling Surface modeling
Solid-modeling packages often provide a number of construction techniques
We can represent such objects by specifying a two dimensional shape and a sweep
that moves the shape through a region of space
A set of two-dimensional primitives, such as circles and rectangles, can be provided for
sweep representations as menu options
Other methods for obtaining two-dimensional figures include closed spline curve
constructions and cross-sectional slices of solid objects.
1. Translational Sweep
In translational sweeps, the 2D shape is swept along a linear path normal to the
plane of the area to construct three-dimensional object.
1. We then perform a translational sweep by moving the control point’s p, through p3 a set
distance along a straight line path perpendicular to the plane of the cross section.
2. At intervals along this path, we replicate the cross-sectional shape and draw a set of
connecting lines in the direction of the sweep to obtain the wireframe representation
shown in Fig (b).
3. An example of object design using a rotational sweep is given in Figure below this time,
the periodic spline cross section is rotated about an axis of rotation specified in the
plane of the cross section to produce the wireframe representation shown in Fig (b).
An example of object design using a rotational sweep is given in Figure
This time, the periodic spline cross section is rotated about an axis of rotation
specified in the plane of the cross-section to produce the wireframe representation
shown in Fig (b).
If we use a rotation axis perpendicular to the plane of the spline cross-section in Fig.
(a), we generate a two-dimensional shape.
But if the cross section shown in this figure has depth, then we are using one three-
dimensional object to generate another
In general we can specify sweep constructions using any path
For translation we can vary the shape or size of the original 2D shape along the sweep path
For rotational sweeps, we can move along a circular path through any angular distance from
0° to 360°
These sweeps whose generating area or volume changes in size, shape or orientation as
they are swept and that follow an arbitrary curved trajectory are called general sweeps
General sweeps are difficult to model efficiently for example, the trajectory and object
shape may make the swept object intersect itself, making volume calculations complicated
Further more, general sweeps do not always generate solids. For example, sweeping a 2D
shape in its own plane generates another 2D shape.
Constructive Solid Geometry Methods
Objects are represented as a combination of simpler solid objects
(primitives)
Ray Casting is often used to implement CSG operation when objects are described
with boundary representation.
We fire a ray from the plane xy (which represents the screen). The surface limits for
the composite object are determined by the specified set operation
Octrees and Quadtrees
Octree
specifies one of the corners for each of the eight children. In case
of a matrix based (MX) octree, the subdivision point is implicitly the
center of the space represented by the node. The root node of a PR
octree can be able to represent infinite space; the root node of an
MX octree must be able to represent a finite bounded space so that
the implicit centers are well-defined.
Thank You