0% found this document useful (0 votes)
47 views24 pages

Transformation

Uploaded by

srav69003
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)
47 views24 pages

Transformation

Uploaded by

srav69003
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/ 24

In general, "transformation" refers to the process of using rules or algorithms to

change one visual into another. Lines, rectangles, circles, and triangles can occasionally
be combined to create an image or picture. It ought to be necessary to alter these
pictures if we sketch the fundamental and combination pictures.
The following operations may now be carried out to alter the images:
 An image's location can be altered.
 An image's size is something we can change.
 The image's angle is modifiable.
We will find a new picture by applying the aforementioned activities; this procedure is
known as transformation. Certain algorithms allow us to create new images.

The object transformation includes two important points-


 Geometric Transformation: When we are moving the picture, and the
background is fixed, then it is a Geometric Transformation.
 Coordinate Transformation: When we are moving the background, and the
picture is fixed, then it is Coordinate Transformation.
2D Transformation means a change in either position or orientation or size or
shape of graphics objects like line, circle, ellipse, rectangle, polygon, triangle @etc.
Two essential aspects of transformation are given below–
i) Each transformation is a single entity. It can be denoted by a unique name
or symbol.
ii) It is possible to combine two transformations, after connecting a single
transformation is obtained.
e.g., A is a transformation for translation. The b transformation performs scaling. The
combination of two C=AB. So, C is obtained by concatenation property.
Transformations play an important role in computer graphics to reposition
the graphics on the screen and change their size or orientation.

Many computer graphics face issues in displaying three-dimensional objects on a


two-dimensional screen. We would like to rotate, translate, and scale our objects to
view them from arbitrary points of view, view as per our perspective. We would like
to display our objects in a coordinate system which the system is convenient for us and
we can able to reuse them whenever required.
To perform a sequence of transformation such as translation followed by rotation
and scaling, we need to follow a sequential process −
 Translate the coordinates,
 Rotate the translated coordinates, and then
 Scale the rotated coordinates to complete the composite transformation.
To convert a 2×2 matrix to 3×3 matrix, we have to add an extra dummy
coordinate W.
In this way, we can represent the point by 3 numbers instead of 2 numbers,
which is called Homogenous Coordinate system. In this system, we can represent all
the transformation equations in matrix multiplication. Any Cartesian point P (X, Y) can
be converted to homogenous coordinates by P’ (Xh, Yh, h).
Homogeneous coordinates will have some neutral applications in computer
graphics, they form the basis for geometry which is used extensively to display three-
dimensional objects on two-dimensional image planes. Homogeneous coordinate
provides a standard to perform certain standard operations on points in Euclidean
space means matrix multiplication.
Homogeneous co-ordinate written as–– x wx
y = wy where w≠0
w
For example, Sx 0 w.Sx 0 0
0 Sy = 0 w.Sy 0 where w≠0
0 0 w

§ - –

Tx 1 0 Tx Sx Sx 0 0
Ty = 0 1 Ty Sy = 0 Sy 0
0 0 1 0 0 1

Clockwise Anti-Clockwise

cosθ sinθ cosθ sinθ 0 cosθ -sinθ cosθ sinθ 0


-sinθ cosθ = -sinθ cosθ 0 sinθ cosθ = -sinθ cosθ 0
0 0 1 0 0 1

– –

1 0 1 0 0 -1 0 -1 0 0 -1 0 -1 0 0
0 -1 0 -1 0 0 1 0 1 0 0 -1 0 -1 0
0 0 1 0 0 1 0 0 1

= =–

0 1 0 1 0 0 -1 0 -1 0
1 0 1 0 0 -1 0 -1 0 0
0 0 1 0 0 1

– –

1 0 1 0 0 1 shy 1 shy 0
Shx 1 shx 1 0 0 1 0 1 0
0 0 1 0 0 1
Basic type of 2D transformation are-

1. 2D Translation: "Translation is a method used to shift the entity on the monitor from one
location to another location."
2. 2D Rotation: "Rotation is a technique used to twist an entity from its source to a certain angle. "

