3 - Homogenous Coordinates, Drawing in 3D & Perspective Flashcards
Homogenous coordinates
involve adding one dimension to the transformation matrix M, with a vector of translations added on the rightmost column of the matrix.
so (x, y) –> (x,y,1)
Transformation matrix
|x1| = |m11 m12| |x| + |tx|
|y1| |m21 m22| |y| |ty|
Transformation matrix with homogenous coordinates
|x1| = |m11 m12 tx| |x|
|y1| |m21 m22 ty| |y|
|1 | |0 0 1 | |1|
So 2d has 3 dimensions ( because you add a third coordinate while 3 has 4d)
In general, transformation matrices do not commute, but there are a few exceptions:
⦁ Rotations in 2D commute with each other (but not in 3D – see below)
⦁ Translations commute with each other
⦁ Scalings commute with each other
⦁ Shears commute with each other
different transformations do not commute
Rotation about a point
To perform a rotation around a point (as opposed to the origin):
⦁ Translate the object back to the origin – T
⦁ Rotate around the origin – R
⦁ Translate back to the original location – T-1