Affine Transformations



Similar documents
Addition and Subtraction of Vectors

2D Geometrical Transformations. Foley & Van Dam, Chapter 5

Graphing Linear Equations

INVESTIGATIONS AND FUNCTIONS Example 1

SECTION 7-4 Algebraic Vectors

Section V.2: Magnitudes, Directions, and Components of Vectors

sin(θ) = opp hyp cos(θ) = adj hyp tan(θ) = opp adj

MAT188H1S Lec0101 Burbulla

Double Integrals in Polar Coordinates

Connecting Transformational Geometry and Transformations of Functions

COMPONENTS OF VECTORS

SECTION 2.2. Distance and Midpoint Formulas; Circles

x y The matrix form, the vector form, and the augmented matrix form, respectively, for the system of equations are

Complex Numbers. w = f(z) z. Examples

Advanced Computer Graphics (2IV40) ~ 3D Transformations. Types (geometric) Types (algebraic) 3D Transformations. y + c 1. x = a 1.

Math, Trigonometry and Vectors. Geometry. Trig Definitions. sin(θ) = opp hyp. cos(θ) = adj hyp. tan(θ) = opp adj. Here's a familiar image.

Linear Equations in Linear Algebra

w = COI EYE view direction vector u = w ( 010,, ) cross product with y-axis v = w u up vector

Downloaded from equations. 2.4 The reciprocal function x 1 x

Introduction to polarization of light

Physics 53. Kinematics 2. Our nature consists in movement; absolute rest is death. Pascal

B4 Computational Geometry

Geometric Camera Parameters

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

Solving Absolute Value Equations and Inequalities Graphically

Lines and Planes 1. x(t) = at + b y(t) = ct + d

D.3. Angles and Degree Measure. Review of Trigonometric Functions

Introduction to Matrices for Engineers

C3: Functions. Learning objectives

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

Slope-Intercept Form and Point-Slope Form

TWO-DIMENSIONAL TRANSFORMATION

In this this review we turn our attention to the square root function, the function defined by the equation. f(x) = x. (5.1)

The Distance Formula and the Circle

Exponential and Logarithmic Functions

2D Geometric Transformations

COMPLEX STRESS TUTORIAL 3 COMPLEX STRESS AND STRAIN

Ax 2 Cy 2 Dx Ey F 0. Here we show that the general second-degree equation. Ax 2 Bxy Cy 2 Dx Ey F 0. y X sin Y cos P(X, Y) X

Rotation Matrices and Homogeneous Transformations

DISTANCE, CIRCLES, AND QUADRATIC EQUATIONS

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z

Geometric Transformation CS 211A

Vector has a magnitude and a direction. Scalar has a magnitude

LINEAR FUNCTIONS OF 2 VARIABLES

Core Maths C2. Revision Notes

CHAPTER 10 SYSTEMS, MATRICES, AND DETERMINANTS

Rotated Ellipses. And Their Intersections With Lines. Mark C. Hendricks, Ph.D. Copyright March 8, 2012

The elements used in commercial codes can be classified in two basic categories:

Lecture L3 - Vectors, Matrices and Coordinate Transformations

1.6. Piecewise Functions. LEARN ABOUT the Math. Representing the problem using a graphical model

3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

v 1 v 3 u v = (( 1)4 (3)2, [1(4) ( 2)2], 1(3) ( 2)( 1)) = ( 10, 8, 1) (d) u (v w) = (u w)v (u v)w (Relationship between dot and cross product)

Functions and Graphs CHAPTER INTRODUCTION. The function concept is one of the most important ideas in mathematics. The study

Physics 235 Chapter 1. Chapter 1 Matrices, Vectors, and Vector Calculus

5.3 The Cross Product in R 3

3D Stress Components. From equilibrium principles: τ xy = τ yx, τ xz = τ zx, τ zy = τ yz. Normal Stresses. Shear Stresses

EQUILIBRIUM STRESS SYSTEMS

7.3 Parabolas. 7.3 Parabolas 505

Introduction to Plates

Chapter 17. Orthogonal Matrices and Symmetries of Space

EQUATIONS OF LINES IN SLOPE- INTERCEPT AND STANDARD FORM

Product Operators 6.1 A quick review of quantum mechanics

Find the Relationship: An Exercise in Graphing Analysis

Pulsed Fourier Transform NMR The rotating frame of reference. The NMR Experiment. The Rotating Frame of Reference.

Chapter 8. Lines and Planes. By the end of this chapter, you will

Solving Simultaneous Equations and Matrices

ax 2 by 2 cxy dx ey f 0 The Distance Formula The distance d between two points (x 1, y 1 ) and (x 2, y 2 ) is given by d (x 2 x 1 )

