+ All Categories
Home > Documents > Mathematics for Computer Graphics

Mathematics for Computer Graphics

Date post: 18-Mar-2016
Category:
Upload: gusty
View: 33 times
Download: 0 times
Share this document with a friend
Description:
Mathematics for Computer Graphics. Lecture Summary. Matrices Some fundamental operations Vectors Some fundamental operations Geometric Primitives: Points, Lines, Curves, Polygons. 2D Modeling Transformations. Modeling Coordinates. Scale Translate. y. x. Scale Rotate Translate. - PowerPoint PPT Presentation
39
Mathematics for Computer Graphics
Transcript
Page 1: Mathematics for Computer Graphics

Mathematics for Computer Graphics

Page 2: Mathematics for Computer Graphics

Lecture Summary Matrices

Some fundamental operations

Vectors Some fundamental operations

Geometric Primitives: Points, Lines, Curves, Polygons

Page 3: Mathematics for Computer Graphics
Page 4: Mathematics for Computer Graphics

2D Modeling Transformations

ScaleRotate

Translate

ScaleTranslate

x

y

World Coordinates

ModelingCoordinates

Page 5: Mathematics for Computer Graphics

2D Modeling Transformations

x

y

World Coordinates

ModelingCoordinates

Let’s lookat this indetail…

Page 6: Mathematics for Computer Graphics

2D Modeling Transformations

x

y

ModelingCoordinates

Initial locationat (0, 0) withx- and y-axesaligned

Page 7: Mathematics for Computer Graphics

2D Modeling Transformations

x

y

ModelingCoordinates

Scale .3, .3Rotate -90

Translate 5, 3

Page 8: Mathematics for Computer Graphics

2D Modeling Transformations

x

y

ModelingCoordinates

Scale .3, .3Rotate -90

Translate 5, 3

Page 9: Mathematics for Computer Graphics

2D Modeling Transformations

x

y

ModelingCoordinates

Scale .3, .3Rotate -90

Translate 5, 3

World Coordinates

Page 10: Mathematics for Computer Graphics

Matrices A matrix is a rectangular array of elements (numbers,

expression, or function) A matrix with m rows and n columns is said to be an m-by-n

matirx ( matrix), e.g

In general, we can write an m-by-n matrix as

zyx

cbaxexe

x

x

,,,63.100.046.5

00.201.06.322

mnmm

n

n

aaa

aaaaaa

A

21

22221

11211

nm

Page 11: Mathematics for Computer Graphics

Matrices A matrix with a single row or a single column represent a vector Single row : 1-by-n matrix is a row vector

Single column : n-by-1 matrix is a column vector

A square matrix is a matrix has the same number of rows as columns

In graphics, we frequently work with two-by-two, three-by-three, and four-by-four matrices

The zero matrix The identity matrix A diagonal matrix

321V

654

V

4231

A

0000

A

1001

I

Page 12: Mathematics for Computer Graphics

Scalar Multiplication To multiply a martix A by a scalar value s, we multiply each

element amn by the scalar

Ex. , find 3A = ?

mnmm

n

n

sasasa

sasasasasasa

sA

21

22221

11211

654321

A

Page 13: Mathematics for Computer Graphics

Matrix Addition Two matrices A and B may be added together when these two

matrices have the same number of rows and column the same shape

The sum is obtained by adding corresponding elements.

Ex. , find A+B = ?

Ex. , find A+B = ?

654321

A

121110987

B

0.100.65.10.0

654221BA

Page 14: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 15: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 16: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 17: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 18: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 19: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 20: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 21: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 22: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 23: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 24: Mathematics for Computer Graphics

Matrix Multiplication

1

0

N

kkjikij bac

332211

3

2

1

321 babababbb

aaa

2222122121221121

2212121121121111

2221

1211

2221

1211

babababababababa

bbbb

aaaa

333232131

311222121

311212111

3

2

1

333231

232221

131211

bababababababababa

bbb

aaaaaaaaa

1x1 1x3 3x1

2x2 2x2 2x2

3x3 3x1 3x1

Page 25: Mathematics for Computer Graphics

Matrix Multiplication

?542

113

?1001

3241

?154

100310201

e.g.:

Page 26: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 27: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 28: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 29: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 30: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 31: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 32: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 33: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 34: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 35: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 36: Mathematics for Computer Graphics

Matrix Multiplication

15514123542

113

3241

1302031214010411

1001

3241

186

115040135140125041

154

100310201

e.g.:

Page 37: Mathematics for Computer Graphics

Warning!!! but (AB)C = A(BC)

A(B+C) = AB + AC

(A+B)C = AC + BC

(AB)T = BTAT

A(sB) = sAB

BAAB

Page 38: Mathematics for Computer Graphics

Determinant of a Matrix

Page 39: Mathematics for Computer Graphics

Matrix Inverse IAA 1


Recommended