2D Geometric Transformations



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

TWO-DIMENSIONAL TRANSFORMATION

Rotation Matrices and Homogeneous Transformations

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

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

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

Connecting Transformational Geometry and Transformations of Functions

Geometric Transformation CS 211A

Geometric Transformations

CS 4204 Computer Graphics

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

Section 9.5: Equations of Lines and Planes

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

Computer Graphics Labs

Geometric Camera Parameters

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)

Lecture 3: Coordinate Systems and Transformations

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

The Force Table Introduction: Theory:

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

[1] Diagonal factorization

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Essential Mathematics for Computer Graphics fast

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

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

9 MATRICES AND TRANSFORMATIONS

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

Geometry for Computer Graphics

Geometric Transformations

Section 9.1 Vectors in Two Dimensions

521493S Computer Graphics. Exercise 2 & course schedule change

Affine Transformations

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

Equations Involving Lines and Planes Standard equations for lines in space

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

THREE DIMENSIONAL GEOMETRY

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

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

Realtime 3D Computer Graphics Virtual Reality


Basic Problem: Map a 3D object to a 2D display surface. Analogy - Taking a snapshot with a camera

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

Figure 1.1 Vector A and Vector F

Vector Math Computer Graphics Scott D. Anderson

Solving Simultaneous Equations and Matrices

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

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

Dot product and vector projections (Sect. 12.3) There are two main ways to introduce the dot product

Orthogonal Projections

9 Multiplication of Vectors: The Scalar or Dot Product

Mohr s Circle. Academic Resource Center

Addition and Subtraction of Vectors

Basic CAD/CAM. CHAPTER 5: Geometric Transformation

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

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

Vectors 2. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

Computing Euler angles from a rotation matrix

Part I. Basic Maths for Game Design

The Vector or Cross Product

Computer Vision & Digital Image Processing. Edge linking and boundary detection

x(x + 5) x 2 25 (x + 5)(x 5) = x 6(x 4) x ( x 4) + 3

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

Recall the basic property of the transpose (for any A): v A t Aw = v w, v, w R n.

ISOMETRIES OF R n KEITH CONRAD

Chapter 3 Vectors. m = m1 + m2 = 3 kg + 4 kg = 7 kg (3.1)

MAT188H1S Lec0101 Burbulla

egyptigstudentroom.com

5. Orthogonal matrices

5.3 The Cross Product in R 3

CS 4204 Computer Graphics

Vector Spaces. Chapter R 2 through R n

Lecture 7. Matthew T. Mason. Mechanics of Manipulation. Lecture 7. Representing Rotation. Kinematic representation: goals, overview

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

Metrics on SO(3) and Inverse Kinematics

Vectors and Scalars. AP Physics B

Section 1: How will you be tested? This section will give you information about the different types of examination papers that are available.

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA MECHANICAL PRINCIPLES AND APPLICATIONS NQF LEVEL 3 OUTCOME 1 - LOADING SYSTEMS

Geometry of Vectors. 1 Cartesian Coordinates. Carlo Tomasi

Least-Squares Intersection of Lines

Dear Accelerated Pre-Calculus Student:

1. Homogeneous Coordinates. T (1)

3. INNER PRODUCT SPACES

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

Introduction to Matrices for Engineers

Lecture 2: Geometric Image Transformations

Universal Law of Gravitation

LINES AND PLANES CHRIS JOHNSON

Lecture 14: Section 3.3

CIRCLE COORDINATE GEOMETRY

B4 Computational Geometry

Unified Lecture # 4 Vectors

Section 10.5 Rotation of Axes; General Form of a Conic

3D Viewing. Chapter 7. Projections. 3D clipping. OpenGL viewing functions and clipping planes

Solution Guide III-C. 3D Vision. Building Vision for Business. MVTec Software GmbH

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

1 VECTOR SPACES AND SUBSPACES

SAT Subject Math Level 2 Facts & Formulas

Vector Algebra II: Scalar and Vector Products

Problem Set 5 Due: In class Thursday, Oct. 18 Late papers will be accepted until 1:00 PM Friday.

Transcription:

2D Geometric Transformations (Chapter 5 in FVD) 2D Geometric Transformations Question: How do we represent a geometric object in the plane? Answer: For now, assume that objects consist of points and lines. A point is represented b its Cartesian coordinates: (x,). Question: How do we transform a geometric object in the plane? Answer: Let (A,B) be a straight line segment and T a general 2D transformation: T transforms (A,B) into another straight line segment (A,B ), where A =TA and B =TB. 2

