CG Unit-3 PDF
CG Unit-3 PDF
Unit-3
Rohit Rana
Assistant Professor
CSE/IT
Vidya College of Engineering
Three Dimensional Graphics
The three-dimensional transformations are extensions of two-dimensional transformation. In
2D two coordinates are used, i.e., x and y whereas in 3D three co-ordinates x, y, and z are
used.
For three dimensional images and objects, three-dimensional transformations are needed.
These are translations, scaling, and rotation. These are also called as basic transformations
are represented using matrix. More complex transformations are handled using matrix in 3D.
The 2D can show two-dimensional objects. Like the Bar chart, pie chart, graphs. But some
more natural objects can be represented using 3D. Using 3D, we can see different shapes of
the object in different sections.
In 3D when a translation is done we need three factors for rotation also, it is a component of
three rotations. Each can be performed along any three Cartesian axis. In 3D also we can
represent a sequence of transformations as a single matrix.
Computer Graphics uses CAD. CAD allows manipulation of machine components which are
3 Dimensional. It also provides automobile bodies, aircraft parts study. All these activities
require realism. For realism 3D is required. In the production of a realistic 3D scene from 2D
is tough. It require three dimension, i.e., depth.
3D Geometry
Three dimension system has three axis x, y, z. The orientation of a 3D coordinate system is of
two types. Right-handed system and left-handed system.
In the right -handed system thumb of right- hand points to positive z-direction and left- hand
system thumb point to negative two directions. Following gure show right-hand orientation of
the cube.
Using right-handed system co-ordinates of corners A, B, C, D of the cube
Point A x, y, z
Point B x, y, 0
Point C 0, y, 0
Point D 0, y, z
fi
Producing realism in 3D- The three-dimensional objects are made using computer
graphics. The technique used for two Dimensional displays of three Dimensional objects
is called projection. Several types of projection are available, i.e.,
1. Parallel Projection
2. Perspective Projection
3. Orthographic Projection
1. Parallel Projection: In this projection point on the screen is identi ed within a point in
the three-dimensional object by a line perpendicular to the display screen. The
architect Drawing, i.e., plan, front view, side view, elevation are nothing but lines of
parallel projections.
2. Perspective Projection: This projection has a property that it provides idea about
depth. Farther the object from the viewer, smaller it will appear. All lines in perspective
projection converge at a center point called as the center of projection.
3. Orthographic Projection: It is simplest kind of projection. In this, we take a top,
bottom, side view of the object by extracting parallel lines from the object.
fi
Three Dimensional Models
The techniques for generating different images of a solid object depend upon the type of
object. Two viewing techniques are available for viewing three-dimensional objects.
1. Geometry: It is concerned with measurements. Measurement is the location of a point
concerning origin or dimension of an object.
2. Topological Information: It is used for the structure of a solid object. It is mainly
concerned with the formation of polygons with the help of points of objects or the
creation of the object with polygons.
= [5+0+0+30+6+0+30+0+7+20+0+0+1] = [8991]
x becomes x1=8
y becomes y1=9
z becomes z1=9
fi
Scaling
Scaling is used to change the size of an object. The size can be increased or decreased. The scaling
three factors are required Sx Sy and Sz.
Sx=Scaling factor in x- direction
Sy=Scaling factor in y-direction
Sz=Scaling factor in z-direction
Note: If all scaling factors Sx=Sy=Sz.Then scaling is called as uniform. If scaling is done with
different scaling vectors, it is called a differential scaling.
In gure (a) point (a, b, c) is shown, and object whose scaling is to done also shown in steps in
g (b), g (c) and g (d).
fi
fi
fi
fi
fi
fi
fi
Rotation
It is moving of an object about an angle. Movement can be anticlockwise or clockwise. 3D rotation is
complex as compared to the 2D rotation. For 2D we describe the angle of rotation, but for a 3D angle
of rotation and axis of rotation are required. The axis can be either x or y or z.
Following figures shows rotation about x, y, z- axis
Following gure show rotation of the object about the Y axis
Step1: Initial position of P' and P"is shown Step2: Translate object P' to origin
fi
Step3: Rotate P" to z axis so that it aligns along the z-axis
3D-Clipping
Projection
Normalized view space
Scan conversion, Hiding
Image space,
Device coordinates
Image
3D Clipping
• Just like the case in two dimensions, clipping removes objects
that will not be visible from the scene
y y
clipped line
clipped line
x 1 x
1
near far
z 0 1 z
image plane
near
far
Clipping Strategies
• We perform clipping after the projection transformation and
normalizations are complete.
Computer Graphics
3D Cohen-Sutherland Line Clipping
• using this value for u we can then solve for yp and zp similarly
• Then simply continue as per the two dimensional line clipping
algorithm
Projection in Computer Graphics
Projection Introduction: The Types of Projection:
technique projection was invented
by the Swiss mathematician,
engineer, and
astronomer “Leonhard Euler
Around” in 1756. The “Episcope”
was the first projection system.
“Projection is a technique or
process which is used to transform
a 3D object into a 2D plane.” In
other words, we can
define “projection as a mapping of
points P (x, y, z) on to its image
P’ (x,’ y,’z’) in the projection plane or
view plane, which create the display
surface.”
There are two types of projection:
1. Perspective Projection.
2. Parallel Projection.
Perspective Projection:
In the perspective projection, the distance of the project plane from the center of
projection is finite. The object size keeps changing in reverse order with distance.
Perspective projection is used to determine the projector lines come together at a single
point. The single point is also called “project reference point” or “Center of projection.”
•
Characteristic of Perspective Projection:
• The Distance between the object and projection center is finite.
• In Perspective Projection, it is difficult to define the actual size and shape of the
object.
• The Perspective Projection has the concept of vanishing points.
• The Perspective Projection is realistic but tough to implement.
Vanishing Point: Vanishing point can be defined as a point in image plane where all
parallel lines are interlinked. The Vanishing point is also called “Directing Point.”
Use of One Point– The One Point projection is mostly used to draw the images of roads,
railway tracks, and buildings.
Two Point: It is also called “Angular Perspective.” A Two Point perspective contains two
vanishing points on the line.
Use of Two Point– The main use of Two Point projection is to draw the two corner roads.
Three-Point– The Three-Point Perspective contains three vanishing points. Two points lie on the
horizon line, and one above or below the line.
It is very difficult to draw.
When we see an object from above, than the third point is below the ground. If we see an object
from the below, than the third point is in the space above.
Advantages:
1. Better Look
2. Clear Representation
Disadvantages:
1. Difficult to Draw
2. Not Suitable for many-dimensional
images
Parallel Projection:
In Parallel Projection, the distance of project plane from the center of projection is infinite. We
can specify the direction of projection instead of the center of the projection. We can connect the
projected vertices through the line segment.
The parallel Projection eliminates the Z-Coordinate. And the parallel lines from each vertex in the
object are enhanced until the lines intersect the view plane.
Characteristic of parallel Projection-
1. Orthographic Projection
2. Oblique Projection
Orthographic projection: In the Orthographic Parallel Projection, the Projection is
perpendicular to the view plane.
• Front View
• Top View
• Side View
Axonometric Orthographic Projection: The Axonometric Orthographic Projection is used to
construct the pictorial representation of an object. The sight lines are perpendicular to the
projection plane.
• Cavalier
• Cabinet
Advantages:
1.Good for exact Measurement
2.Parallel lines remain parallel
Disadvantages:
1.Less Realistic Looking
2.Angles are not preserved
3.
Thank You