3. 2D Scaling: "Scaling is a form or method used in a two-dimensional plane to resize the entity. "
4. 2D Reflection: "Reflection is a phase or system through which the entity can be rotated at a
180 ° angle."
5. 2D Shearing: "Shearing is a technique that is used to conduct the entity's slanting." It is often
referred to as "Skewing."

Translation moves an object in the straight line to a different position on the


screen. A translation moves all points of an object a fixed distance in a specific direction.
Translation of point: We can translate a point in 2D by adding translation co-
ordinate (fx, fy) to the original co-ordinate (x, y) to get the new co-ordinate (x', y').
From the figure, we can write that–
x'=x+fx
y'=y+fy
 The pair (fx, fy) is called translation vector or shift vector.

In matrix form, the above relation can be expressed


as–
x' x fx
y' = y + fy

The above equation can be expressed as– [x'] = [x]+[T]


where, [x'] is the transformed object matrix
[x] is the original object matrix
[T] is the translation vector.

Translation of a point
Here we only translate the x and y coordinates of given
point as per given translation factor dx and dy respectively. We get final coordinate
(after translation) if we add translation factor with original coordinate respectively.
The translation of a line is to translate both the end points of
the line by the given translation factor (fx, fy) and then redraw the line between the
new end points (original end points + translation factor respectively) depends on
the display device used and line drawing algorithm followed:
x'=x+fx y'=y+fy

Consider a line with two end points A(0, 8) and B(9, 12). Also given translation
factor (fx, fy) is (6, -3).

Here, A(0, 8) and implying fx= 6, fy= –3. Now A'=(0+6, 8+(–3))
A'=(6, 5)
B(9, 12) and implying fx= 6, fy= –3. Now B'=(9+6, 12+(–3))
B'=(15, 9)
Or, we can say–
X1' 0 6 6
Y1' = 8 + -3 = 5

and X2' 9 6 15
Y 2' = 12 + -3 = 9

Combining these two,


6 15 0 9 6 6
5 9
= 8 12 + -3 -3

: The length and slope of the translated line remains same as that of the
original line.
Here we only translate the x and y coordinates of given
circle centre as per given translation factor fx and fy respectively. We get final circle
centre coordinate (after translation) if we add translation factor with original centre
coordinate respectively.

Given a circle with radius 10 and centre coordinate (1, 4). Apply translation with
diance 5 towards x-axis and 1 towards y-axis. Obtain the new coordinates of the
circle without changing the radius.

Given, centre coordinate (x, y) = (1, 4)


translation vector (fx, fy) = (5, 1)
Applying the translation equation,
x' = x + fx = 1 + 5 = 6 | y' = y + fy = 4 + 1 = 5
So, the new circle(after translation) centre coordinates is (6, 5).

Translation of rectangle
The Translate function handles the translation of the
rectangle. It takes the current position (x, y) of the rectangle and the height and width
as input. The user is prompted to enter the translation coordinates (fx, fy). The function
then clears the screen using the clear device() and calculates the rectangle's new position
(x', y') after translation by adding the translation coordinates to the initial position.
Finally, it calls the Rectangle function to draw the translated rectangle.

Given a rectangle with coordinate points A(0,3), B(3,3), C(3,0), D(0,0). Apply the
translation with diance 1 towards x-axis and 1 towards y-axis. Obtain the new
coordinates of the square.

Given, coordinates of square are A(0,3), B(3,3), C(3,0) and D(0,0).


and translation vector(fx, fy)=(1,1)
For coordinate (0,3)
new co-ordinate A'=(x', y')
x'=x + fx = 0+1 =1 | y'=y + fy = 3+1 =4
so, new coordinates of corner A'=(1, 4)
For coordinate (3,3)
new co-ordinate B'=(x', y')
x'=x + fx = 3+1 =4 | y'=y + fy = 3+1 =4
so, new coordinates of corner B'=(4, 4)

Similarly, new co-ordinate of corner C' and D' are (4, 1) and (1, 1) respectively.
In rotation, we rotate the object at particular angle ϴ
from its origin. Rotation can be clockwise or anti-clockwise. For rotation, we have to
specify only the angle of rotation or the angle of rotation and rotation point/pivot
point.

Rotation a point about origin Anti-clockwise

Consider the point A(P0, Q0) is located at angle ϴ


from the horizontal x coordinate with distance r from the origin.
Suppose we want to rotate it at the angle ϴ. After rotating it
to a new location A'(P1, Q1).
Cosϴ = or, x= rcosϴ

Sinϴ = or, y= rsinϴ

Some way we can represent the point A'=(P1, Q1) as–


cos(ϴ+φ) =

or, x'=rcos(ϴ+φ)
= r.cosϴ.cosφ – r.sinϴ.sinφ
or, x'=x.cosφ – y.sinφ
sin(ϴ+φ) =

or, y'= rsin(ϴ+φ)


= r[sinϴ.cosφ+ cosϴ.sinφ]
= r.sinϴ.cosφ + r.cosϴ.sinφ
or, y'= y.cosφ + x.sinφ
Representing above equation in matrix form,
x' cosφ -sinφ x
y'
= sinφ cosφ
*
y

Symbolically, [x'] = [Tr]*[x] where, [Tr] is the transformation matrix.

clockwise

, (-ve).
Rotate line AB whose endpoints are A (2, 5) and B (6, 12) about origin thugh a
30° clockwise direction.

For rotation in the clockwise direction. The matrix is–


cosϴ -sinϴ
R= sinϴ cosϴ here, ϴ= –30°

Rotation of point A (2, 5). Take angle 30° –


cos30° sin30°
R= -sin30° cos30°

.866 -0.5
= 2 5 * .5 .866

= 2* .866+5*.5 2*(-5)+5* .866

= 1.732+2.5 -1+4.33

= 4.232 3.33

A end point of this line become (4.232 3.33).

Rotation of point A (6, 12). Take angle 30° –


cos30° sin30°
R= -sin30° cos30°

.866 -0.5
= 6 12 * .5 .866

= 6* .866+12*.5 6*(-5)+12* .866

= 5.196+6 -3+10.392

= 11.196 7.392

B end point of this line become (11.196, 7.392).


Rotation a point about arbitrary point
2D rotation is a transformation technique
in computer graphics that rotates an object around a specified point or axis by a specific
angle in a 2D plane.

Consider the point P(x,y) is located at angle φ from the horizontal x coordinate with
distance r from the arbitrary point.
Suppose we want to rotate it at the angle ϴ. After rotating it to a new location P'(x',y').
Here arbitrary point locate at location s(xp,yp).

According to this picture

Calculate x' = OB
= OA+AB
= xp+(x–xp)cosθ –(y–yp)sinθ
= xp+xcosθ –xpcosθ –ysinθ +ypsinθ
= {(1–cosθ)xp +ypsinθ}+{xcosθ–ysinθ}
/ = φ / = (θ+φ)
Calculate y' = OB' = . φ = (θ+φ)
= OA'+A'B' ( – ) = . φ = . φ θ
= yp+(x–xp)sinθ +(y-yp)cosθ –. φ θ
' '/ = φ =( – ) θ
= yp +xsinθ –xpsinθ +ycosθ -ypcosθ
' '= φ –( – ) θ
= {(1–cosθ)yp –xpsinθ}+{xsinθ+ycosθ} ( – )= φ

' '/ = (φ+θ)


x'={(1–cosθ)xp +ypsinθ}+{xcosθ–ysinθ} ' ' = (φ+θ)
= φ θ+ φ θ
y'={(1–cosθ)yp –xpsinθ}+{xsinθ+ycosθ}
= ( – ) θ +( – ) θ

A transformation sequence for rotating an object about a specified pivot point using
the rotation matrix, x' (1–cosθ) sinθ xp cosθ –sinθ x
y' = –sinθ (1-cosθ) yp
* *
sinθ cosθ + y
Scaling is a process of
modifying or changing the size of objects. It is type of
transformation through which we can zoom-in or zoom-
out any particular object or shape.

We can apply scaling on the object by multiplying


the original coordinates with scaling factors (sx, sy). sx for
x-axis and sy for y-axis.

Scaling about origin


They can be mathematically represented as– x'=x*sx and y'=y*sy

The above equation can be represented as– x' sx 0 * x


y' = 0 sy y
or symbolically, [x']= [Ts]*[x]

There are two types of scaling –

(i) Uniform scaling [when, sx=sy]

If sx=sy>1 --then object size is increased.


If sx= sy<1 --then object size is decreased.

(ii) Non-uniform scaling / Differential scaling

When sx and sy are individually >1 or <1 but un-equal.

Consider a square with coordinate P(1,4), Q(4,4), R(4,1), T(1,1). Apply scaling factor
3 on x-axis and 4 on the y-axis. Find out new coordinate of the square.

Sx=3 and Sy=4

For coordinate P(1,4)– x'= x.Sx = 1*3 =3


y'= y.Sy =4*4 =16
For coordinate Q(4,4)– x'= x.Sx = 4*3 =12
y'= y.Sy =4*4 =16
For coordinate R(4,1)– x'= x.Sx = 4*3 =12
y'= y.Sy =1*4 =4

For coordinate T(1,1)– x'= x.Sx = 1*3 =3


y'= y.Sy =1*4 =4
Scaling with respect to any arbitrary point

Scaling with respect to an arbitrary point involves resizing an object or a system


while maintaining its proportions relative to that chosen reference point. This concept
is commonly used in physics and computer graphics.
The most generalized expression for scaling any object P(x, y) with respected to
any arbitrary point say Pf(xf, yf).
They can be mathematically represented as– x'= xf +(x–xf)*sx
y'= yf +(y–yf)*sy

We can rewrite the above equation as– x'= sx.x+(1-sx)xf


y'= sy.y+(1-sy)yf

––
x' sx 0 x 1-sx 0 xf
y'
= 0 sy y
+
0 1-sy yf

- ––

Scaling with respect to an arbitrary point so, we can first translate arbitrary point
to the origin and then scaling at last translate to given arbitrary point.

Translation (to origin)


Scaling Matrix
MATRIX REPRESENTATION­­­ Matrix

x' 1 0 xf Sx 0 0 1 0 -xf x
y' = 0 1 yf 0 Sy 0 0 1 -yf y
1 0 0 1 0 0 1 0 0 1 1
Translation (origin to given
arbitrary point) Matrix
1 0 xf Sx 0 0 x-xf
= 0 1 yf 0 Sy 0 y-yf
0 0 1 0 0 1 1

1 0 xf Sx(x-xf) Sx(x-xf)+xf
= 0 1 yf Sy(y-yf) = Sy(y-yf)+ yf
0 1 1 1 1
So, x'= Sx(x-xf)+xf = Sx.x -Sx.xf +xf = sx.x+(1-sx)xf
y'= Sy(y-yf)+ yf = Sy.y -Sy.yf +yf = sy.y+(1-sy)yf
The Reflection is a mirror image of the original object. In
the Reflection process, the size of the object does not change.
or
 Reflection is a kind of rotation where the angle of rotation is 180°.
 The reflected object is always formed on the other side of mirror.
 The size of reflected object is same as the size of original object.

We can represent Reflection by using four ways–:



1. Reflection along X-axis.
2. Reflection along Y-axis.
3. Reflection perpendicular to XY plane.
4. Reflection along with the line.

1. Reflection along X-axis:


In this kind of Reflection, the value of X is positive, and the value of
Y is negative. We can represent the Reflection along x-
axis by following equation-
x'=x & y'=-y
We can also represent Reflection in the form of matrix-
x' 1 0 x
y' = 0 -1 * y

2. Reflection along Y-axis:


In this kind of Reflection, the value of X is negative, and the value of
Y is positive. We can represent the Reflection along y-
axis by following equation-
x'=-x & y'=y
We can also represent Reflection in the form of matrix-

x' -1 0 x
y' = 0 1 * y
3. Reflection along with the line Y=X:
In this kind of Reflection, the value of X is
equal to the value of Y. We can represent the Reflection
along y-axis by following equation-
Y=X, then the points are (Y, X)
& x'=y, y'=x
We can also represent Reflection in the form of matrix-

x' 0 1 x
y'
= 1 0 * y

4. Reflection about an axis perpendicular to xy plane


and passing through origin:
In this kind of Reflection, the value of
both X and Y is negative.
We can represent the Reflection along y-axis by following
equation-
x'= -x & y'=-y

We can also represent Reflection in the form of matrix-

x' -1 0 x
y' = 0 -1 * y
Shearing basically a technique which changes the shape
of existing object in a two-dimensional plane. In a two-dimensional plane, the object
size can be changed along X direction as well as Y direction.

So, there are two versions of shearing-

Let- Initial coordinates of the object O = (x,y)


Shearing parameter towards X direction = Shx
Shearing parameter towards Y direction = Shy
New coordinates of the object O after shearing = (x', y')
Shearing along x –axis
In this, we can store the y coordinate and only change the x coordinate.
It is also called “Horizontal Shearing.”

Shearing in X axis is achieved by using the following


shearing equations-

x'= x +Shx * y & y'= y

In Matrix form, the above shearing equations may


be represented as-
x' 1 Shx x
y' = 0 1 * y

Shearing along y –axis


In this, we can store the x
coordinate and only change the y coordinate. It is
also called “Vertical Shearing.”

We can represent Vertical Shearing by the following


equation- x'= x & y'= y+Shy *x

In Matrix form, the above shearing equations may


be represented as-
x' 1 0 x
y' = Shy 1 * y
The three-dimensional transformations are extensions of two-dimensional
transformation. 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 2D two coordinates are used, i.e., x and y whereas in 3D three co-
ordinates x, y, and z are used.
The geometric transformations play a vital role in generating
images of three-Dimensional objects with the help of these
transformations. The location of objects relative to others can be easily expressed.
Sometimes viewpoint changes rapidly, or sometimes objects move in relation to each
other. For this number of transformations can be carried out repeatedly.
 3D Transformations take place in a three-dimensional plane.
 3D Transformations are important and a bit more complex than 2D
Transformations.
 Transformations are helpful in changing the position, size, orientation, shape @etc
of the object.
In computer graphics, various transformation techniques are-
I. Translation:: Change Position
II. Rotation:: Rotate any shape, picture, frame @etc
III. Scaling:: Change size(scale up or down)
IV. Reflection:: Escape a shadow
V. Shear:: Basically skewing

3D translation is a process of moving an object from one


position to another position in three-dimension plane.
If any point P(x, y, z) in 3D space is moved to position P'(x', y', z').
x'= x +tx
Here, P(x, y, z) is previous point & P'(x', y', z') is changed point.
y'= y +ty
tx, ty, tz are the displacement of p in the three principal
z'= z +tz directions x, y and z respectively.
In matrix form, the previous relation can be expressed as- x' Tx x
y' = Ty * y
z' Tz z

We can express this 3d translation in homogeneous matrix form as-


x' 1 0 0 Tx x
y' 0 1 0 Ty * y
z'
= 0 0 1 Tz z
1 0 0 0 1 1

A point has co-ordinates P(1, 2, 3) in x, y, z -direction. Apply translation with a


diance of 2 toward x-axis, 3 towards y-axis and 4 towards the z-axis. Find the
new(translated) co-ordinates of the point.

Given point P(x, y, z)=(1, 2, 3) and Tx=2, Ty=3, Tz=4

Let us assume the co-ordinate of p after translation P'(x', y', z') –

x'= x+Tx = 1+2 =3


y'= y+Ty =2+3 =5
z'= z+Tz =3+4 =7
In scaling, we can expend or compress the size of any
object. We can apply scaling on the object by multiplying the original coordinates with
scaling factors.

The term scaling facto r is used to define whether the size of the object is increased
or decreased. We can represent the scaling factor by ‘Sx’ for the x-axis, ‘Sy’ for the y-
axis, and ‘Sz’ for the z-axis.

The increment and decrement of an object is depending on two conditions. They are-

 If scaling factor (Sx, Sy, Sz) > 1, then the size of the object increased.
 If scaling factor (Sx, Sy, Sz) < 1, then the size of the object decreased.

Scaling about origin

They can be mathematically represented as– x'=x*sx , y'=y*sy , z'=z*sz

The above equation can be represented as– x' sx 0 0 x


y' = 0 sy 0 * y
z' 0 0 sz z
or symbolically, [s']= [st]*[s]

We can express this 3d translation in homogeneous matrix form as-


x' sx 0 0 0 x
y' = 0 sy 0 0 * y
z' 0 0 sz 0 z
1 0 0 0 1 1

≠ ≠
Scaling with respect to any arbitrary point
Scaling with respect to an arbitrary
fixed point is not as simple as scaling with respect to the origin. The procedure of
scaling with respect to an arbitrary point is:

 Translate the object so that the fixed point coincides with the origin.
 Scale the object with respect to the origin.
 Use the inverse translation of step 1 to return the objects to its original
position.

Consider a point P(x, y, z) of a object scaled relative to a fixed point(x f, yf, zf) can be
achieved by using the following equation––
x'=Sx.x +(1-Sx)xf
Translate origin to x'=Sy.y +(1-Sy)yf
Arbitrary point z'=Sz.z +(1-Sz)zf
In matrix representation with homogeneous co-ordinates of above equation–
x' 1 0 0 tx Sx 0 0 0 1 0 0 -tx x
y' 0 1 0 ty * 0 Sy 0 0 0 1 0 -ty * y
= *
z' 0 0 1 tz 0 0 Sz 0 0 0 1 -tz z
1 0 0 0 1 0 0 0 1 0 0 0 1 1

x' Sx 0 0 tx 1 0 0 -tx x Scaling matrix


y'
= 0 Sy 0 ty * 0 1 0 -ty
* y Translate Arbitrary
z' 0 0 Sz tz 0 0 1 -tz z point to origin
1 0 0 0 1 0 0 0 1 1

x' Sx 0 0 -Sx.tx+tx x
y' 0 Sy 0 -Sy.ty+ty * y
z' = 0 0 Sz -Sz.tz+tz z
1 0 0 0 1 1

x' Sx 0 0 (1-Sx)xf x
y' = 0 Sy 0 (1-Sy)yf * y
z' 0 0 Sz (1-Sz)zf z
1 0 0 0 1 1
In general, rotations are specified by a rotation axis and an
angle. In two-dimensions there is only one choice of a rotation axis that leaves points
in the plane.
 The easiest rotation axes are those that parallel to the coordinate axis.
 Positive rotation angles produce counterclockwise rotations about a coordinate
axis, if we are looking along the positive half of the axis toward the coordinate
origin.

For example, let us assume, the initial co-ordinate of an object is (x, y, z), the
initial angle of the object with respect to origin is φ and
θ. The new co-ordinate aer rotation is (x', y', z').

Rotation about principal Axis We can rotate an object parallel or along to the specific
axis so that the co-ordinate about which the object rotates, remains unchanged and the
rest two of the co-ordinates get changes.
There are three kinds of such rotations that are possible–––

i) Rn abt x ax


ii) Rn abt y ax
iii) Rn abt z ax

