Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 91.427 Computer Graphics I, Fall 2010 Geometry.

Similar presentations


Presentation on theme: "1 91.427 Computer Graphics I, Fall 2010 Geometry."— Presentation transcript:

1 1 91.427 Computer Graphics I, Fall 2010 Geometry

2 2 91.427 Computer Graphics I, Fall 2010 Objectives Introduce elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them ­in coordinate-free manner Define basic primitives ­Line segments ­Polygons

3 3 91.427 Computer Graphics I, Fall 2010 3 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Basic Elements Geometry = study of relationships among objects in n-dim space ­In computer graphics: ­interested in objects that exist in 3-dimensions Want minimum set of primitives ==> can build more sophisticated objects Will need three basic elements ­Scalars ­Vectors ­Points

4 4 91.427 Computer Graphics I, Fall 2010 Coordinate-Free Geometry Learn simple geometry ==> started with Cartesian approach ­Points at locations in space p = (x, y, z) ­Derive results by algebraic manipulations involving these coordinates Approach nonphysical ­Physically, points exist regardless of location of arbitrary coordinate system ­Most geometric results independent of coordinate system ­Example Euclidean geometry: two triangles identical if ­two corresponding sides and angle between them identical

5 5 91.427 Computer Graphics I, Fall 2010 Scalars Need three basic elements in geometry ­Scalars, Vectors, Points Scalars (def): members of sets ­can be combined by two operations ­(addition and multiplication) ­obeying some fundamental axioms ­(associativity, commutivity, inverses) Examples: ­real and complex number systems ­under ordinary rules Scalars alone have no geometric properties

6 6 91.427 Computer Graphics I, Fall 2010 Vectors Physical definition: vector = quantity with two attributes ­Direction ­Magnitude Examples include ­Force ­Velocity ­Directed line segments Most important example for graphics Can map to other types v

7 7 91.427 Computer Graphics I, Fall 2010 Vector Operations Every vector has inverse ­Same magnitude but points in opposite direction Every vector can be multiplied by scalar There is a zero vector ­Zero magnitude, undefined orientation Sum of any two vectors ==> vector ­Use head-to-tail axiom v -v vv v u w

8 8 91.427 Computer Graphics I, Fall 2010 Linear Vector Spaces Mathematical system for manipulating vectors Operations ­Scalar-vector multiplication u =  v ­Vector-vector addition: w = u + v Expressions such as v = u +2w - 3r Make sense in vector space

9 9 91.427 Computer Graphics I, Fall 2010 Vectors Lack Position These vectors are identical ­Same length and magnitude Vectors spaces insufficient for geometry ­Need points

10 10 91.427 Computer Graphics I, Fall 2010 Points Location in space Operations allowed between points and vectors ­Point-point subtraction ==> vector ­Equivalent to point-vector addition P = v + Q v = P - Q

11 11 91.427 Computer Graphics I, Fall 2010 Affine Spaces Point + a vector space Operations ­Vector-vector addition ­Scalar-vector multiplication ­Point-vector addition ­Scalar-scalar operations For any point define ­1 P = P ­0 P = 0 (zero vector)

12 12 91.427 Computer Graphics I, Fall 2010 Lines Consider all points of the form ­P(  ) = P 0 +  d ­Set of all points that pass through P 0 in direction of vector d

13 13 91.427 Computer Graphics I, Fall 2010 Parametric Form Form is known as parametric form of line ­More robust and general than other forms ­Extends to curves and surfaces Two-dimensional forms ­Explicit (slope/intercept): y = mx +h ­Implicit: ax + by + c = 0 ­Parametric: x(  ) =  x 0 + (1-  )x 1 y(  ) =  y 0 + (1-  )y 1

14 14 91.427 Computer Graphics I, Fall 2010 Rays and Line Segments If  ≥ 0 ==> P(  ) = ray leaving P 0 in direction d If use two points to define v ==> P(  ) = Q +  (R - Q) = Q +  v =  R + (1 -  )Q For 0 ≤  ≤ 1 get all points on line segment joining R and Q

15 15 91.427 Computer Graphics I, Fall 2010 Convexity Object is convex iff for any two points in object all points on line segment between these points also in object P Q Q P convex not convex

16 16 91.427 Computer Graphics I, Fall 2010 Affine Sums Consider the “sum” P =  1 P 1 +  2 P 2 +…+  n P n Can show by induction that this makes sense iff  1 +  2 +…+  n = 1 ==> have affine sum of points P 1  P 2,…, P n If, in addition,  i ≥ 0, ==> convex hull of P 1  P 2,…, P n

17 17 91.427 Computer Graphics I, Fall 2010 Convex Hull Smallest convex object containing P 1  P 2,…, P n Formed by “shrink wrapping” points

18 18 91.427 Computer Graphics I, Fall 2010 Curves and Surfaces Curves: one parameter entities of form P(  ) where the function is nonlinear Surfaces: formed from two-parameter functions P( ,  ) ­Linear functions give planes and polygons P(  ) P( ,  )

19 19 91.427 Computer Graphics I, Fall 2010 Planes Plane can be defined by a point and two vectors or by three points P( ,  ) = R +  u +  v P( ,  ) = R +  (Q - R) +  (P - Q) u v R P R Q

20 20 91.427 Computer Graphics I, Fall 2010 Triangles convex sum of P and Q convex sum of S(  ) and R for 0 ≤ ,  ≤ 1, get all points in triangle

21 21 91.427 Computer Graphics I, Fall 2010 Normals Every plane has vector n normal (perpendicular, orthogonal) From point-two vector form P( ,  ) = R +  u +  v, can use cross product to find n = u  v and equivalent form (P(  ) - P)  n = 0 u v P


Download ppt "1 91.427 Computer Graphics I, Fall 2010 Geometry."

Similar presentations


Ads by Google