5.2 Inverse Functions

Lecture 3: Coordinate Systems and Transformations

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

Identifying second degree equations

D.2. The Cartesian Plane. The Cartesian Plane The Distance and Midpoint Formulas Equations of Circles. D10 APPENDIX D Precalculus Review

Math 259 Winter Recitation Handout 1: Finding Formulas for Parametric Curves

Structural Axial, Shear and Bending Moments

Vector Math Computer Graphics Scott D. Anderson

2.1 Three Dimensional Curves and Surfaces

CS 4204 Computer Graphics

Figure 1.1 Vector A and Vector F

Chapter 6. Linear Transformation. 6.1 Intro. to Linear Transformation

Section 9.1 Vectors in Two Dimensions

2.6. The Circle. Introduction. Prerequisites. Learning Outcomes

PYTHAGOREAN TRIPLES KEITH CONRAD

Essential Mathematics for Computer Graphics fast

Cross Products and Moments of Force

Cross product and determinants (Sect. 12.4) Two main ways to introduce the cross product

The University of the State of New York REGENTS HIGH SCHOOL EXAMINATION INTEGRATED ALGEBRA. Tuesday, January 24, :15 a.m. to 12:15 p.m.

THE PARABOLA section

Fundamentals of Computer Animation

ACT Math Vocabulary. Altitude The height of a triangle that makes a 90-degree angle with the base of the triangle. Altitude

Core Maths C3. Revision Notes

ex) What is the component form of the vector shown in the picture above?

Section 5-9 Inverse Trigonometric Functions

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Plane Stress Transformations

Vector Calculus: a quick review

Teacher Page. 1. Reflect a figure with vertices across the x-axis. Find the coordinates of the new image.

Transcription:

A P P E N D I X C Affine Transformations CONTENTS C The need for geometric transformations 335 C2 Affine transformations 336 C3 Matri representation of the linear transformations 338 C4 Homogeneous coordinates 338 C5 3D form of the affine transformations 34 C THE NEED FOR GEOMETRIC TRANSFORMATIONS One could imagine a computer graphics sstem that requires the user to construct everthing directl into a single scene But one can also immediatel see that this would be an etremel limiting approach In the real world things come from various places and are arranged together to create a scene Further man of these things are themselves collections of smaller parts that are assembled together We ma wish to define one object relative to another for eample we ma want to place a hand at the end of an arm Also it is often the case that parts of an object are similar like the tires on a car And even things that are built on scene like a house for eample are designed elsewhere at a scale that is usuall man times smaller than the house as it is built Even more to the point we will often want to animate the objects in a scene requiring the abilit to move them around relative to each other For animation we will want to be able to move not onl the objects but also the camera as we render a sequence of images as time advances to create an illusion of motion We need good mechanisms within a computer graphics sstem to provide the fleibilit implied b all of the issues raised above 335

336 Foundations of Phsicall Based Modeling and Animation The figure below shows an eample of what we mean On the left a clinder has been built in a convenient place and to a convenient size Because of the requirements of a scene it is first scaled to be longer and thinner than its original design rotated to a desired orientation in space and then moved to a desired position (ie translated) The set of operations providing for all such transformations are known as the affine transforms The affines include translations and all linear transformations like scale rotate and shear O Original clinder model C2 O Transformed clinder It has been scaled rotated and translated AFFINE TRANSFORMATIONS Let us first eamine the affine transforms in 2D space where it is eas to illustrate them with diagrams then later we will look at the affines in 3D Consider a point = ( ) Affine transformations of are all transforms that can be written a + b + c = d + e + f where a through f are scalars For eample if a e = and b d = then we have a pure translation +c = + f f c If b d = and c f = then we have a pure scale a = e e o a

Affine Transformations 337 And if a e = cos θ b = sin θ d = sin θ and c f = then we have a pure rotation about the origin cos θ sin θ = sin θ + cos θ o Finall if a e = and c f = we have the shear transforms + b = + d b d o In summar we have the four basic affine transformations shown in the figure below: Translate moves a set of points a fied distance in and Scale scales a set of points up or down in the and directions Rotate rotates a set of points about the origin Shear offsets a set of points a distance proportional to their and coordinates Note that onl shear and scale change the shape determined b a set of points Translate Scale Rotate Shear

