Affine transformations

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

Affine transformations. Brian Curless CSE 557 Fall 2014

Affine transformations

Affine transformations

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

CS 378: Computer Game Technology

Vector and Affine Math

CS 354R: Computer Game Technology

Linear and affine transformations

Lecture 8: Coordinate Frames. CITS3003 Graphics & Animation

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

Computer Graphics: 2D Transformations. Course Website:

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

2D Geometric Transformations. (Chapter 5 in FVD)

MATRIX TRANSFORMATIONS

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

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

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

1 HOMOGENEOUS TRANSFORMATIONS

CS-184: Computer Graphics. Today

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

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

CSC 470 Introduction to Computer Graphics. Mathematical Foundations Part 2

Math 181/281. Rumbos Spring 2011 Page 1. Solutions to Assignment #5. Hence, the dynamical system, θ(t, p, q), for (t, p, q) R 3 corresponding = F.

CSE4030 Introduction to Computer Graphics

1 Overview. CS348a: Computer Graphics Handout #8 Geometric Modeling Original Handout #8 Stanford University Thursday, 15 October 1992

The Affine Group of Transformations

Chapter 8. Rigid transformations

COMP 175 COMPUTER GRAPHICS. Lecture 04: Transform 1. COMP 175: Computer Graphics February 9, Erik Anderson 04 Transform 1

Graphics Example: Type Setting

GEOMETRY AND VECTORS

Linear programming: Theory

Linear transformations

