Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Shearing

1. Shearing in X direction
2. Shearing in Y direction
3. Shearing in Z direction
 
Consider a point object O has to be sheared in a 3D plane.
 
Let-
Initial coordinates of the object O = (Xold, Yold, Zold)
Shearing parameter towards X direction = Shx
Shearing parameter towards Y direction = Shy
Shearing parameter towards Z direction = Shz
New coordinates of the object O after shearing = (X new, Ynew, Znew)
 
Shearing in X Axis-
 
Shearing in X axis is achieved by using the following shearing equations-
Xnew = Xold
Ynew = Yold + Shy x Xold
Znew = Zold + Shz x Xold
 
In Matrix form, the above shearing equations may be represented as-
 
 
Shearing in Y Axis-
 
Shearing in Y axis is achieved by using the following shearing equations-
Xnew = Xold + Shx x Yold
Ynew = Yold
Znew = Zold + Shz x Yold
 
In Matrix form, the above shearing equations may be represented as-
 
 
Shearing in Z Axis-
 
Shearing in Z axis is achieved by using the following shearing equations-
Xnew = Xold + Shx x Zold
Ynew = Yold + Shy x Zold
Znew = Zold
 
In Matrix form, the above shearing equations may be represented as-
 

 
PRACTICE PROBLEMS BASED ON 3D SHEARING IN COMPUTER
GRAPHICS-
 
Problem-01:
 
Given a 3D triangle with points (0, 0, 0), (1, 1, 2) and (1, 1, 3). Apply
shear parameter 2 on X axis, 2 on Y axis and 3 on Z axis and find out
the new coordinates of the object.
 
Solution-
 
Given-
Old corner coordinates of the triangle = A (0, 0, 0), B(1, 1, 2), C(1,
1, 3)
Shearing parameter towards X direction (Shx) = 2
Shearing parameter towards Y direction (Shy) = 2
Shearing parameter towards Y direction (Shz) = 3
 
Shearing in X Axis-
 
For Coordinates A(0, 0, 0)
 
Let the new coordinates of corner A after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold = 0
Ynew = Yold + Shy x Xold = 0 + 2 x 0 = 0
Znew = Zold + Shz x Xold = 0 + 3 x 0 = 0
 
Thus, New coordinates of corner A after shearing = (0, 0, 0).
 
For Coordinates B(1, 1, 2)
 
Let the new coordinates of corner B after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold = 1
Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3
Znew = Zold + Shz x Xold = 2 + 3 x 1 = 5
 
Thus, New coordinates of corner B after shearing = (1, 3, 5).
 
For Coordinates C(1, 1, 3)
 
Let the new coordinates of corner C after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold = 1
Ynew = Yold + Shy x Xold = 1 + 2 x 1 = 3
Znew = Zold + Shz x Xold = 3 + 3 x 1 = 6
 
Thus, New coordinates of corner C after shearing = (1, 3, 6).
Thus, New coordinates of the triangle after shearing in X axis = A (0, 0,
0), B(1, 3, 5), C(1, 3, 6).
 
Shearing in Y Axis-
 
For Coordinates A(0, 0, 0)
 
Let the new coordinates of corner A after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Yold = 0 + 2 x 0 = 0
Ynew = Yold = 0
Znew = Zold + Shz x Yold = 0 + 3 x 0 = 0
 
Thus, New coordinates of corner A after shearing = (0, 0, 0).
 
For Coordinates B(1, 1, 2)
 
Let the new coordinates of corner B after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Yold = 1 + 2 x 1 = 3
Ynew = Yold = 1
Znew = Zold + Shz x Yold = 2 + 3 x 1 = 5
 
Thus, New coordinates of corner B after shearing = (3, 1, 5).
 
For Coordinates C(1, 1, 3)
 
Let the new coordinates of corner C after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Yold = 1 + 2 x 1 = 3
Ynew = Yold = 1
Znew = Zold + Shz x Yold = 3 + 3 x 1 = 6
 
Thus, New coordinates of corner C after shearing = (3, 1, 6).
Thus, New coordinates of the triangle after shearing in Y axis = A (0, 0,
0), B(3, 1, 5), C(3, 1, 6).
 
Shearing in Z Axis-
 
For Coordinates A(0, 0, 0)
 
Let the new coordinates of corner A after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Zold = 0 + 2 x 0 = 0
Ynew = Yold + Shy x Zold = 0 + 2 x 0 = 0
Znew = Zold = 0
 
Thus, New coordinates of corner A after shearing = (0, 0, 0).
 
For Coordinates B(1, 1, 2)
 
Let the new coordinates of corner B after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Zold = 1 + 2 x 2 = 5
Ynew = Yold + Shy x Zold = 1 + 2 x 2 = 5
Znew = Zold = 2
 
Thus, New coordinates of corner B after shearing = (5, 5, 2).
 
For Coordinates C(1, 1, 3)
 
Let the new coordinates of corner C after shearing = (X new, Ynew, Znew).
 
Applying the shearing equations, we have-
Xnew = Xold + Shx x Zold = 1 + 2 x 3 = 7
Ynew = Yold + Shy x Zold = 1 + 2 x 3 = 7
Znew = Zold = 3
 
Thus, New coordinates of corner C after shearing = (7, 7, 3).
Thus, New coordinates of the triangle after shearing in Z axis = A (0, 0,
0), B(5, 5, 2), C(7, 7, 3).
 
To gain better understanding about 3D Shearing in Computer Graphics,
Watch this Video Lecture
 
Next Article-Bezier Curves
 
Get more notes and other study material of Computer Graphics.
Watch video lectures by visiting our YouTube channel LearnVidFun.
Summary

Article Name
3D Shearing in Computer Graphics | Definition | Examples
Description
3D Shearing in Computer Graphics is a process of modifying the shape of an
object in 3D plane. Shearing Transformation in Computer Graphics Definition,
Solved Examples and Problems.
DDA Line Drawing Algorithm
Bresenham Line Drawing Algorithm
Mid Point Line Drawing Algorithm
 
Circle Drawing Algorithms
 
Mid Point Circle Drawing Algorithm
Bresenham Circle Drawing Algorithm
 
2D Transformations
 
2D Translation
2D Rotation
2D Scaling
2D Reflection
2D Shearing
 
3D Transformations
 
3D Translation
3D Rotation
3D Scaling
3D Reflection
3D Shearing
 
Curves
 
Bezier Curves

You might also like