CS 378: Computer Game Technology

Similar documents
CS 354R: Computer Game Technology

Reading. 4. Affine transformations. Required: Watt, Section 1.1. Further reading:

Affine transformations

Affine transformations

Vector and Affine Math

Affine transformations. Brian Curless CSE 557 Fall 2014

Reading. Affine transformations. Vector representation. Geometric transformations. x y z. x y. Required: Angel 4.1, Further reading:

Affine transformations

2D Geometric Transformations. (Chapter 5 in FVD)

Two conventions for coordinate systems. Left-Hand vs Right-Hand. x z. Which is which?

we must pay attention to the role of the coordinate system w.r.t. which we perform a tform

Unit 12 Study Notes 1 Systems of Equations

we must pay attention to the role of the coordinate system w.r.t. which we perform a tform

Computer Graphics: 2D Transformations. Course Website:

( ) ( ) ( ) ( ) TNM046: Datorgrafik. Transformations. Linear Algebra. Linear Algebra. Sasan Gooran VT Transposition. Scalar (dot) product:

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2011 Lecture 11 September 29, 2011

Graphics Example: Type Setting

Matrices. VCE Maths Methods - Unit 2 - Matrices

LESSON 35: EIGENVALUES AND EIGENVECTORS APRIL 21, (1) We might also write v as v. Both notations refer to a vector.

Graphics Rendering Pipeline

Transformations. Chapter D Transformations Translation

CS-184: Computer Graphics. Today

Systems of Linear Equations: Solving by Graphing

15. Eigenvalues, Eigenvectors

Demonstrate solution methods for systems of linear equations. Show that a system of equations can be represented in matrix-vector form.

also today: how to read a research paper CS 4300/5310 Computer Graphics

Lecture 5: 3-D Rotation Matrices.

University of Waterloo Faculty of Science Math Preparedness Test September 2012

5. Nonholonomic constraint Mechanics of Manipulation

14.1 Systems of Linear Equations in Two Variables

1 HOMOGENEOUS TRANSFORMATIONS

Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach

All parabolas through three non-collinear points

Rigid Body Transforms-3D. J.C. Dill transforms3d 27Jan99

Lecture 5. Equations of Lines and Planes. Dan Nichols MATH 233, Spring 2018 University of Massachusetts.

12.1 Systems of Linear equations: Substitution and Elimination

Some linear transformations on R 2 Math 130 Linear Algebra D Joyce, Fall 2013

Linear algebra in turn is built on two basic elements, MATRICES and VECTORS.

Matrices and Determinants

Homogeneous Transformations

Mathematics of Cryptography Part I

On Range and Reflecting Functions About the Line y = mx

Mathematics 309 Conic sections and their applicationsn. Chapter 2. Quadric figures. ai,j x i x j + b i x i + c =0. 1. Coordinate changes

Operations depend on pixel s Coordinates. Context free. Independent of pixel values. I(x,y) I (x,y )

Eigenvectors and Eigenvalues 1

The Force Table Introduction: Theory:

Engineering Mathematics I

Math 369 Exam #1 Practice Problems

Linear Algebra (2009 Fall) Chapter 1 Matrices and Systems of Equations

Matrix Theory and Differential Equations Homework 6 Solutions, 10/5/6

Chapter Adequacy of Solutions

Linear and affine transformations

REVISION SHEET FP2 (MEI) CALCULUS. x x 0.5. x x 1.5. π π. Standard Calculus of Inverse Trig and Hyperbolic Trig Functions = + = + arcsin x = +

MATRIX TRANSFORMATIONS

Vertex form of a quadratic equation

Designing Information Devices and Systems I Discussion 2A

CS 335 Graphics and Multimedia. 2D Graphics Primitives and Transformation

Introduction to Differential Equations. National Chiao Tung University Chun-Jen Tsai 9/14/2011

Physically Based Rendering ( ) Geometry and Transformations

TENSOR TRANSFORMATION OF STRESSES

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Intermediate Math Circles Wednesday November Inequalities and Linear Optimization

1.7 Inverse Functions

Matrices. VCE Maths Methods - Unit 2 - Matrices

( 7, 3) means x = 7 and y = 3. ( 7, 3) works in both equations so. Section 5 1: Solving a System of Linear Equations by Graphing

Linear Equations in Linear Algebra

Section 8.5 Parametric Equations

3D Coordinate Transformations. Tuesday September 8 th 2015

CS 112 Transformations II. Aditi Majumder, CS 112 Slide 1

Phys 221. Chapter 3. Vectors A. Dzyubenko Brooks/Cole

The choice of origin, axes, and length is completely arbitrary.

Today. CS-184: Computer Graphics. Introduction. Some Examples. 2D Transformations

Handout for Adequacy of Solutions Chapter SET ONE The solution to Make a small change in the right hand side vector of the equations

ES.1803 Topic 16 Notes Jeremy Orloff

APPENDIX D Rotation and the General Second-Degree Equation

Not for reproduction

The notes cover linear operators and discuss linear independence of functions (Boas ).

Gauss and Gauss Jordan Elimination

4 Inverse function theorem

3 Polynomial and Rational Functions

Analytic Trigonometry. Copyright Cengage Learning. All rights reserved.

Homework Notes Week 6

TABLES, GRAPHS, AND RULES

(c) cos Arctan ( 3) ( ) PRECALCULUS ADVANCED REVIEW FOR FINAL FIRST SEMESTER

M 340L CS Homework Set 1

ENR202 Mechanics of Materials Lecture 12B Slides and Notes

Mathematical Structures for Computer Graphics Steven J. Janke John Wiley & Sons, 2015 ISBN: Exercise Answers

