Docsity

Geometric Objects - Introduction to Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Geometric Objects - Introduction to Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Geometric Objects in Computer

Graphics

Time for some math

  • Today we’re going to review some of the basic mathematical constructs used in computer graphics - Scalars - Points - Vectors - Matrices - Other stuff (rays, planes, etc.)

Points

  • A point is a list of n numbers referring to a location in n-D
  • The individual components of a point are often referred to as coordinates - i.e. (2, 3, 4) is a point in 3-D space - This point’s x-coordinate is 2, it’s y-coordinate is 3, and it’s z-coordinate is 4

Vectors

  • A vector is a list of n numbers referring to a direction (and magnitude) in n-D - i.e.
  • N.B. - From a data structures perspective, a vector looks exactly the same as a point - This will be important later

Rays

  • Let a ray be defined by point p and vector d
  • The parametric form of a ray expresses it as a function as some scalar t, giving the set of all points the ray passes through: - r (t) = p + t d , 0 ≤ t ≤∞

Vectors

  • We said that a vector encodes a direction and a magnitude in n-D - How does it do this?
  • Here are two ways to denote a vector in 2- D:

Normalized Vectors

  • Most of the time, we want to deal with normalized, or unit, vectors
  • This means that the magnitude of the vector is 1:
  • We can normalize a vector by dividing the vector by its magnitude: - N.B. The ‘^’ denotes a normalized vector

V =

^

Question

  • Are these two vectors the same?
    • (x,y) != (0,0) (0,0) (5,5) (x,y) (x+5,y+5)

• A: Yes and no

• They are the same displacement

vectors, which is what we will normally care about Docsity.com

Vector Scaling

  • Vectors are closed under multiplication with a scalar - Scalar * Vector = Vector Vector Scaling

Properties of Vector Addition &

Scaling

Addition is Commutative Addition is Associative Scaling is Commutative and Associative Scaling and Addition are Distributive

Linear Interpolation

  • Can define a point in terms of 2 other points and a scalar - Given points P , R , Q and a scalar a - P = a R + (1 - a) Q - How does this work? - It’s really P = Q + a V » V = R - Q - Point + Vector = Point

Vector Multiplication?

  • What does it mean to multiply two vectors? - Not uniquely defined
  • Two product operations are commonly used: - Dot (scalar, inner) product - Result is a scalar - Cross (vector, outer) product - Result is a new vector

Properties of Vector Dot Products

Commutative Associative with Scaling Distributive with Addition

Perpendiculars and Projections