Download presentation
1
Affine Geometry
2
Geometric Programming
A way of handling geometric entities such as vectors, points, and transforms. Traditionally, computer graphics packages are implemented using homogeneous coordinates. We will review affine geometry and coordinate-invariant geometric programming. Because of historical reasons, it has been called “coordinate-free” geometric programming
3
Example of coordinate-dependence
Point p Point q What is the “sum” of these two positions ?
4
If you assume coordinates, …
p = (x1, y1) q = (x2, y2) The sum is (x1+x2, y1+y2) Is it correct ? Is it geometrically meaningful ?
5
If you assume coordinates, …
p = (x1, y1) (x1+x2, y1+y2) q = (x2, y2) Origin Vector sum (x1, y1) and (x2, y2) are considered as vectors from the origin to p and q, respectively.
6
If you select a different origin, …
p = (x1, y1) (x1+x2, y1+y2) q = (x2, y2) Origin If you choose a different coordinate frame, you will get a different result
7
Vector and Affine Spaces
Vector space Includes vectors and related operations No points Affine space Superset of vector space Includes vectors, points, and related operations
8
Points and Vectors Point q vector (p-q) Point p
A point is a position specified with coordinate values. A vector is specified as the difference between two points. If an origin is specified, then a point can be represented by a vector from the origin. But, a point is still not a vector in coordinate-free concepts.
9
Vector spaces A vector space consists of
Set of vectors, together with Two operations: addition of vectors and multiplication of vectors by scalar numbers A linear combination of vectors is also a vector
10
Affine Spaces An affine space consists of
Set of points, an associated vector space, and Two operations: the difference between two points and the addition of a vector to a point
11
Coordinate-Free Geometric Operations
Addition Subtraction Scalar multiplication Linear combination Affine combination
12
Addition p + w u + v v w u p u + v is a vector p + w is a point
u, v, w : vectors p, q : points
13
Subtraction p p - w p - q -w u u - v v q p u - v is a vector
p - q is a vector p - w is a point u, v, w : vectors p, q : points
14
Scalar Multiplication
scalar • vector = vector 1 • point = point 0 • point = vector c • point = (undefined) if (c≠0,1)
15
Linear Combination A linear space is spanned by a set of bases
Any point in the space can be represented as a linear combination of bases
16
Affine Combination
17
Example (p + q) / 2 : midpoint of line pq
(p + q) / 3 : Can you find a geometric meaning ? (p + q + r) / 3 : center of gravity of ∆pqr (p/2 + q/2 – r) : a vector from r to the midpoint of q and p
18
Affine Frame A frame is defined as a set of vectors {vi | i=1, …, N} and a point o Set of vectors {vi} are bases of the associate vector space o is an origin of the frame N is the dimension of the affine space Any point p can be written as Any vector v can be written as
19
Summary
20
Geometric Transformations
21
Transformations Linear transformations Rigid transformations
Local moving frame Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference frame
22
Linear Transformations
A linear transformation T is a mapping between vector spaces T maps vectors to vectors linear combination is invariant under T In 3D-spaces, T can be represented by a 3x3 matrix
23
Examples of Linear Transformations
2D rotation 2D scaling
24
Examples of Linear Transformations
2D shear Along X-axis Along Y-axis
25
Examples of Linear Transformations
2D reflection Along X-axis Along Y-axis
26
Properties of Linear Transformations
Any linear transformation between 3D spaces can be represented by a 3x3 matrix Any linear transformation between 3D spaces can be represented as a combination of rotation, shear, and scaling
27
Composing Transformations
Suppose we want, We have to compose two transformations
28
Composing Transformations
Matrix multiplication is not commutative Translation followed by rotation Translation followed by rotation
29
Composing Transformations
R-to-L : interpret operations w.r.t. fixed coordinates L-to-R : interpret operations w.r.t local coordinates (Column major convention)
30
Changing Bases Linear transformations as a change of bases
31
Changing Bases Linear transformations as a change of bases
32
Affine Transformations
An affine transformation T is an mapping between affine spaces T maps vectors to vectors, and points to points T is a linear transformation on vectors affine combination is invariant under T In 3D-spaces, T can be represented by a 3x3 matrix together with a 3x1 translation vector
33
Homogeneous Coordinates
Any affine transformation between 3D spaces can be represented by a 4x4 matrix Affine transformation is linear in homogeneous coordinates
34
Projective Spaces Homogeneous coordinates
(x, y, z, w) = (x/w, y/w, z/w, 1) Useful for handling perspective projection But, it is algebraically inconsistent !!
35
Examples of Affine Transformations
2D rotation 2D scaling
36
Examples of Affine Transformations
2D shear 2D reflection
37
Examples of Affine Transformations
2D translation
38
Examples of Affine Transformations
2D transformation for vectors Translation is simply ignored
39
Examples of Affine Transformations
3D rotation
40
Pivot-Point Rotation Rotation with respect to a pivot point (x,y)
41
Fixed-Point Scaling Scaling with respect to a fixed point (x,y)
42
Scaling Direction Scaling along an arbitrary axis
43
Properties of Affine Transformations
Any affine transformation between 3D spaces can be represented as a combination of a linear transformation followed by translation An affine transf. maps lines to lines An affine transf. maps parallel lines to parallel lines An affine transf. preserves ratios of distance along a line An affine transf. does not preserve absolute distances and angles
44
Review of Affine Frames
A frame is defined as a set of vectors {vi | i=1, …, N} and a point o Set of vectors {vi} are bases of the associate vector space o is an origin of the frame N is the dimension of the affine space Any point p can be written as Any vector v can be written as
45
Changing Frames Affine transformations as a change of frame
46
Changing Frames Affine transformations as a change of frame
47
Changing Frames In case the xyz system has standard bases
48
Rigid Transformations
A rigid transformation T is a mapping between affine spaces T maps vectors to vectors, and points to points T preserves distances between all points T preserves cross product for all vectors (to avoid reflection) In 3-spaces, T can be represented as
49
Rigid Body Rotation Rigid body transformations allow only rotation and translation Rotation matrices form SO(3) Special orthogonal group (Distance preserving) (No reflection)
50
Rigid Body Rotation R is normalized R is orthogonal
The squares of the elements in any row or column sum to 1 R is orthogonal The dot product of any pair of rows or any pair columns is 0 The rows (columns) of R correspond to the vectors of the principle axes of the rotated coordinate frame
51
3D Rotation About Arbitrary Axis
52
3D Rotation About Arbitrary Axis
Translation : rotation axis passes through the origin 2. Make the rotation axis on the z-axis 3. Do rotation 4. Rotation & translation
53
3D Rotation About Arbitrary Axis
Rotate u onto the z-axis
54
3D Rotation About Arbitrary Axis
Rotate u onto the z-axis u’: Project u onto the yz-plane to compute angle a u’’: Rotate u about the x-axis by angle a Rotate u’’ onto the z-asis
55
3D Rotation About Arbitrary Axis
Rotate u’ about the x-axis onto the z-axis Let u=(a,b,c) and thus u’=(0,b,c) Let uz=(0,0,1)
56
3D Rotation About Arbitrary Axis
Rotate u’ about the x-axis onto the z-axis Since we know both cos a and sin a, the rotation matrix can be obtained Or, we can compute the signed angle a Do not use acos() since its domain is limited to [-1,1]
57
Euler angles Arbitrary rotation can be represented by three rotation along x,y,z axis
58
Gimble Hardware implementation of Euler angles Aircraft, Camera
59
Euler Angles Rotation about three orthogonal axes 12 combinations
XYZ, XYX, XZY, XZX YZX, YZY, YXZ, YXY ZXY, ZXZ, ZYX, ZYZ Gimble lock Coincidence of inner most and outmost gimbles’ rotation axes Loss of degree of freedom
60
Euler Angles Euler angles are ambiguous
Two different Euler angles can represent the same orientation This ambiguity brings unexpected results of animation where frames are generated by interpolation.
61
Taxonomy of Transformations
Linear transformations 3x3 matrix Rotation + scaling + shear Rigid transformations SO(3) for rotation 3D vector for translation Affine transformation 3x3 matrix + 3D vector or 4x4 homogenous matrix Linear transformation + translation Projective transformation 4x4 matrix Affine transformation + perspective projection
62
Taxonomy of Transformations
Rigid Affine Projective
63
Composite Transformations
Composite 2D Translation
64
Composite Transformations
Composite 2D Scaling
65
Composite Transformations
Composite 2D Rotation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.