Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 425/525 1 3-D Mathematical Preliminaries. CSCI 425/525 2 Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system.

Similar presentations


Presentation on theme: "CSCI 425/525 1 3-D Mathematical Preliminaries. CSCI 425/525 2 Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system."— Presentation transcript:

1 CSCI 425/525 1 3-D Mathematical Preliminaries

2 CSCI 425/525 2 Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system

3 CSCI 425/525 3 3-D Vectors Have length and directionV = [x v, y v, z v ] Length is given by the Euclidean Norm||V|| =  ( 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.

4 CSCI 425/525 4 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

5 CSCI 425/525 5 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 =  (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

6 CSCI 425/525 6 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

7 CSCI 425/525 7 Basic Transformations Translation Scale Rotation

8 CSCI 425/525 8 Translation in Homogeneous Coordinates TP = (x + t x, y + t y, z + t z ) TP

9 CSCI 425/525 9 Scale SP = (s x x, s y y, s z z) Note: A scale may also translate an object!

10 CSCI 425/525 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 CSCI 425/525 11 Rotations About the z axisR z (ß) P = About the x axisR x (ß) P = About the y axis R y (ß) P =

12 CSCI 425/525 12 Shears xy Shear SH xy P = ZZ X X Y Y

13 CSCI 425/525 13 Mapping a 4D point into R 3 If Tr is any transformation, then it is possible that the 4 th component of the point will not be 1. TrP = Tr(x,y,z,1) = (x', y', z',w) P plotted = (x'/w, y'/w, z'/w) Transformations may be appended together via matrix multiplication.

14 CSCI 425/525 14 Rotation About An Arbitrary Axis a =  (u 1 2 + u 3 2 ) b =  (u 1 2 + u 2 2 ) c =  (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 P1P1 P2P2 Y X b a c u1u1 u2u2 u3u3 ß U

15 CSCI 425/525 15 2. Rotate the coordinate axes about the y-axis an angle -ß After R y (-ß), µ lies in the y-z plane Z Y X b a c u1u1 u2u2 u3u3 Z Y X µ u2u2 a ß

16 CSCI 425/525 16 3. Rotate the coordinate axes about the x-axis through an angle µ to align the z-axis with U R x (µ) cos µ = a/ ||u|| sinµ = u 2 / ||u|| R 4. When u is aligned with the z-axis, apply the original rotation, R, about the z-axis. 5.Apply the inverses of the transformations in reverse order. Z Y X µ U

17 CSCI 425/525 17 Rotation About an Arbitrary Axis R T -1 R y (ß)R x (-µ)RR x (µ)R y (-ß)T P

18 CSCI 425/525 18 Transformation Types A transformation maps points in one coordinate system to points in another coordinate system. Rigid body transformations Do not distort shapes – line lengths and angles are preserved Rotations, Translations, and combinations of both

19 CSCI 425/525 19 Affine Transformation Properties Affine transformations –Keep parallel lines and planes parallel. Parallelograms map into oter parallelograms. –but do not necessarily preserve line lengths or angles –Preserve collinearity and “flatness” so the image of a plane or line is another plane or line. –Rotations, Translations, Scales, Shears, and combinations of these


Download ppt "CSCI 425/525 1 3-D Mathematical Preliminaries. CSCI 425/525 2 Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system."

Similar presentations


Ads by Google