Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.

Similar presentations


Presentation on theme: "1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects."— Presentation transcript:

1 1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects

2 2 Geometric Objects 1.A vector space contains vectors and scalars. A vector has direction and magnitude (but not position). Vectors are denoted by u, v, w (lower case). A scalar is a real number. Scalars are denoted by  2.An affine space is an extension of the vector space to include points (positions in space). Points are denoted by P, Q, R (upper case) 3. A Euclidean space extends the linear vector space to add a measure of size or distance.

3 3 Combining entities in affine space 1.Vector-scalar multiplication |  v| = |  | |v|, where |v| is the magnitude of v The direction of  v is the same as the direction of v v2v? 2.Point-vector addition Adding a vector to a point results in another point. Q P Q + v = P v v = P - Q -0.5v?

4 4 Vector addition u = (x 1, y 1 )(x 1 is horizontal component of u, y 1 is vertical component of u.) v = (x 2, y 2 ) u+v = (x 1 +x 2, y 1 +y 2 ) u v Place the tail of v at the head of u. Draw a vector from the tail of u to the head of v.

5 5 A parametric line P(  ) = P 0 +  v P0P0 P(  ) v A line in space: Affine sums: P(  ) = Q +  v defines a line. From this we show that: P =  1 R +  2 Q where  1 +  2 = 1 If 0 <=  <= 1, then all P lie on the line between Q and R. Q R  = 0  = 1

6 6 Affine sums for more points The affine sum for three points: P =  1 P 1 +  2 P 2 +  3 P 3, where  1 +  2 +  3 = 1,  i >=0 defines all points inside triangle P 1 P 2 P 3. P1P1 P2P2 P3P3 P =  1 P 1 +  2 P 2 +... +  n P n, where  1 +  2 +...+  n = 1,  i >=0 defines all points inside convex hull around P 1 P 2... P n. The affine sum for n points: A convex hull is like shrink-wrap around all n points.

7 7 The dot product The dot product (or inner product) of two vectors is defined as follows: where  represents the angle between the two vectors. u v  Projection, w, of u onto v: w w = ?

8 8 The cross product The cross product of two linearly independent (non-parallel) vectors is a third vector that is orthogonal to both of them. u v n The direction of n is defined by the right handed coordinate system.

9 9 A parametric plane A plane in affine space can be defined in terms of two linearly independent vectors as follows: uu vv P0P0 uu vv P

10 10 Defining a coordinate system Any 3D vector, w, can be defined in terms of 3 linearly independent vectors, v 1, v 2, v 3 : v1v1 v2v2 v3v3 w  1,  2 and  3 are components of w with respect to the basis (v 1, v 2, v 3 ).

11 11 Matrix representation of vectors We can represent w as a column matrix:

12 12 Adding a point of reference Because vectors have no position, we must add a reference point to specify a coordinate frame. Choose P 0 as reference. Vectors can be written as: Points can be written as: v1v1 v2v2 v3v3 P P0P0


Download ppt "1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects."

Similar presentations


Ads by Google