Unit-6 Three Dimensional Transformations
Unit-6 Three Dimensional Transformations
in
Unit-6
Methods for geometric transforamtions and object modelling in 3D are extended from 2D
methods by including
the considerations for the z coordinate.
Basic geometric transformations are: Translation, Rotation, Scaling
6.1 Basic Transformations
Translation
We translate a 3D point by adding translation distances, tx, ty, and tz, to the original coordinate
position (x,y,z):
x' = x + tx, y' = y + ty, z' = z + tz
Alternatively, translation can also be specified by the transformation matrix in the following
formula:
x' 1 0 0 tx x
y' 0 1 0 t y
z' 0 0 1 tz z
1 0 0 0 1 1
Exercise: translate a triangle with vertices at original coordinates
(10,25,5), (5,10,5), (20,10,10) by
tx=15, ty=5,tz=5. For verification, roughly plot the x and y values of the original and
resultant triangles, and imagine the locations of z values.
Scaling With Respect to the Origin
We scale a 3D object with respect to the origin by setting the scaling factors sx, sy and sz, which
are
multiplied to the original vertex coordinate positions (x,y,z):
x' = x * sx, y' = y * sy, z' = z * sz
Alternatively, this scaling can also be specified by the transformation matrix in the following
formula:
x' sx 0 0 0 x
y' 0 sy 0 0 y
z' 0 0 sz 0 z
1 0 0 0 1 1
Smartzworld.com 1 jntuworldupdates.org
Smartworld.asia Specworld.in
Exercise: What are the steps to perform scaling with respect to a selected fixed
position? Check your answer with the text book.
Exercise: Scale a triangle with vertices at original coordinates (10,25,5), (5,10,5),
(20,10,10) by sx=1.5, sy=2, and sz=0.5 with respect to the centre of the triangle.
For verification, roughly plot the x and y values of the original and resultant
triangles, and imagine the locations of z values.
Coordinate-Axes Rotations
A 3D rotation can be specified around any line in space. The easiest rotation axes to handle are
the
coordinate axes.
X-axis rotation:
Y-axis rotation:
Smartzworld.com 2 jntuworldupdates.org
Smartworld.asia Specworld.in
Step 1. Translate the object so that the rotation axis coincides with the parallel coordinate axis.
Step 2. Perform the specified rotation about that axis.
Step 3. Translate the object so that the rotation axis is moved back to its original position.
General 3D Rotations
Step 1. Translate the object so that the rotation axis passes through the coordinate origin.
Step 2. Rotate the object so that the axis of rotation coincides with one of the coordinate axes.
Step 3. Perform the specified rotation about that coordinate axis.
Step 4. Rotate the object so that the rotation axis is brought back to its original orientation.
Step 5. Translate the object so that the rotation axis is brought back to its original position.
Smartzworld.com 3 jntuworldupdates.org
Smartworld.asia Specworld.in
Modelling
Coordinates
Modelling
Transformations
Explanation
World
Coordinates
Viewing
Transformation
Viewing
Coordinates
Projection
Transformation
Projection
Coordinates
Workstation
Transformation
Device
Coordinates
Modelling Transformation and Viewing Transformation can be done by 3D transformations.
The viewing-coordinate system is used in graphics packages as a reference for specifying the
observer viewing position and the position of the projection plane. Projection operations convert
the viewing-coordinate description (3D) to coordinate positions on the projection plane (2D).
(Usually combined with clipping, visual-surface identification, and surface-
rendering)Workstation transformation maps the coordinate positions on the
Smartzworld.com 4 jntuworldupdates.org
Smartworld.asia Specworld.in
6.6 Projections
Projection operations convert the viewing-coordinate description (3D) to coordinate positions on
the
projection plane (2D). There are 2 basic projection methods:
1. Parallel Projection transforms object positions to the view plane along parallel lines.
A parallel projection preserves relative proportions of objects. Accurate views of the various
sides of
an object are obtained with a parallel projection. But not a realistic representation
2. 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.
Smartzworld.com 5 jntuworldupdates.org
Smartworld.asia Specworld.in
Orthographic parallel projections are done by projecting points along parallel lines that are
perpendicular to the projection plane.
Oblique projections are obtained by projecting along parallel lines that are NOT perpendicular to
the
projection plane.Some special Orthographic Parallel Projections involve Plan View (Top
projection), Side Elevations, and Isometric Projection:
Smartzworld.com 6 jntuworldupdates.org
Smartworld.asia Specworld.in
frustum becomes a regular parallelepiped. The transformation equations are shown as follows
and are applied to every vertex of each object:
x' = x * (d/z),
y' = y * (d/z),
z' = z
Where (x,y,z) is the original position of a vertex, (x',y',z') is the transformed position of the
vertex,
and d is the distance of image plane from the center of projection.
Note that:
Perspective transformation is different from perspective projection: Perspective projection
projects a
3D object onto a 2D plane perspectively. Perspective transformation converts a 3D object into a
deformed 3D object. After the transformation, the depth value of an object remains unchanged.
Before the perspective transformation, all the projection lines converge to the center of
projection.
After the transformation, all the projection lines are parallel to each other. Finally we can apply
parallel projection to project the object onto a 2D image plane. Perspective Projection =
Perspective Transformation + Parallel Projection
Smartzworld.com 7 jntuworldupdates.org
Smartworld.asia Specworld.in
Some facts:
Perspective effects depend on the positioning of the center point of projection. If it is close to the
view plane, perspective effects are emphasized, ie. closer objects will appear larger than more
distant
objects of the same size. The projected size of an object is also affected by the relative position
of the object and the view plane.
'Viewing' a static view:
The view plane is usually placed at the viewing-coordinate origin and the center of projection is
positioned to obtain the amount of perspective desired.
'Viewing' an animation sequence:
Usually the center of projection point is placed at the viewing-coordinate origin and the view
plane is
placed in front of the scene. The size of the view window is adjusted to obtain the amount of
scene
desired. We move through the scene by moving the viewing reference frame (ie. the viewing
coordinate system).
Some facts:
Perspective effects depend on the positioning of the center point of projection. If it is close to the
view plane, perspective effects are emphasized, ie. closer objects will appear larger than more
distant
objects of the same size. The projected size of an object is also affected by the relative position
of the object and the view
plane.
'Viewing' a static view:
The view plane is usually placed at the viewing-coordinate origin and the center of projection is
positioned to obtain the amount of perspective desired.
'Viewing' an animation sequence:
Usually the center of projection point is placed at the viewing-coordinate origin and the view
plane is
placed in front of the scene. The size of the view window is adjusted to obtain the amount of
scene
desired. We move through the scene by moving the viewing reference frame (ie. the viewing
coordinate system).
6.8 Clipping
The purpose of 3D clipping is to identify and saveall surface segments within the view volume
for display on the output device. All parts of objects that are outside the view volume are
discarded. Thus the computing time is saved. 3D clipping is based on 2D clipping. To
Smartzworld.com 8 jntuworldupdates.org
Smartworld.asia Specworld.in
Smartzworld.com 9 jntuworldupdates.org
Smartworld.asia Specworld.in
We repeat the clipping process with the new polygon against the next border line of the clip
region.
7. This clipping operation results in a polygon which is totally inside the clip region.
Smartzworld.com 10 jntuworldupdates.org