Presentation is loading. Please wait.

Presentation is loading. Please wait.

3D Coordinate Systems and Transformations Revision 1

Similar presentations


Presentation on theme: "3D Coordinate Systems and Transformations Revision 1"— Presentation transcript:

1 3D Coordinate Systems and Transformations Revision 1
3D Coordinate Systems and Transformations Revision 1.1 Copyright Zachary Wartell, University of North Carolina at Charlotte, 2006 All Rights Reserved Textbook: Chapter 5 ©Zachary Wartell 4/17/2017

2 3D Coordinate Systems ©Zachary Wartell , Larry F. Hodges 4/17/2017

3 Points & Vectors 3D affine space: points (locations), vectors (alignment with signed magnitude) operations: Points: pi - pj = v, pi + v = pj (p + 0 = p) Vectors: vi ±vj = vk , vj = a ∙ vk (a  R) length(v), |v| = dot product: vivj = ©Zachary Wartell 4/17/2017

4 Points & Vectors (cont.)
operations: vectors: cross product: vi×vj = vk ©Zachary Wartell 4/17/2017

5 Parametric Definition of a Line
Given two points p1 = (x1, y1, z1), p2 = ( x2, y2, z2) x = x1 + t (x2 - x1) y = y1 + t (y2 - y1) z = z1 + t (z2 - z1) t > 1 t = 1 t = 0 p2 t < 0 p1 Given a point p1 and a vector v = (xv, yv, zv) x = x1 + t xv, y = y1 + t yv , z = z1 + t zv COMPACT FORM: p = p1 + t [p2 - p1] or p = p1 + vt ©Zachary Wartell , Larry F. Hodges 4/17/2017

6 Equation of a plane Ax + By + Cz + D = 0
Alternate Form: A'x + B'y + C'z +D' = 0 where A' = A/d, B' = B/d, C' = C/d, D' = D/d d = Distance between a point and the plane is given by A'x + B'y + C'z +D' (sign indicates which side) Given Ax + By + Cz + D = 0 Then (A, B, C) is a normal vector Pf: Given two points p1 and p2 in the plane, the vector (p2 - p1) is in the plane and (A,B,C) • (p2 - p1) = (Ax2 + By2 +Cz2) - (Ax1 + B y1 + Cz1) = ( - D ) ( - D ) = 0 ©Zachary Wartell , Larry F. Hodges 4/17/2017

7 Derivation of Plane Equation
To derive equation of the plane given three points: p1, p2 , p3 (p3 - p1) x (p2 - p1) = n, orthogonal vector Given a general point p = (x,y,z) n • [p - p1] = 0 if p is in the plane. p Or given a point (x,y,z) in the plane and normal vector n then n • (x,y,z) = -D ©Zachary Wartell , Larry F. Hodges 4/17/2017

8 Basic Transformations
Translation Scale Rotation Shear ©Zachary Wartell 4/17/2017

9 Translation Point or vector ©Zachary Wartell 4/17/2017

10 Scale (about origin) ©Zachary Wartell 4/17/2017

11 Rotation (about coordinate axis)
Positive Rotations are defined as follows Axis of rotation is Direction of positive rotation is x y to z y z to x z x to y ©Zachary Wartell , Larry F. Hodges 4/17/2017

12 Rotations ©Zachary Wartell 4/17/2017

13 Shears XY sheared on Z y x z
Of course other combinations occur too, e.g. ZX sheared on Y, X sheared on Y, etc. ©Zachary Wartell 4/17/2017

14 Rotation About An Arbitrary Axis
p2 u Z θ p1 Y X ©Zachary Wartell 4/17/2017

15 Rotation About An Arbitrary Axis
Translate p1 to origin p2 T(-p1) u Z p1 u' Y X ©Zachary Wartell 4/17/2017

16 Rotation About An Arbitrary Axis
Rotate u' to u'' in YZ plane (rotation about Y axis, Ry(-β)) Ry(-β)) ∙ T(-p1) Z u' uz c Y a ß uy b ux X ©Zachary Wartell , Larry F. Hodges 4/17/2017