Rn abt x ax

Here object rotate parallel to the x-axis, so x-coordinate remains unchanged and
rest two co-ordinate y and z only change.
The rotation is achieved by using the following equations –––
x'=x
y'=ycosθ–zsinθ
z'=ysinθ+zcosθ
Matrix representation of above equations is given as follows––

x' 1 0 0 x
y' = 0 cosθ -sinθ * y
z' 0 sinθ cosθ z
Rn abt y ax

Here object rotate parallel to the y-axis, so y-coordinate remains unchanged and
rest two co-ordinate x and z only change.
The rotation is achieved by using the following equations –––

x'=zsinθ+xcosθ
y'=y
z'=zcosθ-xsinθ
Matrix representation of above equations is given as follows––

x' cosθ 0 sinθ x


y' = 0 1 0 *y
z' -sinθ 0 cosθ z

Rn abt z ax

Here object rotate parallel to the z-axis, so z-coordinate remains unchanged and
rest two co-ordinate x and y only change.
The rotation is achieved by using the following equations –––
x'=xcosθ-ysinθ
y'=xsinθ+ycosθ
z'=z

Matrix representation of above equations is given as follows––

x' cosθ -sinθ 0 x


y' = sinθ cosθ 0 * y
z' 0 0 1 z
Reflection in computer graphics is used to emulate
reflective objects like mirrors and shiny surfaces. Reflection may be an x-axis, y-axis , z-
axis. and also in the planes xy-plane, yz-plane, and zx-plane. Reflection relative to a
given Axis are equivalent to 180 Degree rotations. The size of reflected object is as
same as the size of the original object.

