CS 354R: Computer Game Technology

Similar documents
CS 378: Computer Game Technology

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

Affine transformations

Vector and Affine Math

Affine transformations

Affine transformations. Brian Curless CSE 557 Fall 2014

2D Geometric Transformations. (Chapter 5 in FVD)

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

Affine transformations

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

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

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

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

Physically Based Rendering ( ) Geometry and Transformations

15. Eigenvalues, Eigenvectors

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

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

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

Linear and affine transformations

Unit 12 Study Notes 1 Systems of Equations

Computer Graphics: 2D Transformations. Course Website:

Matrices. VCE Maths Methods - Unit 2 - Matrices

All parabolas through three non-collinear points

CS-184: Computer Graphics. Today

A Tutorial on Euler Angles and Quaternions

Eigenvectors and Eigenvalues 1

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

5. Nonholonomic constraint Mechanics of Manipulation

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

Lecture 5: 3-D Rotation Matrices.

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

The Force Table Introduction: Theory:

1 HOMOGENEOUS TRANSFORMATIONS

Transformations. Chapter D Transformations Translation

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

Graphics Example: Type Setting

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

Infinitesimal Rotations

Simultaneous Orthogonal Rotations Angle

Linear Equations in Linear Algebra

Appendix Composite Point Rotation Sequences

11.4 Polar Coordinates

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

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

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

Math Notes on sections 7.8,9.1, and 9.3. Derivation of a solution in the repeated roots case: 3 4 A = 1 1. x =e t : + e t w 2.

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

Homogeneous Transformations

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

Introduction to quaternions

Lecture 27: More on Rotational Kinematics

Mathematics of Cryptography Part I

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

Coordinates for Projective Planes

University of Waterloo Faculty of Science Math Preparedness Test September 2012

Systems of Linear Equations: Solving by Graphing

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

Why Transforms? Want to animate objects and camera Translations Rotations Shears And more.. Want to be able to use projection transforms

Math 369 Exam #1 Practice Problems

ES.1803 Topic 16 Notes Jeremy Orloff

KINEMATIC RELATIONS IN DEFORMATION OF SOLIDS

Chapter Adequacy of Solutions

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

The spatial frequency domain

The VQM-Group and its Applications

CONSERVATION OF ANGULAR MOMENTUM FOR A CONTINUUM

abc Mathematics Further Pure General Certificate of Education SPECIMEN UNITS AND MARK SCHEMES

CSC Computer Graphics

And similarly in the other directions, so the overall result is expressed compactly as,

Rigid Body Motion. Greg Hager Simon Leonard

Solutions of homework 1. 2 a) Using the stereographic projection from the north pole N = (0, 0, 1) introduce stereographic coordinates

ME 7502 Lecture 2 Effective Properties of Particulate and Unidirectional Composites

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

Mathematical Foundations of Finite State Discrete Time Markov Chains

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

Gauss and Gauss Jordan Elimination

Physics 101 Lecture 2 Vectors Dr. Ali ÖVGÜN

Triple Integrals. y x

Section 8.5 Parametric Equations

Polynomial approximation and Splines

TENSOR TRANSFORMATION OF STRESSES

Lecture 13: Forces in the Lagrangian Approach

Green s Theorem Jeremy Orloff

Geometric Image Manipulation. Lecture #4 Wednesday, January 24, 2018

Matrices. VCE Maths Methods - Unit 2 - Matrices

Eigenvalues for Triangular Matrices. ENGI 7825: Linear Algebra Review Finding Eigenvalues and Diagonalization

Finite Math - J-term Section Systems of Linear Equations in Two Variables Example 1. Solve the system

3 Polynomial and Rational Functions

4452 Mathematical Modeling Lecture 13: Chaos and Fractals

Kinematics. Félix Monasterio-Huelin, Álvaro Gutiérrez & Blanca Larraga. September 5, Contents 1. List of Figures 1.

1.2 Functions and Their Properties PreCalculus

4.3. Differentiation Rules for Sinusoidal Functions. How do the differentiation rules apply to sinusoidal functions?

Homework 5: Sampling and Geometry

A comparison of estimation accuracy by the use of KF, EKF & UKF filters

The first change comes in how we associate operators with classical observables. In one dimension, we had. p p ˆ

On Range and Reflecting Functions About the Line y = mx

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

Graphics Rendering Pipeline

8 Velocity Kinematics

APPENDIX D Rotation and the General Second-Degree Equation

Transcription:

CS 354R: Computer Game Technolog Transformations Fall 207 Universit of Teas at Austin CS 354R Game Technolog S. Abraham

Transformations What are the? Wh should we care? Universit of Teas at Austin CS 354R Game Technolog S. Abraham 2

Representation We can represent a point, p =, ), in the plane As a column vector " # As a row vector [ ] Universit of Teas at Austin CS 354R Game Technolog S. Abraham 3

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: If p is a row vector, M T goes on the right: We will use column vectors. " p = Mp # " " = # a b # c d p " = pm T [ " "]= # b d [ ] a c Universit of Teas at Austin CS 354R Game Technolog S. Abraham 4

