UNIT 5
Unit 5: 2D and 3D Transformations and Projections
2D Transformation:- It means changing the position, size and orientation of 2D Object on a float surface.
3D Transformation:- It is a changing the position, orientation, size or shape of 3D Object using Mathematical operations.
Types of 2D & 3D:-
1. Translation- Moving object from one place to another.
2. Scaling- Either increase or decrease size of object.
3. Rotation- Turning the object around the point.
4. Shearing- Slanting the object.
Translation:- It means shifting the object from one position to another position without changing its shape, size and orientation.
x’ = x + tx (tx = Translation on X-axis)
y’ = y + ty (ty = Translation on Y-axis)
Scaling:- It is a 2D Transformation used to change the size of an object. It can increase / decrease size of object horizontally, vertically or both.
x’ = x . Sx (Sx = Scaling factor on X-axis)
y’ = y . Sy (Sy = Scaling factor on Y-axis)
What Scaling does?
If Sx > 1 : stretches obj. horizontally
If Sy > 1 : stretches obj. vertically
If Sx < 1 or Sy < 1 : obj. shrink
If Sx = Sy : obj. grows/shrink uniformly
If Sx =/ Sy : obj. becomes stretched uniformly
Rotation:- It is a 2D Transformation used to turn an object around a fixed point by some angle. It changes orientation of object but doesn’t change its size or shape.
Rotation about origin:-
x’ = xcos - ysin
y’ = xsin + ycos
Rotation about arbitrary point:-
For counterclockwise rotation about point (xc, yc), 3 steps are needed:
Translation to move (xc, yc) to origin
T1 = [1 0 0][0 1 0][-xc -yc 1]
Rotation of obj. through angle
R = [ 0][- cos 0][0 0 1]
Translation to move center point to its correct position
T2 = [1 0 0][0 1 0][xc yc 1]
Combined Transformation matrix = T1RT2 =
[1 0 0][0 1 0][-xc -yc 1] [ 0][- cos 0][0 0 1] [1 0 0][0 1 0][xc yc 1]
= [1 0 0][0 1 0][-xc -yc 1] [ 0][- cos 0][xc yc 1]
=> [ 0][- cos 0][-xc+yc+xc -xc-yccos+yc 1]
Shearing:- It is a transformation that slants the shape of the object.
Two common shearing transformation :
x coordinate value
y coordinate value
1] X-shear:-
X-shear preserves y-coordinate, but changes x-value which causes vertical lines to tilt right/left.
xnew = xold + Shx . yold
ynew = yold
2] Y-shear:-
Y-shear preserves x-coordinate, but changes y-value which causes horizontal lines to transform lines which slope up/down.
xnew = xold
ynew = yold + Shy . xold
Just go through this:-
Translation
2D: Moves an object by adding translation distances (tx,ty) to original coordinates: x′=x+tx and y′=y+ty.
3D: Extends this to three dimensions by adding tz to the z-coordinate: x′=x+tx, y′=y+ty, z′=z+tz.
Rotation
2D: Rotates an object around a pivot point by an angle θ. To rotate around an arbitrary point, one must translate the point to the origin, rotate, and translate it back.
3D: Rotates about an axis (X, Y, or Z) using specific rotation matrices. Arbitrary axis rotation requires a sequence: translate the axis to the origin, rotate to align with a coordinate axis, rotate by the desired angle, and reverse the initial alignment and translation.
Scaling
2D: Resizes an object by multiplying coordinates by scaling factors sx and sy: x′=x⋅sx and y′=y⋅sy. Scaling around an arbitrary fixed point requires translating the point to the origin, scaling, and translating back.
3D: Adds a z-axis scaling factor sz: x′=x⋅sx, y′=y⋅sy, z′=z⋅sz. This expands or compresses the object's volume.
Shearing
2D: Distorts the shape by slanting coordinates along an axis. For x-axis shearing, x′=x+y⋅shx while y remains unchanged.
3D: Slants the object in 3D space, affecting coordinates based on multiple axes (e.g., x′=x+shxyY+shxzZ). This is often used for perspective projections.
enough now start next topic.
Projections:-
It is the process of converting 3D object into 2D object.
Parallel
Orthographic :- 1. Isometric , 2. Dimetric , 3. Trimetric
Oblique :- 1. Cavalier , 2. Cabiner
Perspective
One point
Two point
Three point
Parallel:-
It is a type of projection in which all projection lines r parallel to each other & center of projection is considered to be at infinity. View is less realistic.
a) Orthographic:-
In this, all projection lines r perpendicular(90’) to projection plane.
i. Isometric:
All 3 areas are equally foreshortened.
Angles between axes are 120’ each.
ii. Dimetric:
2 axes have equal foreshortening, third is different.
Axes have unequal angles.
iii. Trimetric:
All 3 angles are foreshortened.
All 3 angles are different.
b) Isometric:-
In this, projection lines are not perpendicular to the projection plane.Instead they meet plane at an angle (often 30,45).
i. Cavalier:
Depth axis is drawn at full scale (100% depth).
Receding lines are usually drawn at 45' to projection plane.
ii. Cabinet:
Depth axis is drawn at half scale (50% depth).
Receding lines are also drawn at an angle 30' or 45’
Perspective:-
All projection lines converge at a finite point called centre of projection.
i. One point:
Occurs when projection plane is perpendicular to one principal axis. Also called, Parallel perspective.
ii. Two point:
Occurs when projection plane intersects two principal axes. Also called, Angular perspective.
iii. Three point:
Occurs when projection plane intersects three principal axes. Also called, Oblique perspective.