In 3-D, there are three possible types of reflection––––

i) Refn  to XY p


ii) Refn  to YZ p
iii) Refn  to XZ p

Consider a point P(x, y, z) in 3D plane, aer reflection the new co-ordinate of the
P is P'(x', y', z').

Refn  to XY p

In the xy plane, after reflection the object goes on opposite side of the xy
plane along the z direction. In simple word when xy plane reflection, then value
of z is negative.
This reflection is achieved by using the following reflection equations––
x'=x
y'=y
z'=–z

Matrix representation of above equations is given as follows––

x' 1 0 0 x
y' = 0 1 0 * y
z' 0 0 -1 z
Matrix representation of above equations using homogeneous co-ordinate is given as
follows–

x' 1 0 0 0 x
y' = 0 1 0 0 * y
z' 0 0 -1 0 z
1 0 0 0 1 1
Refn  to YZ p

In the yz plane, after reflection the object goes on opposite side of the yz
plane along the x direction. In simple word when yz plane reflection, then value
of x is negative.
This reflection is achieved by using the following reflection equations––
x'=–x
y'=y
z'=z

Matrix representation of above equations is given as follows––

x' -1 0 0 x
y' = 0 1 0 * y
z' 0 0 1 z
Matrix representation of above equations using homogeneous co-ordinate is given as
follows– x' -1 0 0 0 x
y' 0 1 0 0 y
=
z' 0 0 1 0 * z
1 0 0 0 1 1

