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



Similar documents
2D Geometric Transformations

Rotation and Inter interpolation Using Quaternion Representation

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

Connecting Transformational Geometry and Transformations of Functions

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

Affine Transformations

CS 4204 Computer Graphics

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

Realtime 3D Computer Graphics Virtual Reality

B4 Computational Geometry

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

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

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

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

SECTION 7-4 Algebraic Vectors

A vector is a directed line segment used to represent a vector quantity.

Addition and Subtraction of Vectors

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

4BA6 - Topic 4 Dr. Steven Collins. Chap. 5 3D Viewing and Projections

Section 1.4. Lines, Planes, and Hyperplanes. The Calculus of Functions of Several Variables

Figure 1.1 Vector A and Vector F

Geometric Camera Parameters

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

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

Essential Mathematics for Computer Graphics fast

TWO-DIMENSIONAL TRANSFORMATION

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

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

Lecture 3: Coordinate Systems and Transformations

Equations Involving Lines and Planes Standard equations for lines in space

Section 9.1 Vectors in Two Dimensions

JUST THE MATHS UNIT NUMBER 8.5. VECTORS 5 (Vector equations of straight lines) A.J.Hobson

Geometry for Computer Graphics

Computer Graphics Labs

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

MAT188H1S Lec0101 Burbulla

Geometric Transformations

Identifying second degree equations

Orthogonal Projections

Section 9.5: Equations of Lines and Planes

THREE DIMENSIONAL GEOMETRY

Exponential and Logarithmic Functions

Rotation Matrices and Homogeneous Transformations

COMPONENTS OF VECTORS

9 MATRICES AND TRANSFORMATIONS

Geometric description of the cross product of the vectors u and v. The cross product of two vectors is a vector! u x v is perpendicular to u and v

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

SLOPE OF A LINE 3.2. section. helpful. hint. Slope Using Coordinates to Find 6% GRADE SLOW VEHICLES KEEP RIGHT

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

THEORETICAL MECHANICS

Linear Equations in Linear Algebra

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

SECTION 2.2. Distance and Midpoint Formulas; Circles

Introduction to Matrices for Engineers

Section 7.2 Linear Programming: The Graphical Method

GCE Mathematics (6360) Further Pure unit 4 (MFP4) Textbook

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

LINEAR FUNCTIONS OF 2 VARIABLES

Solving Simultaneous Equations and Matrices

Vectors Math 122 Calculus III D Joyce, Fall 2012

FURTHER VECTORS (MEI)

What's the Spin? - Discover Properties of Geometric Rotations

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

Structural Axial, Shear and Bending Moments

α = u v. In other words, Orthogonal Projection

2.1 Three Dimensional Curves and Surfaces

1.5 SOLUTION SETS OF LINEAR SYSTEMS

Dr. Fritz Wilhelm, DVC,8/30/2004;4:25 PM E:\Excel files\ch 03 Vector calculations.doc Last printed 8/30/2004 4:25:00 PM

CS 4204 Computer Graphics

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

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

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

LINES AND PLANES CHRIS JOHNSON

521493S Computer Graphics. Exercise 2 & course schedule change

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

Basic CAD/CAM. CHAPTER 5: Geometric Transformation

Core Maths C2. Revision Notes

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

Geometric Transformations

Graphing Quadratic Equations

Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

Number Sense and Operations

Section 1.1. Introduction to R n

The Essentials of CAGD

Geometric Transformation CS 211A

Geometry: Unit 1 Vocabulary TERM DEFINITION GEOMETRIC FIGURE. Cannot be defined by using other figures.

Core Maths C3. Revision Notes

Math 241, Exam 1 Information.

Mathematics Notes for Class 12 chapter 10. Vector Algebra

Unified Lecture # 4 Vectors

Introduction to polarization of light

Projective Geometry. Projective Geometry

discuss how to describe points, lines and planes in 3 space.

Equation of a Line. Chapter H2. The Gradient of a Line. m AB = Exercise H2 1

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

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

Transformations in the pipeline

REVIEW OF ANALYTIC GEOMETRY

A Correlation of Pearson Texas Geometry Digital, 2015

Transcription:

2D Geometrical Transformations Fole & Van Dam, Chapter 5

2D Geometrical Transformations Translation Scaling Rotation Shear Matri notation Compositions Homogeneous coordinates

2D Geometrical Transformations Assumption: Objects consist of points and lines. A point is represented b its Cartesian coordinates: P (, ) Geometrical Transformation: Let (A, B) be a straight line segment between the points A and B. Let T be a general 2D transformation. T transforms (A, B) into another straight line segment (A, B ), where: A TA and B TB

Translation Translate(a, b): (, ) (+a, +b) Translate(2, 4)

Scale Scale (a, b): (, ) (a, b) Scale (2, 3) Scale (2, 3)

Scale How can we scale an object without moving its origin (lower left corner)? Translate(-,-) Translate(,) Scale(2,3)

Reflection Special case of scale Scale(-,) Scale(,-)

Rotation Rotate(): (, ) ( cos()+ sin(), - sin()+ cos()) Rotate(9) Rotate(9)

