CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is...

Preview:

Citation preview

Introduction to Computer Graphics

Dongguk University

Jeong-Mo Hong

CSE4030

Week 3• Mathematics for Computer Graphics

– Scalar, vector, point, matrix, and space

– A review on 2D graphics

Spaces• Computer graphics is concerned with the

representation and manipulation of sets of geometric elements, such as points and linesegments.

• The (linear) vector space contains only two types of objects: scalars, such as real numbers, and vectors.

• The affine space adds a third element: the point.

• Euclidean spaces add the concept of distance.

Scalars

• Ordinary real numbers and the operations on them are one example of a scalar field.

Vector Spaces

• Zero vectoru + 0 = u.

• Additive inverseu + (-u) = 0.

• Distributivityα(u + v) = αu + αv

(α + β)u = αu + βv

Geometric Vectors

• Directed line segments

Geometric Vectors

• Scalar-vector multiplication

Geometric Vectors

• Head-to-tail axiom for vectors

N-tuples of scalars

• A vector can be written as a set of scalars

v = (v1, v2, · · ·, vn)

• Vector-vector addition

u + v = (u1, u2, · · ·, un) + (v1, v2, · · ·, vn)

= (u1 + v1, u2 + v2, · · ·, un + vn)

• Scalar-vector multiplication

αv = (αv1, αv2, · · ·, αvn)

Linear Combination

• A vector can be formed by a set of other vectors

– Linear independence

– Dimension

– Basis

– Representation

Affine Spaces• A vector space lacks any geometric concepts such as

location and distance

• Coordinate system and origin

Identical vectorsCoordinate system. (a) Basis vectors located at the origin. (b) Arbitrary placement of basis vectors.

Affine Geometry

• Points and point-point subtraction

• Frame

Euclidean Spaces

• Euclidean space contains only vectors and scalars

• The inner (dot) product

u · v = v · u

(αu + βv) · w = αu · w + αv · w

v · v > 0, v ≠ 0

0 · 0 = 0

• The magnitude (length)of a vector

|v| =

• Orthogonality

u · v = 0

vv ⋅

Projections

• The concept of projection arises from the problem of finding the shortest distance from a point to a line or plane.

Projection of one vector onto another.

Break and Q&A

CSE4030

Matrices

• In computer graphics, the major use of matrices is in the representation of changes in coordinate systems and frames.

• Definitions– Matrix

– Dimensions

– Square matrix

– Transpose

– Column matrix, row matrix

Matrix Operations

• Scalar-matrix multiplication

αA = [ αaij ].

• Matrix-matrix addition

C = A + B = [ aij + bij ].

• Matrix-matrix multiplication

– Almost never commutative.

C = AB = [ cij ].

Row and Column Matrices

• We can represent either a vector or a point in three-dimensional space, with respect to some frame, as the column matrix.

• One standard mode of representing transformations of points is to use a column matrix of two, three, or four dimensions to represent a point (or vector), and a square matrix to represent a transformation of the point (or vector).

• Concatenations

Rank

• Inverse

• Nonsingular or singular

q = Ap, p = Bq

p = Bq = BAp = Ip = p

BA = I

• Number of linearly independent rows or columns

A 1−

Change of Representation

• Matrix representation of the change between two bases

Cross Product

• Given two nonparallel vectors in a three-dimensional space, the cross product gives a third vector that is orthogonal to both.

w = u x v =

−−−

1221

3113

232

βαβαβαβαβαβα 3

Week 3• Mathematics for Computer Graphics

– Scalar, vector, point, matrix, and space

– A review on 2D graphics

Reading Assignment

• Chapter 4.1~4.5

– Figures 4.13~16

– Figures 4.17~4.20

– Figure 4.23 (Why is it dangerous?)

– Figures 4.24 and 4.25

– Figure 4.26

– Figure 4.30

– Figure 4.31

Quiz

CSE4030

Recommended