CS-184: Computer Graphics. Today

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

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

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

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

Affine transformations

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

CS 378: Computer Game Technology

Affine transformations. Brian Curless CSE 557 Fall 2014

Computer Graphics: 2D Transformations. Course Website:

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

Graphics Example: Type Setting

Affine transformations

MATRIX TRANSFORMATIONS

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

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

1 HOMOGENEOUS TRANSFORMATIONS

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

CS 354R: Computer Game Technology

Matrices. VCE Maths Methods - Unit 2 - Matrices

Matrices. VCE Maths Methods - Unit 2 - Matrices

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

Affine transformations

Image Registration Lecture 2: Vectors and Matrices

2D Geometric Transformations. (Chapter 5 in FVD)

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

Linear Algebra Review Part I: Geometry

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Linear Algebra & Geometry why is linear algebra useful in computer vision?

15. Eigenvalues, Eigenvectors

Identifying second degree equations

Transformations. Chapter D Transformations Translation

Vector and Affine Math

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

Physically Based Rendering ( ) Geometry and Transformations

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

Noncommuting Rotation and Angular Momentum Operators

Eigenvectors and Eigenvalues 1

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

ES.1803 Topic 16 Notes Jeremy Orloff

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

Review of Linear Algebra

k is a product of elementary matrices.

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

Lecture 27: More on Rotational Kinematics

Numerical Methods for Inverse Kinematics

Linear Algebra Review. Fei-Fei Li

1 Planar rotations. Math Abstract Linear Algebra Fall 2011, section E1 Orthogonal matrices and rotations

Geometry review, part I

Introduction to Data Mining

Section 3.1. ; X = (0, 1]. (i) f : R R R, f (x, y) = x y

ANSWERS (5 points) Let A be a 2 2 matrix such that A =. Compute A. 2

Chapter 2 Notes, Linear Algebra 5e Lay

Linear and affine transformations

Chapter 6: Inverse Trig Functions

Chapter 2. Matrix Arithmetic. Chapter 2

Unit 12 Study Notes 1 Systems of Equations

12.1 Systems of Linear equations: Substitution and Elimination

1 Linearity and Linear Systems

CS 143 Linear Algebra Review

Review of linear algebra

Roberto s Notes on Integral Calculus Chapter 3: Basics of differential equations Section 3. Separable ODE s

Outline. MA 138 Calculus 2 with Life Science Applications Linear Maps (Section 9.3) Graphical Representation of (Column) Vectors. Addition of Vectors

A Tutorial on Euler Angles and Quaternions

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

Lines and points. Lines and points

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

Structure of Earth Materials

Linear Algebra Review. Vectors

Conceptual Questions for Review

x y plane is the plane in which the stresses act, yy xy xy Figure 3.5.1: non-zero stress components acting in the x y plane

FACULTY OF MATHEMATICAL STUDIES MATHEMATICS FOR PART I ENGINEERING. Lectures AB = BA = I,

Midterm Solutions. EE127A L. El Ghaoui 3/19/11

ES.182A Topic 41 Notes Jeremy Orloff. 41 Extensions and applications of Green s theorem

All parabolas through three non-collinear points

UNCORRECTED SAMPLE PAGES. 3Quadratics. Chapter 3. Objectives

1 = I I I II 1 1 II 2 = normalization constant III 1 1 III 2 2 III 3 = normalization constant...

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

Math 123 Summary of Important Algebra & Trigonometry Concepts Chapter 1 & Appendix D, Stewart, Calculus Early Transcendentals

STATICS. Equivalent Systems of Forces. Vector Mechanics for Engineers: Statics VECTOR MECHANICS FOR ENGINEERS: Contents & Objectives.

Question: Given an n x n matrix A, how do we find its eigenvalues? Idea: Suppose c is an eigenvalue of A, then what is the determinant of A-cI?

Roger Johnson Structure and Dynamics: The 230 space groups Lecture 3

The Force Table Introduction: Theory:

Mathematics for Graphics and Vision

15. Polarization. Linear, circular, and elliptical polarization. Mathematics of polarization. Uniaxial crystals. Birefringence.

Introduction to Differential Equations

Vectors Primer. M.C. Simani. July 7, 2007

M. Matrices and Linear Algebra

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

Mechanics Physics 151

Vectors and the Geometry of Space

10.2 The Unit Circle: Cosine and Sine

A matrix over a field F is a rectangular array of elements from F. The symbol

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

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

Lecture 3: Matrix and Matrix Operations

Simultaneous Orthogonal Rotations Angle

Vectors in Two Dimensions

Strain Transformation and Rosette Gage Theory

and let s calculate the image of some vectors under the transformation T.

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

Transcription:

CS-184: Computer Graphics Lecture #3: 2D Transformations Prof. James O Brien Universit of California, Berkele V2006-S-03-1.0 Toda 2D Transformations Primitive Operations Scale, Rotate, Shear, Flip, Translate Homogenous Coordinates SVD Start thinking about rotations... 2

Introduction Transformation: An operation that changes one configuration into another For images, shapes, etc. A geometric transformation maps positions that define the object to other positions Linear transformation means the transformation is defined b a linear function... which is what matrices are good for. 3 Some Eamples Uniform Scale Original Rotation Images from Conan The Destroer, 1984 Shear Nonuniform Scale 4

Mapping Function f () = in old image c() = [195,120,58] c = c( f ()) 5 Linear -vs- Nonlinear Linear (shear) Nonlinear (swirl) 6

Geometric -vs- Color Space Color Space Transform (edge finding) Linear Geometric (flip) 7 Instancing M.C. Escher, from Ghostscript 8.0 Distribution RHW 8