A Tutorial on Euler Angles and Quaternions

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 2

2018 Fall 2210Q Section 013 Midterm Exam I Solution

MTH 112 Practice Test 3 Sections 3.3, 3.4, 3.5, 1.9, 7.4, 7.5, 8.1, 8.2

MATH 532, 736I: MODERN GEOMETRY

Lecture 8: Coordinate Frames. CITS3003 Graphics & Animation

Math 51, Homework-2. Section numbers are from the course textbook.

11.4 Polar Coordinates

CSE4030 Introduction to Computer Graphics

Math 4377/6308 Advanced Linear Algebra

Section A Solving Absolute Value Inequalities

6. Linear transformations. Consider the function. f : R 2 R 2 which sends (x, y) (x, y)

Strain Transformation and Rosette Gage Theory

Transcription:

CS 378: Computer Game Technolog 3D Engines and Scene Graphs Spring 202 Universit of Teas at Austin CS 378 Game Technolog Don Fussell

Representation! We can represent a point, p =,), in the plane! as a column vector! as a row vector [ ] Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 2

Representation, cont.! We can represent a 2-D transformation M b a matri M = a b c d! If p is a column vector, M goes on the left: p = Mp = a b c d! If p is a row vector, M T goes on the right:! We will use column vectors. p = pm T [ ] = [ ] a c Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 3 b d

Two-dimensional transformations! Heres all ou get with a 2 2 transformation matri M: = a b c d! So: = a + b = c + d! We will develop some intimac with the elements a, b, c, d Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 4

Identit! Suppose we choose a=d=, b=c=0:! Gives the identit matri: 0 0! Doesnt move the points at all Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 5

Scaling! Suppose b=c=0, but let a and d take on an positive value:! Gives a scaling matri: a 0 0 d 2 2! Provides differential non-uniform) scaling in and : 2 2 2 0 0 2 = a = d 2 2 2 0 0 2 Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 6

Reflection! Suppose b=c=0, but let either a or d go negative.! Eamples: 0 0 0 0 Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 7

Shear! Now leave a=d= and eperiment with b! The matri b 0 gives: = + b = 0 Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 8

Effect on unit square! Lets see how a general 2 2 transformation M affects the unit square: a c a c b p q r s d [ ] = [ p q r s ] b 0 0 = 0 a a + b b d 0 0 0 c c + d d s r p q Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 9

Effect on unit square, cont.! Observe:! Origin invariant under M! M can be determined just b knowing how the corners,0) and 0,) are mapped! a and d give - and -scaling! b and c give - and -shearing Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 0

Rotation! From our observations of the effect on the unit square, it should be eas to write down a matri for rotation about the origin : cosθ) 0 sinθ) 0 sinθ) cosθ) Thus M R = Rθ) = cosθ) sinθ) sinθ) ) cosθ) Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell

Linear transformations! The unit square observations also tell us the 22 matri transformation implies that we are representing a point in a new coordinate sstem: p = Mp = a b c d [ ] = u v! where u=[a c] T and v=[b d] T are vectors that define a new basis for a linear space.! The transformation to this new basis a.k.a., change of basis) is a linear transformation. = u + v Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 2

Limitations of the 2 2 matri! A 2 2 linear transformation matri allows! Scaling! Rotation! Reflection! Shearing! Q: What important operation does that leave out? Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 3

Affine transformations! In order to incorporate the idea that both the basis and the origin can change, we augment the linear space u, v with an origin t.! Note that while u and v are basis vectors, the origin t is a point.! We call u, v, and t basis and origin) a frame for an affine space.! Then, we can represent a change of frame as: p = u + v + t! This change of frame is also known as an affine transformation.! How do we write an affine transformation with matrices? Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 4

Homogeneous Coordinates! To represent transformations among affine frames, we can loft the problem up into 3-space, adding a third component to ever point: p = Mp a b t = c d t 0 0 = [ u v t] = u + v + t! Note that [a c 0] T and [b d 0] T represent vectors and [t t ] T, [ ] T and [ ] T represent points. Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 5

Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 6 Homogeneous coordinates This allows us to perform translation as well as the linear transformations as a matri operation: p = M T p = 0 t 0 t 0 0 = + t = + t 0 0 2 0 0

Rotation about arbitrar points Until now, we have onl considered rotation about the origin. With homogeneous coordinates, ou can specif a rotation, R q, about an point q = [q q ] T with a matri: q θ. Translate q to origin 2. Rotate 3. Translate back Line up the matrices for these step in right to left order and multipl. Note: Transformation order is important!! Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 7

Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 8 Basic 3-D transformations: scaling Some of the 3-D transformations are just like the 2-D ones. For eample, scaling: = s 0 0 0 0 s 0 0 0 0 s 0 0 0 0

Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 9 Translation in 3D = 0 0 t 0 0 t 0 0 t 0 0 0

Rotation in 3D Rotation now has more possibilities in 3D: 0 0 0 ) 0 cosθ) sinθ) 0 R θ) = ) 0 sinθ) cosθ) 0) ) 0 0 0 cosθ) 0 sinθ) 0 ) 0 0 0 R θ) = ) sinθ) 0 cosθ) 0) ) 0 0 0 cosθ) sinθ) 0 0 ) sinθ) cosθ) 0 0 R θ) = ) 0 0 0) ) 0 0 0 R R R Use right hand rule Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 20

Universit of Teas at Austin CS384G - Computer Graphics Fall 200 Don Fussell 2 Shearing in 3D! Shearing is also more complicated. Here is one eample:! We call this a shear with respect to the - plane. = b 0 0 0 0 0 0 0 0 0 0 0