Top Banner
Math Review Intro to Computer Graphics © 2020 Enrique Rosales
24

Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Mar 05, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Math Review

Intro to Computer Graphics

© 2020 Enrique Rosales

Page 2: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Learning goals

© 2020 Enrique Rosales

Intro to Computer Graphics

• Vectors

• Dot product

• Cross product

• Difference between vectors and points

• Bivectors

• Trivectors

• Matrices

• Coding example

Page 3: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Notation

© 2020 Enrique Rosales

Intro to Computer Graphics

Real-time rendering by Tomas Akenine-Moller [et. al.] page 5

Page 4: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

What is a Vector?

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 5: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

It depends of who is asking

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 6: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

What is a Vector?It depends of who is asking

© 2020 Enrique Rosales

Intro to Computer Graphics

• Programming

• Mathematical

• Geometric

Page 7: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Programming perspective

© 2020 Enrique Rosales

Intro to Computer Graphics

Data

It is a n-tuple of real numbers

𝑎 = 𝑎1, 𝑎2, … , 𝑎𝑛

Page 8: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Mathematical perspective

© 2020 Enrique Rosales

Intro to Computer Graphics

This data is a matrix

𝑎𝑇 = 𝑎𝑥 , 𝑎𝑦 , 𝑎𝑧𝑎 =

𝑎𝑥𝑎𝑦𝑎𝑧

Page 9: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Geometric perspective

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 10: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Geometric interpretationLinear Algebra

© 2020 Enrique Rosales

Intro to Computer Graphics

• Position

• Vector (a direction with a magnitude)

Page 11: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Geometric interpretationGeometric Algebra

© 2020 Enrique Rosales

Intro to Computer Graphics

• Position

• Vector (Directed length)

• Bivector (Directed area)

• Trivector (Directed volume)

Page 12: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Dot Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Measures the similarity of two vectors

𝑎𝑏 =

𝑖=1

𝑛

𝑎𝑖𝑏𝑖

Page 13: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Dot Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Measures the similarity of two vectors

𝑎𝑏 =

𝑖=1

𝑛

𝑎𝑖𝑏𝑖

𝑎𝑏 = 𝑎𝑥𝑏𝑥 + 𝑎𝑦𝑏𝑦 + 𝑎𝑧𝑏𝑧

Page 14: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Cross Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Measures the difference of two vectors

𝑎 × 𝑏 = 𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦 , 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥

𝑎

𝑏𝑑

Page 15: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Cross Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 16: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Cross Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 17: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Cross Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Page 18: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

© 2020 Enrique Rosales

Intro to Computer Graphics

Wedge Product

Bivector

(directed area)

(Geometric Algebra)

𝑎𝑏 = 𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦 , 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥

Page 19: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Cross Product / Wedge Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Bivector

Page 20: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Wedge Product

© 2020 Enrique Rosales

Intro to Computer Graphics

𝑎

𝑏𝑐

𝑎𝑏𝑐

(Geometric Algebra)

Page 21: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Wedge Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Trivector

(directed volume)

𝑎

𝑏

𝑐𝑎𝑏𝑐

(Geometric Algebra)

Page 22: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Wedge Product

© 2020 Enrique Rosales

Intro to Computer Graphics

Trivector

(directed volume)

𝑎𝑏𝑐

(Geometric Algebra)

Page 23: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Colum vectors or Row vectors?

© 2020 Enrique Rosales

Intro to Computer Graphics

𝑎𝑇 = 𝑎𝑥 , 𝑎𝑦 , 𝑎𝑧𝑎 =

𝑎𝑥𝑎𝑦𝑎𝑧

Chapters 4 and 5 (Vectors)

Chapter 7 (Matrices)

3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry

Page 24: Math Review - University of British Columbia3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry Thanks Enrique Rosales Title Shading Models Author enrique

Thanks

Enrique Rosales