Download presentation
Presentation is loading. Please wait.
Published byClaribel Dalton Modified over 9 years ago
1
Geometry CSC 2141 Introduction to Computer Graphics
2
Objectives Basic geometric problems are fundamental to computer graphics, and we will present tools to answer these sorts of questions Geometric intersections Transformation Change of coordinates Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among them in a coordinate-free manner
3
Basic Elements Geometry is the study of the relationships among objects in an n- dimensional space In computer graphics, we are interested in objects that exist in three dimensions We will need three fundamental types Scalars Vectors Points
4
Coordinate-Free Geometry When we learned simple geometry, most of us started with a Cartesian approach Points were at locations in space p=(x,y,z) We derived results by algebraic manipulations involving these coordinates This approach was nonphysical Physically, points exist regardless of the location of an arbitrary coordinate system Most geometric results are independent of the coordinate system Example Euclidean geometry: two triangles are identical if two corresponding sides and the angle between them are identical
5
Scalars Scalars can be defined as members of sets which can be combined by two operations (addition and multiplication) obeying some fundamental axioms (associativity, commutivity) Examples include the real and complex number systems under the ordinary rules with which we are familiar Scalars alone have no geometric properties
6
Vectors Physical definition: a vector is a quantity with two attributes Direction Magnitude Examples include Force Velocity Directed line segments = vector Most important example for graphics v
7
Vector Operations Every vector has an inverse Same magnitude but points in opposite direction Every vector can be multiplied by a scalar changing its magnitude There is a zero vector Zero magnitude, undefined orientation The sum of any two vectors is a vector Use head-to-tail axiom Subtraction of vectors: v-u = v + (-u) v -v vv v u w
8
Linear Vector Spaces Mathematical system for manipulating vectors Involve only scalars and vectors Combine scalars and vectors to form new ones Operations Scalar-vector multiplication u = v Vector-vector addition: w = u + v Expressions such as v=u+2w-3r Make sense in a vector space
9
Vectors Lack Position These vectors are identical Same length and magnitude “free vectors” Vector spaces insufficient for geometry Need points
10
Points Location in space Operations allowed between points and vectors Point-point subtraction yields a vector Equivalent to point-vector addition P=v+Q v=P-Q Directed from P to Q Is defined to be translation of Q by displacement v
11
Affine Spaces Point + a vector space Manipulates scalars, vectors and points Operations Vector-vector addition (vector-vector subtraction) Scalar-vector multiplication (vector-scalar division) Point-vector addition (point-vector subtraction) Point-point subtraction Scalar-scalar operations For any point define 1 P = P 0 P = 0 (zero vector)
12
Lines Consider all points of the form P( )=P 0 + d Set of all points that pass through P 0 in the direction of the vector d Called “parametric form” Line: infinitely long in both directions
13
Rays and Line Segments If >= 0, then P( ) is the ray leaving P 0 in the direction d If we use two points to define v, then P( ) = Q + (R-Q)=Q+ v = R + (1- )Q For 0<= <=1 we get all the points on the line segment joining R and Q Ray: infinitely long in one direction Line segment: finite
14
Affine and Convex Sums (combinations) In general, we define the following two operations for points in affine space. Consider the “sum” P= 1 P 1 + 2 P 2 +…..+ n P n This sum makes sense iff 1 + 2 +….. n =1 in which case we have the affine sum of the points P 1 P 2,…..P n If, in addition, i >=0, we have the convex sum (combination) of P 1 P 2,…..P n
15
Planes A 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
16
Triangles convex sum of P and Q convex sum of S( ) and R for 0<= , <=1, we get all points in triangle
17
Normals Every plane has a vector n normal (perpendicular, orthogonal) to it From point-two vector form P( , )=R+ u+ v, we know we can use the cross product to find n = u v and the plane equation is (P( )-P) n=0 u v P
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.