290 likes | 795 Views
Homogeneous Transformation. Ref: Richard Paul Chap. 1. Notation. Vector: v Plane: P Frame: I, A Point in space: p Point p as a vector v in frame E: E v Same point as a vector w in frame H: H w. Discussion is in 3-space. Vectors. Homogeneous coordinate w. Inner (dot) product.
E N D
Homogeneous Transformation Ref: Richard Paul Chap. 1
Notation • Vector: v • Plane: P • Frame: I, A • Point in space: p • Point p as a vector v in frame E: Ev • Same point as a vector w in frame H: Hw Discussion is in 3-space
Vectors Homogeneous coordinate w Inner (dot) product Outer (cross) product [a,b,c,0]T: point at infinity
[x/w,y/w,z/w] [a/m,b/m,c/m] -d/m Planes Compared with ax+by+cz+d = 0 … Point v on a plane:
Transformation v = Hu With homogeneous coordinates, translate and rotation become linear transformations in R4
Given the transform: Q (the plane P after transformation H): Plane Equation after Transformation Proof: We require: (=0)
Example The plane P defined by these points: (0,0,2), (1,0,2), (0,1,2) is [0,0,1,-2] The transform H: Transformed points are (6,-3,7), (6,-2,7), (6,-3,8) The plane after transformation: How to compute H-1 (see next page) …
Inverse Transformation Assumption: [n o a] is orthogonal Verify:
Recall Normal Matrix • In OpenGL, normal vectors are transformed by normal matrix into eye space • Normal matrix is the inverse transpose of modelview matrix (M-T) • Normal vector and plane equation are related!
Point rotation is closely related to coordinate transformation (next page) Rotating a Point (same coordinates in new bases) x A B x’
Rotation that takes frame B to frame A Coordinate Transformation B A x
Ex: Coordinate Transform x B A
Ex: Coordinate Transform x A B
tank Coordinate Transform • Use the transformation of the tank (and its local coordinates) to find the world coordinates of specific points. glTranslatef (2,1,0); glRotatef (30,0,0,1); drawtank(); A (3,0) W • Implemented by SVL (ex: tip of tank) Vec3 X = proj (HTrans4(vec3(2,1,0))*HRot4(Vec3(0,0,1),30*3.14/180)*vec4(3,0,0,1);
Relative Transform & Frames Trans(4,-3,7) Rot(y,90) Rot(z,90)
Reference Frame (cont) The transformed vector is the same vector described w.r.t. the reference frame
Transform Equation omit superscripts
Transform Equation OA AB = OB The Problem A AB B O