338 Foundations of Phsicall Based Modeling and Animation C3 MATRIX REPRESENTATION OF THE LINEAR TRANS- FORMATIONS The affine transforms scale rotate and shear are actuall linear transforms and can be represented b a matri multiplication of a point represented as a vector [ ] [ ] [ ] [ ] a + b a b = = d + e d e or = M where M is the matri One ver nice feature of the matri representation is that we can use it to factor a comple transform into a set of simpler transforms For eample suppose we want to scale an object up to a new size shear the object to a new shape and finall rotate the object Let S be the scale matri H be the shear matri and R be the rotation matri Then = R(H(S)) defines a sequence of three transforms: st-scale 2nd-shear 3rd-rotate Because matri multiplication is associative we can remove the parentheses and multipl the three matrices together giving a new matri M = RHS Now we can rewrite our transform = (RHS) = M If we have to transform thousands of points on a comple model it is clearl easier to do one matri multiplication rather than three each time we want to transform a point Thus matrices are a ver powerful wa to encapsulate a comple transform and to store it in a compact and convenient form In matri form we can catalog the linear transforms as [ ] [ ] [ ] s cos θ sin θ h Scale: Rotate: Shear: s sin θ cos θ h where s and s scale the and coordinates of a point θ is an angle of counterclockwise rotation around the origin h is a horizontal shear factor and h is a vertical shear factor C4 HOMOGENEOUS COORDINATES Since the matri form is so hand for building up comple transforms from simpler ones it would be ver useful to be able to represent all of the affine transforms b matrices The problem is that translation is not a linear transform The wa out of this dilemma is to turn the 2D problem into a 3D problem but in homogeneous coordinates We first take all of our points = ( ) epress them as 2D vectors [ ] and make these

Affine Transformations 339 into 3D vectors with identical (thus the term homogeneous) 3rd coordinates set to : [ ] = B convention we call this third coordinate the w coordinate to distinguish it from the usual 3D z coordinate We also etend our 2D matrices to 3D homogeneous form b appending an etra row and column giving s cos θ sin θ h Scale: s Rotate: sin θ cos θ Shear: h Note what happens when we multipl our 3D homogeneous matrices b 3D homogeneous vectors: a b a + b d e = d + e This is the same result as in 2D with the eception of the etra w coordinate which remains p 2 p p 3 p All we have reall done is to place all of our 2D points on the plane w = in 3D space and now plane w= we do all the operations on this plane Reall the w operations are still 2D operations But the magic happens when we place the translation parameters c and f in the matri in the 3rd column: a b c a + b + c d e f = d + e + f We can now do translations as linear operations in homogeneous coordinates! So we can add a final matri to our catalog: Translate: where is the translation in the direction and is the translation in the direction The astute reader will see the trick behind the magic 2D translation is now being epressed as a shear in 3D space

34 Foundations of Phsicall Based Modeling and Animation Now suppose we have a 2 2 square centered at the origin and we want to first rotate the square b 45 about its center and then move the square so its center is at (3 2) We can do this in two steps as shown in the diagram to the right (-) (--) 2 translate (3 2) () rotate 45 o (-) (- 2 ) (32+ 2 ) (3-2 2 ) ( 2 ) (- 2 ) ( 2 ) (3+ 2 2 ) (32) (32-2 ) In matri form: 3 cos 45 sin 45 M = T (32) R 45 = 2 sin 45 cos 45 cos 45 sin 45 3 = sin 45 cos 45 2 2/2 2/2 3 = 2/2 2/2 2 Note that 3 M = 2 + 3 2 2 and M = 2 verifing that we get the same result shown in the figure C5 3D FORM OF THE AFFINE TRANSFORMATIONS Now we can etend all of these ideas to 3D in the following wa: Convert all 3D points to homogeneous coordinates = z z The etra (4th) coordinate is again called the w coordinate

Affine Transformations 34 2 Use matrices to represent the 3D affine transforms in homogeneous form The following matrices constitute the basic affine transforms in 3D epressed in homogeneous form: and s s Translate: Scale: z s z h h z h Shear: h z h z h z In addition there are three basic rotations in 3D cos θ Rotation about the ais: sin θ sin θ cos θ and cos θ sin θ Rotation about the ais: sin θ cos θ cos θ z sin θ z sin θ Rotation about the z ais: z cos θ z The rotations specified in this wa determine an amount of rotation about each of the individual aes of the coordinate sstem The angles θ θ and θ z of rotation about the three aes are called the Euler angles The can be used to describe an off-ais rotation b combining Euler angle rotations via matri multiplication Note however that the order of rotation affects the end result so besides specifing Euler angles an order of rotation must be specified In general affine transformations are associative but are not commutative so the order in which operations are done is highl important One can see this for rotations b computing the product R θ R θ R θz and comparing with the result obtained b the product R θz R θ R θ Please see Appendi D for a more powerful and general look at rotation