Refn  to XZ p

In the xz plane, after reflection the object goes on opposite side of the xz
plane along the y direction. In simple word when xz plane reflection, then value
of y is negative.
This reflection is achieved by using the following reflection equations––
x'=x
y'=–y
z'=z

Matrix representation of above equations is given as follows––


x' 1 0 0 x
y' = 0 -1 0 * y
z' 0 0 1 z

Matrix representation of above equations using homogeneous co-ordinate is given as


follows– x' 1 0 0 0 x
y' 0 1 0 0 y
= *
z' 0 0 -1 0 z
1 0 0 0 1 1
A transformation that distorts the shape of an object such
that the transformed shape appears as if the object were composed of internal layers
that had been caused to slide over each other is called a shearing.
.

3D shear is a technique to change the shape of an object in a 3D plane. The


object size can be changed along x, y and z -direction.

So, there are three version of shearing–––


i) Sg  X n
ii) Sg  Y n
iii) Sg  Z n

Consider a point P with co-ordinates (x, y, z) and Shx, Shy and Shz are the shearing
parameters toward x, y and z-axis respectively and also new point P'(x', y', z').

Sg  X n
In this, we can store the x coordinate and only change the y and z coordinate.

We can represent shearing along x-axis by the following equation––

x'= x
y'= y+Shy.x
z'= z+Shz.x

