cse4030 introduction to computer graphics · 2011-12-28 · spaces • computer graphics is...

24
Introduction to Computer Graphics Dongguk University Jeong-Mo Hong CSE4030

Upload: others

Post on 05-Apr-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Introduction to Computer Graphics

Dongguk University

Jeong-Mo Hong

CSE4030

Page 2: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Week 3• Mathematics for Computer Graphics

– Scalar, vector, point, matrix, and space

– A review on 2D graphics

Page 3: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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.

Page 4: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Scalars

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

Page 5: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Vector Spaces

• Zero vectoru + 0 = u.

• Additive inverseu + (-u) = 0.

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

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

Page 6: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Geometric Vectors

• Directed line segments

Page 7: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Geometric Vectors

• Scalar-vector multiplication

Page 8: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Geometric Vectors

• Head-to-tail axiom for vectors

Page 9: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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)

Page 10: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Linear Combination

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

– Linear independence

– Dimension

– Basis

– Representation

Page 11: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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.

Page 12: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Affine Geometry

• Points and point-point subtraction

• Frame

Page 13: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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 ⋅

Page 14: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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.

Page 15: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Break and Q&A

CSE4030

Page 16: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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

Page 17: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Matrix Operations

• Scalar-matrix multiplication

αA = [ αaij ].

• Matrix-matrix addition

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

• Matrix-matrix multiplication

– Almost never commutative.

C = AB = [ cij ].

Page 18: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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

Page 19: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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−

Page 20: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Change of Representation

• Matrix representation of the change between two bases

Page 21: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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

Page 22: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Week 3• Mathematics for Computer Graphics

– Scalar, vector, point, matrix, and space

– A review on 2D graphics

Page 23: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

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

Page 24: CSE4030 Introduction to Computer Graphics · 2011-12-28 · Spaces • Computer graphics is concerned with the representation and manipulation of sets of geometric elements, such

Quiz

CSE4030