Lecture Notes 4: Affine Transformations and 3D Transformations
Review of Affine Transformations
Affine transformations have limitations when combined.
Homogeneous coordinates provide a solution to approximate linear transformations.
This involves representing transformations (including translation) using a single matrix.
The input vector's dimension increases by one (e.g., 2D becomes 3D).
Matrix multiplications are efficient for transformations.
Examples of Transformations with Homogeneous Coordinates
Rotation, scaling, and shear transformations.
Translation is represented by a specific matrix.
Examples of Combining Transformations
Rotation followed by Translation
If is the rotation matrix and is the translation matrix, then rotation followed by translation is represented as , where is the input.
The resulting matrix combines rotation and translation parameters.
Rotation followed by Shear
Rotation is applied first, then shear.
Order matters because changing the order can yield different results.
Translation followed by Rotation
The result differs from rotation followed by translation.
Translation followed by rotation is not the same as rotation followed by translation.
Reason for the Difference
Rotation is performed around the origin by default.
Translation shifts the origin, so subsequent rotation occurs around a new point.
Commutativity of Transformations
If , transformations are commutative.
Translation and rotation are generally not commutative.
However, translation followed by translation or rotation followed by rotation are commutative.
Properties of Transformations
Rotations in 2D commute.
Translations commute.
Scaling commutes.
Shear transformations commute.
In general, transformations are not always commutative
Rotation Around an Arbitrary Point
To rotate a shape around its center (not the origin):
Translate the shape so that the center is at the origin.
Perform the rotation.
Translate the shape back to its original position.
This involves , where is the translation matrix, is the rotation matrix, and translation inverse.
Applying Transformations to Primitives
Line Segment
Defined by two points.
Apply the transformation to both points.
Rectangle
Defined by two opposite corner points.
Apply the transformation to these two points.
This works because affine transformations preserve parallel lines and straight lines.
3D Transformations
Include scaling, translation, and rotation.
Also involve the pinhole model, perspective projection, and viewpoint transformation.
Homogeneous Coordinates in 3D
3D coordinates become 4D in homogeneous form.
Linear transformations use 3x3 matrices.
Affine transformations use 4x4 matrices.
Scaling and Translation in 3D
Translation: , , for three dimensions.
Scaling: Factors for x, y, and z directions.
Rotation in 3D
More complex due to axis and order of rotation.
Rotation around x, y, and z axes.
Order matters; rotations do not commute.
Rotation Around Z-Axis:
Similar to 2D rotation in the x-y plane.
Rotation Around X-Axis:
The y-z plane is rotated
Rotation Around Y-Axis:
Uses similar parameters but in different matrix positions.
The matrix element at will be equal to one.
Rotation and Inverse Rotation
Inverse rotation reverses the effect of the original rotation.
Mathematically, if is the rotation matrix, the inverse is .
Geometrically, rotating by degrees and then by degrees.
Properties of Rotation Matrices
Orthogonal matrices: , where is the identity matrix.
Transpose is faster to compute than the inverse.
Rotation Around an Arbitrary Vector
Rotate the vector to align with the x-axis, rotate, and then reverse the rotation.
Rotate the vector to align with the y-axis, rotate, and then reverse the rotation.
Multiple rotation and inverse rotations are required which makes this approach complicated.
Rodrigues' Rotation Formula
Alternative mathematical approach.
Rotation around vector , where is a unit vector.
Uses sine and cosine of the angle.
Involves cross product and dot product of vectors.
Normals and Transformations
Definition of Normal
A vector perpendicular to the surface at a point.
Changes with curvature.
Transformation of Normals
If a transformation is applied.
The new normal is calculated as .
Important for non-uniform scaling.
Proof (Key Points)
If two vectors are perpendicular, their dot product is zero.
The dot product of A and B can be written as .
Transformation: .
The new transformed normal equals to .
Lecture Summary
Modeling linear transformations.
Overcoming the complication of combining multiple affine transformations in 2D using Homogeneous coordinates.
3D transformations.
Rotation around x, y, z axes or a random vector.