Two-dimensional transformations Heres all ou get with a 22 transformation matri M: # " " = # a b # c d So: " = a + b " = c + d We will develop some intimac with the elements: a, b, c, and d Universit of Teas at Austin CS 354R Game Technolog S. Abraham 5

Identit Suppose we choose a = d =, b = c = 0: Gives the identit matri " 0 # 0 Doesn t move the point at all Universit of Teas at Austin CS 354R Game Technolog S. Abraham 6

Scaling Suppose b = c = 0, but let a and d take on an positive value: Gives a scaling matri: " a 0 # 0 d Provides differential non-uniform) scaling in and : 2 2 2 2 2 " 2 0 # 0 2 " 2 0 # 0 2 " = a " = d 2 Universit of Teas at Austin CS 354R Game Technolog S. Abraham 7

Reflection Suppose b = c = 0, but either a or d goes negative Consider: # 0 0 # 0 0 Universit of Teas at Austin CS 354R Game Technolog S. Abraham 8

Shear Now leave a = d = and eperiment with b Consider: " b # 0 " = + b " = " # 0 Universit of Teas at Austin CS 354R Game Technolog S. Abraham 9

Effect on unit square A general 2 2 transformation M on the unit square: " a # c " a # c b [ p q r s]= p q r s d [ ] 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 CS 354R Game Technolog S. Abraham 0

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 CS 354R Game Technolog S. Abraham

Rotation From our observations of the effect on the unit square, the matri for rotation about the origin : Thus M R = Rθ) = cosθ) sinθ) sinθ) ) cosθ) Universit of Teas at Austin CS 354R Game Technolog S. Abraham 2

Linear transformations The unit square observations tell us the 22 matri transformation implies 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 CS 354R Game Technolog S. Abraham 3

Limitations of the 22 matri A 22 linear transformation matri allows: Scaling Rotation Reflection Shearing What important operation does that leave out? Universit of Teas at Austin CS 354R Game Technolog S. Abraham 4

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. Universit of Teas at Austin CS 354R Game Technolog S. Abraham 5

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 CS 354R Game Technolog S. Abraham 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 Universit of Teas at Austin CS 354R Game Technolog S. Abraham 7

Rotation about arbitrar points Until now, we ve onl considered rotation about the origin With homogeneous coordinates, ou can specif a rotation Rq 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 steps in right to left order and multipl. Note: Transformation order is important!! Universit of Teas at Austin CS 354R Game Technolog S. Abraham 8

Universit of Teas at Austin CS 354R Game Technolog S. Abraham Basic 3-D transformations: scaling Some of the 3-D transformations are just like the 2-D ones. For eample, scaling: 9 z z " " " z # = s 0 0 0 0 s 0 0 0 0 s z 0 0 0 0 # z #

Universit of Teas at Austin CS 354R Game Technolog S. Abraham Translation in 3D 20 z z " " " z # = 0 0 t 0 0 t 0 0 t z 0 0 0 # z #

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 z θ) = ) 0 0 0) ) 0 0 0 z Use right hand rule Universit of Teas at Austin CS 354R Game Technolog S. Abraham 2

Universit of Teas at Austin CS 354R Game Technolog S. Abraham Shearing in 3D Shearing is also more complicated. Here is one eample: We call this a shear with respect to the -z plane. 22 z z " " " z # = b 0 0 0 0 0 0 0 0 0 0 0 # z #

Quaternions Mathematical notation for representing object rotation Comple planes rather than Cartesian planes Alternative to Euler angles and matrices No Gimbal lock Simpler representation Quaternion Rotation Gamasutra) Universit of Teas at Austin CS 354R Game Technolog S. Abraham 23

Quaternion Space Jeremiah van Oosten http://3dgep.com/understanding-quaternions/) Universit of Teas at Austin CS 354R Game Technolog S. Abraham 24

Notation Comple Number Notation: 4D Vector Notation: Rotate b angle ϴ about ais v : Universit of Teas at Austin CS 354R Game Technolog S. Abraham 25

Quaternion Interpolation SLERP Spherical Linear Interpolation) Equation for LERP: Equation for SLERP: SQAD Spherical and Quadrangle) Smoothl interpolate over a path of rotations cubic) Defines helper quaternion that acts as a control point Caveat: when the angular distance between p and p2 is small, sinθ) approaches zero. Must switch back to LERP. Universit of Teas at Austin CS 354R Game Technolog S. Abraham 26

Further Reading on Quaternions Understanding Quaternions Jeremiah van Oosten) http://3dgep.com/understanding-quaternions/ Rotating Objects Using Quaternions Nick Bobic) http://www.gamasutra.com/view/feature/3686/ rotating_objects_using_quaternions.php Universit of Teas at Austin CS 354R Game Technolog S. Abraham 27