Matrix representation of above equations is given as follows––


x' 1 0 0 x
y' = Shy -1 0 * y
z' Shz 0 1 z
Matrix representation of above equations using homogeneous co-ordinate is given as
follows– x' 1 0 0 0 x
y' = Shy -1 0 0 * y
z' Shz 0 1 0 z
1 0 0 0 1 1
Sg  Y n
In this, we can store the y coordinate and only change the x and z coordinate.

We can represent shearing along y-axis by the following equation––

x'= x+Shx.y
y'= y
z'= z+Shz.y

Matrix representation of above equations is given as follows––


x' 1 Shx 0 x
y' = 0 1 0 * y
z' 0 Shz 1 z
Matrix representation of above equations using homogeneous co-ordinate is given as
follows– x' 1 Shx 0 0 x
y' = 0 1 0 0 * y
z' 0 Shz 1 0 z
1 0 0 0 1 1

Sg  Z n
In this, we can store the z coordinate and only change the x and y coordinate.

We can represent shearing along z-axis by the following equation––

x'= x+Shx.z
y'= y+Shy.z
z'= z

Matrix representation of above equations is given as follows––


x' 1 0 Shx x
y' = 0 1 Shy * y
z' 0 0 1 z

Matrix representation of above equations using homogeneous co-ordinate is given as


follows– x' 1 0 Shx 0 x
y' = 0 1 Shy 0 * y
z' 0 0 1 0 z
1 0 0 0 1 1

You might also like