17 Rotation About An Arbitrary Axis
Rotate u' to u'' in YZ plane (rotation about Y axis, Ry(-β)) Ry(-β)) ∙ T(-p1) Z u'' u' uz c Y a ß uy b ux X ©Zachary Wartell , Larry F. Hodges 4/17/2017

18 Rotation About An Arbitrary Axis
After Ry(-ß), angle α and u'' lies in the y-z plane. Next, Rotate u'' to Z axis (u''') (rotation about X axis, Rx(α)) Rx(α) ∙ Ry(-β) ∙ T(-p1) u'' Z a c uz Y α uy ux X ©Zachary Wartell , Larry F. Hodges 4/17/2017

19 Rotation About An Arbitrary Axis
After Rx(α), u'' lies in the Z axis as u'''. Next, rotate about Z by θ (Rz(θ)) Rz(θ) ∙ Rx(α) ∙ Ry(-β) ∙ T(-p1) u''' Z u'' Y θ X ©Zachary Wartell 4/17/2017

20 Rotation About An Arbitrary Axis
Now we’ve rotated about U. Next, apply the inverse transformations to place u''' back on u p2 R((p1,p2),θ) = T(p1) ∙ Ry(β) ∙ Rx(-α) ∙ Rz(θ) ∙ Rx(α) ∙ Ry(-β) ∙ T(-p1) u Z θ p1 Y X ©Zachary Wartell 4/17/2017

21 Rotation About An Arbitrary Axis
©Zachary Wartell 4/17/2017

22 Rotation Representations So Far….
Euler angles -Rx  Ry  Rz - note order is arbitrary, 6 possible -3 real numbers -interpolation problems -gimbal lock -compose rotation matrix: 27 *’s and 18 +’s Matrix -9 real numbers -no good way to interpolate rotations Axis-Angle -4 real numbers -again unclear how to interpolate rotations -no clear way to compose rotations (must convert to matrix) ©Zachary Wartell 4/17/2017

23 Euler Angles: Gimbal Lock
 Occurs when two rotation axes are aligned by an intermediate rotation  Example: Assume Euler order Rz ∙ Ry ∙ Rx If Ry = 90 degrees, then x-axis aligns with y-axis and Rz = -Rx Z Y X' ©Zachary Wartell 4/17/2017 X

24 Rotation Matrix: Interpolation
? ©Zachary Wartell 4/17/2017

25 Axis-Angle: Composition
R(?,?) = R(uk,θk) ∙ R(uk-1,θk-1) ….. R(u1,θ1) ©Zachary Wartell 4/17/2017

26 Quaternions Alternative rotation representation: 4 real numbers
interpolation between quaternions well defined (“slerp”) no gimbal lock composition of quaternions: 16 *’s, 9+’s (matrix 27 *’s and 18 +’s) ©Zachary Wartell 4/17/2017

27 Quaternions Rotation representation:
Relation to axis-angle representation (u,θ) is: y u θ x Z ©Zachary Wartell 4/17/2017

28 Quaternion Rotation: Basic Idea
To rotate point p: represent p as quaternion: compute rotated quaternion point representation extract standard coordinate representation p' from qp' y u p' p x Z ©Zachary Wartell 4/17/2017

29 Details of Rotation How do you multiply quaternions:
How do you find inverse of quaternion: For rotations we assume unit quaternions, hence: ©Zachary Wartell 4/17/2017

30 Quaternion Rotation: Complete Equation
To rotate point p: y u p' p x Z ©Zachary Wartell 4/17/2017

31 Quaternion Rotation Examples:
Recall: We have examples: ©Zachary Wartell 4/17/2017

32 How do quaternions help?
Quaternion composition: requires 16 *’s, 12+’s while 3x3 matrix composition needs 27*’s and 18+’s No gimbal lock interpolation between two orientations using “spherical linear interpolation” (slerp) of their quaternions: -constant angular velocity -unique interpolation -interpolation that is same regardless of coordinate system used for computation ©Zachary Wartell 4/17/2017


Download ppt "3D Coordinate Systems and Transformations Revision 1"

Similar presentations


Ads by Google