0% found this document useful (0 votes)
16 views71 pages

Geometric Transformation - UNIT II

Helps to engineering

Uploaded by

dharani thaneeru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views71 pages

Geometric Transformation - UNIT II

Helps to engineering

Uploaded by

dharani thaneeru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Geometric Transformation

Unit II
Transformation
Geometric transformation Viewing transformation
Translation. This model has been Rotation. This model has been Scaling. This model has been
moved 2 units in the X-direction rotated in the X-Y plane. scaled to 1.5 times its previous
and 3 units in the Y-direction. size
Changing the View. Note that the location of the model relative to the coordinate
axes does not change in any of the different views. Changing the view does not
transform the model itself
viewing transformation
viewing transformation does not change the
coordinate system or the location of the model
on the coordinate system; it simply changes
your view of the model

Common View Transformations.


Panning moved the view of the objects
in (a) to expose a different portion of the
part in (b). In (c), the view is enlarged
to show more detail. In (d), the view
is rotated to a different line of sight. In
each case, the viewing transformation
applies to all the objects in the view and
does not affect the location of the objects
on the coordinate system. (Notice that
the position relative to the coordinate
system icon does not change.)
2D Transformations
Translation
1
Translation as Matrix multiplication
Homogeneous coordinate
Most of the time when working with 3D, we
are thinking in terms of Euclidean geometry
– that is, coordinates in three-dimensional
space (X, Y, and Z)

(X,Y,Z,h)?
In homogeneous coordinates an n-dimensional space is
represented by n+1 dimensions;

(x,y,z) is represented by (hx, hy, hz, h)

h is the homogeneous coordinate

a point (4,2,3) in space is convert to (4w, 2w, 3w, w)

a point (3,4,5) in homogeneous coordinates converts to


point (3/5,4/5)=(0.6,0.8) in the xy-plan
Translation Matrix with homogeneous coordinates

Translation in x direction

Translation in y direction
2D Rotation
Rotation Matrix with Homogeneous Coordinates

Anticlockwise
Combined Rotation and Translation
Case 1:
Rotation followed by Translation
Consider a point P (x, y, 1) in the x-y plane to be rotated by an
angle θ about the z-axis to a position P1 (x1, y1, 1) followed by a
translation by v (p, q) to a position P2 (x2, y2, 1).
Translation followed by Rotation
On the contrary, if translation by v is followed by rotation about the
z-axis by an angle θ to reach P , then
2*
Significance of order in transformations
Rotation of a Point Q (xq, yq, 1) about a Point P (p, q, 1)
Euclidian Transformations

•"Lengths are preserved" means that the absolute


distances between points remain unchanged.
Affine Transformations

•"Ratio of lengths are preserved" means that while the


absolute lengths may change, the relative proportions of
lengths (ratios) remain the same
Reflection

• In 2-D, reflection of an object can be obtained by


rotating it through 180° about the axis of reflection.

• For instance, if an object S in the x-y plane is to be


reflected about the x-axis (y = 0), reflection of a point
(x, y, 1) in S is given by (x*, y*, 1)
Reflection
Similarly, reflection about the y-axis is described as
Reflection About an Arbitrary Line
(a) Translate point D ( p, q, 1) to coincide with the origin O, shifting the line L parallel to itself
to a translated position L*.
(b) Rotate L* by an angle theta such that it coincides with the y-axis (new position of the
line is
L**, say).
(c) Reflect S about the y-axis using Eq. (2.9).
(d) Rotate L** through -theta to bring it back to L*.
(e) Translate L* to coincide with its original position L.
Reflection Through a Point

A point P (x, y, 1) when reflected through the origin is written as P* (x*, y*, 1) = (-x, -y, 1)
Reflection Through Origin
Deformations
Scaling
• Scaling • A point P (x, y, 1) belonging to the object S can be scaled to
a new position vector P* (x*, y*, 1) using factors μx and μy
• Shear

where S =
is the scaling matrix.
Scale factors μxand μyare always non-zero and
positive.
If both factors are less than 1, the geometric
model gets shrunk.
In case of uniform scaling
when μ = μ = μ, the model gets changed
x y

uniformly in size and there is no distortion.


Shear
Transformations in Three-Dimensions
Translation

Translation of a donut along an


arbitrary vector
Rotation in Three-Dimensions
Rotation of a point about the z-, y- and x-axis, respectively, is a
useful transformation used often for rigid body rotation. The
combined rotation is given as
Scaling in Three-Dimensions
Shear in Three-Dimensions

Thus, to shear an object only along the y direction, the entries sh12
= sh13 = sh31 = sh32 would be 0 while either sh21 and sh23 or both would
be non-zero.
Reflection in Three-Dimensions

Generic reflections about the x-y plane (z becomes –


z), y-z plane (x becomes – x), and z-x plane (y
becomes –y) can be expressed using the following
respective transformations
Vertex 1: Matrix A = [10, 5]
Vertex 2: Matrix B = [20, 5]
Vertex 3: Matrix C = [15, 10]
The translation vector: Matrix T = [-5, 10]

To translate each vertex, we simply add the translation vector


to the respective vertex matrix:

For Vertex 1:
Result = A + T = [10, 5] + [-5, 10] = [10-5, 5+10] = [5, 15]

For Vertex 2:
Result = B + T = [20, 5] + [-5, 10] = [20-5, 5+10] = [15, 15]

For Vertex 3:
Result = C + T = [15, 10] + [-5, 10] = [15-5, 10+10] = [10, 20]

So, after translating the triangle by (-5, 10) units using matrix
addition, the new coordinates of the vertices are:

Vertex 1: (5, 15)


Vertex 2: (15, 15)
Vertex 3: (10, 20)
Rotate a polygonal object defined by vertices A(0,0), B(1,0), C(1,1)and D(0,1) by 45
degrees about the origin.
Rotate a polygonal object defined by vertices A(0,0), B(1,0), C(1,1)and D(0,1) by 45
degrees about the origin.
Consider a trapezium ABCD with A = (6, 1, 1), B = (8, 1, 1), C = (10,
4, 1) and D = (3, 4, 1). The entity is to be reflected through the y-axis.
Consider a trapezium ABCD with A = (6, 1, 1), B = (8, 1, 1), C = (10,
4, 1) and D = (3, 4, 1). The entity is to be reflected through the y-axis.
For reference

You might also like