Professional Documents
Culture Documents
Graphics
2D and 3D Transformations
Functions
f: x → y
f: R → R
f: R2 → R2
f: (x, y) → 2
Domain, co-domain and
Range
What can go into a function
is called the Domain
What may possibly come
Transformation.
Homogeneous Coordinates
Any cartesian point P(X,Y) can be converted to
homogeneous coordinates by P'(Xh, Yh, h)
Scaling
Rotation
Reflection
Shearing/Skewing
Translation
Translation moves an object to a different
Inverse translation=>
Translation
Translation
The pair (tx, ty) is called the transition vector or
shift vector. It can be written as:
x' = x + tx , y' = y + ty
Matrix representation:
P' = P+T
Translation
For example, to translate a triangle with
vertices at original coordinates (2, 4), (6, 6),
(12, 4) by tx =3, ty =6, we compute as
followings: Translate vertex (2, 4):
Inverse scaling=>
Scaling
Scaling
Class work:
its origin.
X = r cos Φ ........ (1)
Y = r sin Φ ......... (2)
Same way we can represent the point P'(X', Y') as:
X’ = r cos (Φ + θ) = r cos Φ cos θ – r sin Φ sin θ ...... (3)
Y’ = r sin (Φ + θ) = r cos Φ sin θ + r sin Φ cos θ ...... (4)
X’ = X cos θ – Y sin θ
Y’ = X sin θ + Y cos θ
Rotation
2D Rotation – In terms of homogeneous
coordinates representation
Rotation
Inverse rotation=>
Rotation
Example: rotate a triangle about the origin
●
A counter-clockwise rotation transforms one axis to
another.
x: y → z, y: z → x, z: x → y.
●
Some graphic systems use the left hand system.
3D Translation
3D Scaling
3D Rotation – w.r.t to z-axis
3D Rotation – w.r.t to y-axis
3D Rotation – w.r.t to x-axis