First Order Differential Equations f ( x,

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

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

Mathematics Revision Guides Vectors Page 1 of 19 Author: Mark Kudlowski M.K. HOME TUITION. Mathematics Revision Guides Level: GCSE Higher Tier VECTORS

Computer Graphics MTAT Raimond Tunnel

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

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

I&C 6N. Computational Linear Algebra

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

Linear Independence. , v 2. is linearly independent if. =0 iff 1

12.1 Systems of Linear equations: Substitution and Elimination

15. Eigenvalues, Eigenvectors

A geometric interpretation of the homogeneous coordinates is given in the following Figure.

Section 1.2: A Catalog of Functions

03 - Basic Linear Algebra and 2D Transformations

Ordinary Differential Equations

Physically Based Rendering ( ) Geometry and Transformations

1.4 Linear Transformation I

1.1 Vectors. The length of the vector AB from A(x1,y 1 ) to B(x 2,y 2 ) is

Strain Transformation and Rosette Gage Theory

6. COORDINATE GEOMETRY

Overview. Distances in R 3. Distance from a point to a plane. Question

VECTORS IN THREE DIMENSIONS

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 & Geometry why is linear algebra useful in computer vision?

CC Algebra 2H Transforming the parent function

Transformations. Lars Vidar Magnusson. August 24,

Identifying second degree equations

Introduction to Mechanics Vectors and Trigonometry

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

Engineering Mathematics I

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

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

3 a 21 a a 2N. 3 a 21 a a 2M

Review of similarity transformation and Singular Value Decomposition

Problem 1: (3 points) Recall that the dot product of two vectors in R 3 is

ANALYTICAL GEOMETRY Revision of Grade 10 Analytical Geometry

Roots and Coefficients Polynomials Preliminary Maths Extension 1

Linear Algebra: Matrix Eigenvalue Problems

Lecture 3: Linear Algebra Review, Part II

Polynomial approximation and Splines

Announcements Monday, September 18

REPLACE ONE ROW BY ADDING THE SCALAR MULTIPLE OF ANOTHER ROW

Math 369 Exam #1 Practice Problems

5. Zeros. We deduce that the graph crosses the x-axis at the points x = 0, 1, 2 and 4, and nowhere else. And that s exactly what we see in the graph.

EECS 275 Matrix Computation

(1) Recap of Differential Calculus and Integral Calculus (2) Preview of Calculus in three dimensional space (3) Tools for Calculus 3

Linear Algebra (wi1403lr) Lecture no.4

2018 Fall 2210Q Section 013 Midterm Exam I Solution

Review of Coordinate Systems

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

Fundamental principles

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

Geometric Stiffness Effects in 2D and 3D Frames

Lecture 02: 2D Geometry. August 24, 2017

( ) = ( ) ( ) = ( ) = + = = = ( ) Therefore: , where t. Note: If we start with the condition BM = tab, we will have BM = ( x + 2, y + 3, z 5)

MAE 323: Lecture 1. Review

6.837 LECTURE 8. Lecture 8 Outline Fall '01. Lecture Fall '01

Two Dimensional Linear Systems of ODEs

Lecture 27: More on Rotational Kinematics

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

PRACTICE PROBLEMS (TEST I).

Math 3108: Linear Algebra

MATH 1324 (Finite Mathematics or Business Math I) Lecture Notes Author / Copyright: Kevin Pinegar

9.1 VECTORS. A Geometric View of Vectors LEARNING OBJECTIVES. = a, b

Section 7.2 Solving Linear Recurrence Relations

10.1 Vectors. c Kun Wang. Math 150, Fall 2017

Transcription:

Reading Required: Affine transformations Brian Curless CSEP 557 Fall 2016 Angel 3.1, 3.7-3.11 Further reading: Angel, the rest of Chapter 3 Fole, et al, Chapter 5.1-5.5. David F. Rogers and J. Alan Adams, Mathematical Elements for Computer Graphics, 2 nd Ed., McGraw-Hill, New York, 1990, Chapter 2. 1 2 Geometric transformations Vector representation Geometric transformations will map points in one space to points in another: (x',, z ) = f (x,, z ). These transformations can be ver simple, such as scaling each coordinate, or complex, such as nonlinear twists and bends. We'll focus on transformations that can be represented easil with matrix operations. We can represent a point, p = (x, ), in the plane or p = (x,, z ) in 3D space as column vectors as row vectors x x x z x z 3 4

Canonical axes Vector length and dot products 5 6 Vector cross products Representation, cont. We can represent a 2-D transformation M b a matrix a b c d If p is a column vector, M goes on the left: p' Mp x' a bx ' c d If p is a row vector, M T goes on the right: x' ' x We will use column vectors. T p' pm a c b d 7 8

Two-dimensional transformations Identit Here's all ou get with a 2 x 2 transformation matrix M : x' a bx ' c d So: x ' ax b ' cx d Suppose we choose a =d =1, b =c =0: Gives the identit matrix: 1 0 0 1 Doesn't move the points at all We will develop some intimac with the elements a, b, c, d 9 10 Scaling Suppose we set b =c =0, but let a and d take on an positive value: Gives a scaling matrix: a 0 0 d Provides differential (non-uniform) scaling in x and : x' ax ' d Suppose we keep b =c =0, but let either a or d go negative. Examples: 1 0 0 1 1 0 0 1 2 0 0 2 12 0 0 2 11 12

Effect on unit square Now let's leave a =d =1 and experiment with b... The matrix 1 b 0 1 gives: x ' xb ' Let's see how a general 2 x 2 transformation M affects the unit square: a c b d p q r s p' q' r' s' a b0 1 1 0 0 a a b b c d 0 0 1 1 0 c c d d 1 1 0 1 13 14 Effect on unit square, cont. Rotation Observe: Origin invariant under M M can be determined just b knowing how the corners (1,0) and (0,1) are mapped a and d give x -and -scaling b and c give x -and -shearing From our observations of the effect on the unit square, it should be eas to write down a matrix for rotation about the origin : 1 0 0 1 Thus, MR( ) 15 16

Limitations of the 2 x 2 matrix A 2 x 2 linear transformation matrix allows Scaling Rotation Reflection Shearing Q: What important operation does that leave out? Homogeneous coordinates Idea is to loft the problem up into 3-space, adding a third component to ever point: x x 1 Adding the third w component puts us in homogenous coordinates. And then transform with a 3 x 3 matrix: x' x 1 0 tx x ' T() t 0 1 t w ' 1 0 0 11 1 0 1 0 1 12 0 0 1 17... gives translation! 18 Anatom of an affine matrix The addition of translation to linear transformations gives us affine transformations. In matrix form, 2D affine transformations alwas look like this: a b tx A t M c d t 0 0 1 0 0 1 Rotation about arbitrar points Until now, we have onl considered rotation about the origin. With homogeneous coordinates, ou can specif a rotation b, about an point q = [q x q ] T with a matrix. Let s do this with rotation and translation matrices of the form R() and T(t), respectivel. 2D affine transformations alwas have a bottom row of [0 0 1]. An affine point is a linear point with an added w-coordinate which is alwas 1: x plin p aff 1 1 Appling an affine transformation gives another affine point: Aplin t Mpaff 1 19 1. Translate q to origin 2. Rotate 3. Translate back 20

Points and vectors Vectors have an additional coordinate of w = 0. Thus, a change of origin has no effect on vectors. Q: What happens if we multipl a vector b an affine matrix? These representations reflect some of the rules of affine operations on points and vectors: vector + vector scalar vector point - point point + vector point + point scalar vector + scalar vector scalar point + scalar point Basic 3-D transformations: scaling Some of the 3-D transformations are just like the 2-D ones. For example, scaling: x ' sx 0 0 0x ' 0 s 0 0 z ' 0 0 sz 0z 1 0 0 0 11 One useful combination of affine operations is: p() t po tu Q: What does this describe? 21 22 Translation in 3D Rotation in 3D (cont d) x ' 1 0 0 tx x ' 0 1 0 t z ' 0 0 1 tz z 1 0 0 0 11 These are the rotations about the canonical axes: 1 0 0 0 0 cos sin 0 R x ( ) 0 sin cos 0 0 0 0 1 R cos 0 sin 0 0 1 0 0 R ( ) sin 0 cos 0 R x 0 0 0 1 R z cos sin 0 0 sin cos 0 0 Use right hand rule R ( ) z 0 0 1 0 0 0 0 1 A general rotation can be specified in terms of a product of these three matrices. How else might ou specif a rotation? 23 24

Shearing in 3D Properties of affine transformations Shearing is also more complicated. Here is one example: x ' 1 b 0 0x ' 0 1 0 0 z ' 0 0 1 0z 1 0 0 0 11 Here are some useful properties of affine transformations: Lines map to lines Parallel lines remain parallel (when transforming from N dimensions to N dimensions) Midpoints map to midpoints (in fact, ratios are alwas preserved) pq s ratio qr t p'q' q'r' We call this a shear with respect to the x-z plane. 25 26 Affine transformations in OpenGL OpenGL maintains a modelview matrix that holds the current transformation M. The modelview matrix is applied to points (usuall vertices of polgons) before drawing. It is modified b commands including: glloadidentit() set M to identit gltranslatef(t x, t, t z ) translate b (t x, t, t z ) M I M MT glrotatef(θ, x,, z) M MR rotate b angle θ about axis (x,, z) Summar What to take awa from this lecture: All the names in boldface. How points and transformations are represented. How to compute lengths, dot products, and cross products of vectors, and what their geometrical meanings are. What all the elements of a 2 x 2 transformation matrix do and how these generalize to 3 x 3 transformations. What homogeneous coordinates are and how the work for affine transformations. How to concatenate transformations. The mathematical properties of affine transformations. glscalef(s x, s, s z ) scale b (s x, s, s z ) M MS Note that OpenGL adds transformations b postmultiplication of the modelview matrix. 27 28