Presentation is loading. Please wait.

Presentation is loading. Please wait.

©Larry F. Hodges (modified by Amos Johnson) 1 3-D Mathematical Preliminaries & Transformations.

Similar presentations


Presentation on theme: "©Larry F. Hodges (modified by Amos Johnson) 1 3-D Mathematical Preliminaries & Transformations."— Presentation transcript:

1 ©Larry F. Hodges (modified by Amos Johnson) 1 3-D Mathematical Preliminaries & Transformations

2 ©Larry F. Hodges (modified by Amos Johnson) 2 Coordinate Systems

3 ©Larry F. Hodges (modified by Amos Johnson) 3 Parametric Definition of a Line Given two points P 1 = (x 1, y 1, z 1 ), P 2 = ( x 2, y 2, z 2 ) x = x 1 + t (x 2 - x 1 ) y = y 1 + t (y 2 - y 1 ) z = z 1 + t (z 2 - z 1 ) Given a point P 1 and a vector V = [x v, y v, z v ] x = x 1 + t x v, y = y 1 + t y v, z = z 1 + t z v COMPACT FORM: L = P 1 + t[P 2 - P 1 ] or L = P 1 + Vt P1P1 P2P2 t = 1 t = 0 t > 1 t < 0

4 ©Larry F. Hodges (modified by Amos Johnson) 4 3-D Vectors Have length and directionV = [x v, y v, z v ] Length is given by the Euclidean Norm||V|| = sqrt ( x v 2 + y v 2 + z v 2 ) Dot ProductVU = [x v, y v, z v ] [x u, y u, z u ] = x v x u + y v y u + z v z u = ||V|| ||U|| cos ß Cross ProductV x U = [v y u z - v z u y, -v x u z + v z u x, v x u y - v y u x ] V x U = - ( U x V) Direction of resulting vector depends on coordinate system and order of vectors.

5 ©Larry F. Hodges (modified by Amos Johnson) 5 Derivation of Plane Equation To derive equation of the plane given three points: P 1, P 2, P 3 [ P 3 - P 1 ] x [ P 2 - P 1 ] = N, orthogonal vector Given a general point P = (x,y,z) N [P - P 1 ] = 0 if P is in the plane. Or given a point (x,y,z) in the plane and normal vector N then N [x,y,z] = -D

6 ©Larry F. Hodges (modified by Amos Johnson) 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 = sqrt(A 2 + B 2 + C 2 ) 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 point P 1 and P 2 in the plane, the vector [ P 2 - P 1 ] is in the plane and [A,B, C] [ P 2 - P 1 ] = (Ax 2 + By 2 +Cz 2 ) - (Ax 1 + B y 1 + Cz 1 ) = ( - D ) - ( - D ) = 0

7 ©Larry F. Hodges (modified by Amos Johnson) 7 Basic Transformations Translation Scale Rotation Shear

8 ©Larry F. Hodges (modified by Amos Johnson) 8 Translation in Homogeneous Coordinates [T][P] = (x + t x, y + t y, z + t z ) (100t x )(x) (010t y )(y) (001t z )(z) (0001 )(1) T P

9 ©Larry F. Hodges (modified by Amos Johnson) 9 Scale [S][P] = (s x x, s y y, s z z) (s x 000)(x) (0s y 00)(y) (00s z 0)(z) (0001)(1) Note: A scale may also translate an object!

10 ©Larry F. Hodges (modified by Amos Johnson) 10 Rotations Positive Rotations are defined as follows Axis of rotation isDirection of positive rotation is xy to z yz to x zx to y

11 ©Larry F. Hodges (modified by Amos Johnson) 11 Rotations About the z axisR z (ß) P = (cosß-sinß00)(x) (sinßcosß00)(y) (0010)(z) (0001)(1) About the x axisR x (ß) P = (1000)(x) (0cosß-sinß0)(y) (0sinßcosß0)(z) (0001)(1) About the y axis R y (ß) P = ( cosß0sinß0)(x) (0100)(y) (-sinß0cosß0)(z) (0001)(1)

12 ©Larry F. Hodges (modified by Amos Johnson) 12 Shears xy Shear SH xy P = (10sh x 0)(x) (01sh y 0)(y) (0010)(z) (0001)(1)

13 ©Larry F. Hodges (modified by Amos Johnson) 13 A Rotation Φ About An Arbitrary Axis Z P1P1 P2P2 Y X

14 ©Larry F. Hodges (modified by Amos Johnson) 14 A Rotation Φ About An Arbitrary Axis 1. Translate one end of the axis to the origin [P 2 -P 1 ] = [ u 1, u 2, u 3 ] Z P1P1 P2P2 Y X

15 ©Larry F. Hodges (modified by Amos Johnson) 15 A Rotation Φ About An Arbitrary Axis a = sqrt(u 1 2 + u 3 2 ) b = sqrt(u 1 2 + u 2 2 ) c = sqrt(u 2 2 + u 3 2 ) cosß = u 3 /a sinß = u 1 /a 1. Translate one end of the axis to the origin [P 2 -P 1 ] = [ u 1, u 2, u 3 ] Z Y X b a c u1u1 u2u2 u3u3 ß U

16 ©Larry F. Hodges (modified by Amos Johnson) 16 2. Rotate the coordinate axes about the y-axis an angle -ß After R y (-ß), U lies in the y-z plane Z Y X b a c u1u1 u2u2 u3u3 Z Y X µ u2u2 a ß U U

17 ©Larry F. Hodges (modified by Amos Johnson) 17 3. Rotate the coordinate axes about the x-axis through an angle µ to align the z-axis with U R x (µ) cos µ = a/ ||u|| U Z Y X µ U Z Y X After R x ( µ ), U lies on the z-axis

18 ©Larry F. Hodges (modified by Amos Johnson) 18 4. When U is aligned with the z- axis, apply the original rotation, Φ, about the z-axis. 5. Apply the inverses of the transformations in reverse order.

19 ©Larry F. Hodges (modified by Amos Johnson) 19 A Rotation Φ About an Arbitrary Axis R z ()][ [T -1 ][Ry(ß)][R x (-µ)][R z (Φ)][R x (µ)][R y (-ß)][T][P] Note: P = 3D Point T -1 = opposite translate from T [ ] = matrix


Download ppt "©Larry F. Hodges (modified by Amos Johnson) 1 3-D Mathematical Preliminaries & Transformations."

Similar presentations


Ads by Google