Rotation How can we rotate an object without moving its origin (lower left corner)? Translate(-,-) Translate(,) Rotate(9)

Shear Shear (a, b): (, ) (+a, +b) Shear(,) Shear(,2)

Classes of Transformations Rigid transformation (distance preserving): Translation + Rotation Similarit transformation (angle preserving): Translation + Rotation + Uniform Scale Affine transformation (parallelism preserving): Translation + Rotation + Scale + Shear All above transformations are groups where Rigid Similarit Affine Affine Similarit Rigid

Matri Notation Let s treat a point (, ) as a 2 matri (column vector): What happens when this vector is multiplied b a 22 matri? a c b d a c + + b d

2D Transformations 2D object is represented b points and lines that join them Transformations can be applied onl to the the points defining the lines A point (, ) is represented b a 2 column vector, so we can represent 2D transformations b using 22 matrices: ' ' a c b d

Scale Scale (a, b): (, ) (a, b) a b a b If a or b are negative, we get reflection Inverse: S - (a,b) S(/a, /b)

Reflection Reflection through the ais: Reflection through the ais: Reflection through : Reflection through -:

Shear Shear (a, b): (, ) (+a, +b) b a + + a b

Rotation Rotate(): (, ) ( cos()+ sin(), - sin()+ cos()) cos sin sin cos cos + sin + sin cos Inverse: R - (q) R T (q) R(-q)

Composition of Transformations A sequence of transformations can be collapsed into a single matri: A B C D [ ][ ][ ] [ ] Note: Order of transformations is important! translate rotate rotate translate

Translation (a, b): Translation Problem: Cannot represent translation using 22 matrices Solution: Homogeneous Coordinates + a + b

Homogeneous Coordinates Is a mapping from R n to R n+ : (, ) ( X, Y, W ) ( t, t, t ) Note: All triples (t, t, t) correspond to the same non-homogeneous point (, ) Eample (2, 3, ) (6, 9, 3). Inverse mapping: X ( X, Y, W ), W Y W

Translation Translate(a, b): Inverse: T - (a, b) T(-a, -b) Affine transformations now have the following form: + + b a b a f d c e b a

Geometric Interpretation A 2D point is mapped to a line (ra) in 3D The non-homogeneous points are obtained b projecting the ras onto the plane Z W (X,Y,) Y (X,Y,W) X

Eample Rotation about an arbitrar point. Translate the coordinates so that the origin is at (, ) 2. Rotate b 3. Translate back (, ) + sin ) cos ( cos sin sin ) cos ( sin cos cos sin sin cos

Eample Reflection about an arbitrar line p 2 L p + t (p 2 -p ) t p 2 + (-t) p p. Translate the coordinates so that P is at the origin 2. Rotate so that L aligns with the -ais 3. Reflect about the -ais 4. Rotate back 5. Translate back

Change of Coordinates It is often required to transform the description of an object from one coordinate sstem to another Rule: Transform one coordinate frame towards the other in the opposite direction of the representation change Representation Transformation

Eample Change of coordinates: Represent P ( p, p, ) in the (, ) coordinate sstem P ' MP Where: M cos sin sin cos ( p, p ) (, )

Eample Change of coordinates: Alternative method: assume (u, u) and (v, v) in the (, ) coordinate sstem where MP P ' v v u u M (, ) (u, u ) (v, v )

Eample Reflection about an arbitrar line Define a coordinate sstems (u, v) parallel to P P 2 : p p 2 L p + t (p 2 -p ) t p 2 + (-t) p u u p p p p 2 2 u v v u u v p p v v u u v u v u p p M

3D Viewing Transformation Pipeline Viewing coordinates World Coordinates Object in World 3D:2D mapping 2D:2D mapping Viewport Device Coordinates

World to Viewing Coordinates In order to define the viewing window we have to specif: Windowing-coordinate origin P (, ) View vector up v (v,v ) Using v, we can find u: u v (,,) Transformation from world to viewing coordinates : M world wc vc view (, ) u v view u v (v,v ). world (u,u ).

Window to Viewport Coordinates ( ma, ma ) ( min, min ) Window is Viewing Coordinates Window translated to origin (u man,v man ) (u min,v min ) Window scaled and translated to Viewport location in device coordinates Window scaled to Normalized Viewport size M vc dc u v min min u ma u min v ma v min ma min ma min min min Normalized Device Coordinates

Efficienc Considerations A 2D point transformation requires 9 multiplies and 6 adds a b c a + b + cz d e f d e fz + + g h i z g + h + iz But since affine transformations have alwas the form: a b c a + b + c d e f d e f + + The number of operations can be reduced to 4 multiplies and 4 adds

Efficienc Considerations The rotation matri is: cos sin sin cos cos + sin + sin cos When rotating of small angles, we can use the fact that cos() and simplif sin + sin sin sin +

Determinant of a Matri a b ad c d bc a b c d e f aei + bfg + cdh ceg afh bdi g h i e f d f d e a b + c h i g i g h If P is a polgon of area A P, transformed b a matri M, the area of the transformed polgon is A P M