Translation Translate (a,b): (x,) (x+a,+b) Translate(2,4) 3 Scale Scale (a,b): (x,) (ax,b) Scale (2,3) Scale (2,3) 4

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

Rotate(θ): Rotation (x,) (x cos(θ)+ sin(θ), -x sin(θ)+ cos(θ)) Rotate(9) Rotate(9) 7 How can we rotate an object without moving its origin (lower left corner)? Translate(-,-) Translate(,) Rotate(9) 8

Shear Shear (a,b): (x,) (x+a,+bx) Shear(,) Shear(,2) 9 Composition of Transformations Rigid transformation: Translation + Rotation (distance preserving). Similarit transformation: Translation + Rotation + uniform Scale (angle preserving). Affine transformation: Translation + Rotation + Scale + Shear (parallelism preserving). All above transformations are groups where Rigid Similarit Affine.

Matrix Notation Let s treat a point (x,) as a 2x matrix (a column vector): x What happens when this vector is multiplied b a 2x2 matrix? a c bx ax + b = d cx + 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 (x,) is represented b a 2x column vector, and we can represent 2D transformations using 2x2 matrices: x' a = ' bx d 2

3 Scale Scale(a,b): (x,) (ax,b) If a or b are negative, we get reflection. = b ax x b a 4 Reflection Reflection through the axis: Reflection through the x axis: Reflection through =x: Reflection through =-x:

Shear, Rotation Shear(a,b): (x,) (x+a,+bx) b ax x + a = + bx Rotate(θ): (x,) (xcosθ+sinθ, -xsinθ + cosθ) cosθ sinθ sinθ x x cosθ + sinθ = cosθ xsinθ + cosθ 5 Composition of Transformations A sequence of transformations can be collapsed into a single matrix: x x [ A][ B][ C] = [ D] Note: order of transformations is important! (otherwise - commutative groups) translate rotate rotate translate 6

Translation x x + a Translation(a,b): + b Problem: Cannot represent translation using 2x2 matrices. Solution: Homogeneous Coordinates 7 Homogeneous Coordinates Homogeneous Coordinates is a mapping from R n to R n+ : ( x, ) ( X, Y, W) = ( tx, t, t) Note: (tx,t,t) all correspond to the same non-homogeneous point (x,). E.g. (2,3,) (6,9,3). Inverse mapping: X ( X, Y, W ), W Y W 8

9 Translation Translate(a,b): Affine transformation now have the following form: + + = b a x x b a f d c e b a 2 (X,Y,W) x X Y W (X,Y,) 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=.

Example: Rotation about an arbitrar point: Actions: θ (x, ) Translate the coordinates so that the origin is at (x, ). Rotate b θ. Translate back. x cosθ sinθ sinθ cosθ x x = cosθ = sinθ sinθ cosθ x ( cosθ ) + 2 ( cosθ ) x sinθ x sin θ Another example: Reflection about an Arbitrar Line: p 2 p L=p +t (p 2 -p )=t p 2 +(-t) p Actions: Translate the coordinates so that P is at the origin. Rotate so that L aligns with the x- axis. Reflect about the x-axis. Rotate back. Translate back. 22

Viewing in 2D (Chapter 6 in FVD) Device Coordinate Viewport World Coordinate Window Object in World 2D:2D mapping 3D:2D mapping Device Coordinates World Coordinates Objects are given in world coordinates. The world is viewed through a worldcoordinate window. The WC window is mapped onto a device coordinate viewport. 23 Viewing in 2D (cont.) Window Viewport Maximum range of screen coordinates World Coordinates Screen Coordinates (Device Coordinates) Window to Viewport Transformation 24

Window to Viewport Transformation (x max, max ) (u max,v max ) (x min, min ) (u min,v min ) Window in World Coordinates Window translated to origin Window scaled to viewport size. Translated to viewport position in screen coordinates. u M wv = T(u min,v min ) S( max -u min v, max -v min x ) T(-x min,- min ) max -x min max - min = u min v min u max -u min x max -x min vmax -v min max - min -x min - min = u max -u min u max -u min x max -x min x max -x (-x min ) + u min min vmax -v min v max -v min max - min max - (- min ) + v min min 25