Instancing Reuse geometric descriptions Saves memor RHW 9 Linear is Linear Polgons defined b points Edges defined b interpolation between two points Interior defined b interpolation between all points Linear interpolation 10

Linear is Linear Composing two linear function is still linear Transform polgon b transforming vertices Scale 11 Linear is Linear Composing two linear function is still linear Transform polgon b transforming vertices f () = a + b g( f ) = c + d f g() = c + d f () = c + ad + bd g() = a + b 12

Points in Space Represent point in space b vector in Relative to some origin Relative to some coordinate aes Later we ll add something etra... p = [4,2] T 2 R n 4 Origin, 0 13 Basic Transformations Basic transforms are: rotate, scale, and translate Shear is a composite transformation Uniform/isotropic Non-uniform/anisotropic Rotate Scale Translate Shear -- not reall basic 14

Linear Functions in 2D = f (,) = c 1 + c 2 + c 3 = f (,) = d 1 + d 2 + d 3 [ ] [ ] [ ] [ t M M = + t M M ] = t + M 15 Rotations & Cos( ( ) ' Sin ( )# p ' = $ p % Sin ( ) Cos( ( ) " Rotate 45 degree rotation.707 -.707.707.707 16

Rotations Rotations are positive counter-clockwise Consistent w/ right-hand rule Don t be different... Note: rotate b zero degrees give identit rotations are modulo 360 (or ) 2 17 Rotations Preserve lengths and distance to origin Rotation matrices are orthonormal Det(R) = 1 1 In 2D rotations commute... But in 3D the won t 18

Scales Uniform/isotropic Non-uniform/anisotropic & s 0 # p ' = $ p % 0 s " Scale 0.5 0 0 0.5 0.5 0 0 1.5 19 Scales Diagonal matrices Diagonal parts are scale in X and scale in Y directions Negative values flip Two negatives make a positive (180 deg. rotation) Reall, ais-aligned scales Not ais-aligned... 20

Shears Shear & 1 H # p ' = $ p % H 1 " 1 1 0 1 21 Shears Shears are not reall primitive transforms Related to non-ais-aligned scales More shortl... 22

Translation This is the not-so-useful wa: Translate & t p' = p + $ % t # " Note that its not like the others. 23 Arbitrar Matrices For everthing but translations we have: = A Soon, translations will be assimilated as well What does an arbitrar matri mean? 24

Singular Value Decomposition For an matri, A, we can write SVD: T A = QSR where Q and R are orthonormal and S is diagonal Can also write Polar Decomposition T A = QRSR where Q is still orthonormal not the same Q 25 Decomposing Matrices We can force Q and R to have Det=1 so the are rotations An matri is now: Rotation:Rotation:Scale:Rotation See, shear is just a mi of rotations and scales 26

Composition Matri multiplication composites matrices p ' = BAp Appl A to p and then appl B to that result. p ' = B( Ap) = ( BA) p = Cp Several translations composted to one Translations still left out... p ' = B( Ap + t) = BAp + Bt = Cp + u 27 Composition Transformations built up from others shear shear SVD builds from scale and rotations Also build other was shear i.e. 45 deg rotation built from shears 28

29 Move to one higher dimensional space Append a 1 at the end of the vectors Homogeneous Coordiantes " # $ % & = p p p " # $ $ $ % & = 1 ~ p p p 30 Homogeneous Translation " # $ $ $ % & " # $ $ $ % & = 1 1 0 0 1 0 0 1 ' ~ p p t t p Ap p ~ ~ ' ~ = The tildes are for clarit to distinguish homogenized from non-homogenized vectors.

Homogeneous Others & ~ $ A A = $ % 0 0 0# 0 1" Now everthing looks the same... Hence the term homogenized 31 Compositing Matrices Rotations and scales alwas about the origin How to rotate/scale about another point? -vs- 32

Rotate About Arb. Point Step 1: Translate point to origin Translate (-C) 33 Rotate About Arb. Point Step 1: Translate point to origin Step 2: Rotate as desired Translate (-C) Rotate () 34

Rotate About Arb. Point Step 1: Translate point to origin Step 2: Rotate as desired Step 3: Put back where it was Translate (-C) Rotate () Translate (C) p ~ ' = ( T) RTp ~ = Ap ~ Don t negate the 1... 35 Scale About Arb. Ais Diagonal matrices scale about coordinate aes onl: Not ais-aligned 36

Scale About Arb. Ais Step 1: Translate ais to origin 37 Scale About Arb. Ais Step 1: Translate ais to origin Step 2: Rotate ais to align with one of the coordinate aes 38

Scale About Arb. Ais Step 1: Translate ais to origin Step 2: Rotate ais to align with one of the coordinate aes Step 3: Scale as desired 39 Scale About Arb. Ais Step 1: Translate ais to origin Step 2: Rotate ais to align with one of the coordinate aes Step 3: Scale as desired Steps 4&5: Undo 2 and 1 (reverse order) 40

Order Matters The order that matrices appear in matters A B BA Some special cases work, but the are special But matrices are associative (A B) C = A (B C) Think about efficienc when ou have man points to transform... 41 Matri Inverses In general: Special cases: Translation: negate undoes effect of t and t Rotation: transpose Scale: invert diagonal (ais-aligned scales) Others: A 1 Invert matri Invert SVD matrices A 42

Point Vectors / Direction Vectors Points in space have a 1 for the w coordinate What should we have for a b? w = 0 Directions not the same as positions Difference of positions is a direction Position + direction is a position Direction + direction is a direction Position + position is nonsense 43 Somethings Require Care For eample normals do not transform normall M(a b) (Ma) (Mb) M(Re) R(Me) 44