2D Transformations. 7 February 2017 Week 5-2D Transformations 1

Similar documents
GRAFIKA KOMPUTER. ~ M. Ali Fauzi

What and Why Transformations?

4. Two Dimensional Transformations

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

CS F-07 Objects in 2D 1

SPAREPARTSCATALOG: CONNECTORS SPARE CONNECTORS KTM ART.-NR.: 3CM EN

Two Dimensional Viewing

SPARE CONNECTORS KTM 2014

What does OpenGL do?

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

Transformations. Examples of transformations: shear. scaling

Homogeneous Coordinates

UYM-UOM-UOY-UOD- UOS-UOB-UOR

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

Transformations II. Week 2, Wed Jan 17

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Image Warping. Some slides from Steve Seitz

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Modeling Transformations Revisited

6. Modelview Transformations

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

More on Transformations. COS 426, Spring 2019 Princeton University

Section 3.1: Introduction to Linear Equations in 2 Variables Section 3.2: Graphing by Plotting Points and Finding Intercepts

2D and 3D Transformations AUI Course Denbigh Starkey

2-Type Series Pressurized Closures

Image Warping (Szeliski Sec 2.1.2)

Modeling Transformations

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

MEM380 Applied Autonomous Robots Winter Robot Kinematics

3D Geometry and Camera Calibration

CS559: Computer Graphics

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Modeling Transformations

Modeling Transformations

Image Warping. Some slides from Steve Seitz

3-Dimensional Viewing

Image Warping CSE399b, Spring 07 Computer Vision

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

Transformations using matrices

The 3-D Graphics Rendering Pipeline

22ND CENTURY_J1.xls Government Site Hourly Rate

CS770/870 Spring 2017 Transformations

3D Coordinates & Transformations

Scene Graphs & Modeling Transformations COS 426

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

High Dimensional Rendering in OpenGL

IMGD The Game Development Process: 3D Modeling and Transformations

Appendix 5-1: Attachment J.1 Pricing Table -1: IMS Ceiling Loaded Rates at Contractor Site

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation

Topic 2 Transformations of Functions

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

CS4670: Computer Vision

Transformations III. Week 2, Fri Jan 19

CS Computer Graphics: Transformations & The Synthetic Camera

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

Modeling Transformations

Shifting, Reflecting, and Stretching Graphs

Modeling Transformations

CSCI-4530/6530 Advanced Computer Graphics

CSCI-4530/6530 Advanced Computer Graphics

Connecticut Common Core Algebra 1 Curriculum. Professional Development Materials. Unit 4 Linear Functions

FINDING SEMI-TRANSITIVE ORIENTATIONS OF GRAPHS

Unit 2: Function Transformation Chapter 1

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

Section 9.3: Functions and their Graphs

Introduction to Homogeneous Transformations & Robot Kinematics

How Computers Work. Processor and Main Memory. Roger Young

Systems of Linear Equations

CMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics

BEC Machine Products 171 Ruth Rd Harleysville, Pa T. (215) F: (215) E:

FTA1000 Cameras, Optics and Illuminators

LESSON 3.1 INTRODUCTION TO GRAPHING

Lecture 4: Viewing. Topics:

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

Math 20C. Lecture Examples.

CS 548: COMPUTER GRAPHICS REVIEW: OVERVIEW OF POLYGONS SPRING 2015 DR. MICHAEL J. REALE

Introduction to Homogeneous Transformations & Robot Kinematics

Lines and Their Slopes

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Multiple Choice Questions Consider the following method and code segment.

Sect Linear Inequalities in Two Variables

UNIT 2 2D TRANSFORMATIONS

Warping, Morphing and Mosaics

Transformations. which the book introduces in this chapter. If you shift the graph of y 1 x to the left 2 units and up 3 units, the

CS 335 Graphics and Multimedia. Geometric Warping

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

3-2. Families of Graphs. Look Back. OBJECTIVES Identify transformations of simple graphs. Sketch graphs of related functions.

Name Class Date. subtract 3 from each side. w 5z z 5 2 w p - 9 = = 15 + k = 10m. 10. n =

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Name: Thus, y-intercept is (0,40) (d) y-intercept: Set x = 0: Cover the x term with your finger: 2x + 6y = 240 Solve that equation: 6y = 24 y = 4

To Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1

CS 450: COMPUTER GRAPHICS 2D TRANSFORMATIONS SPRING 2016 DR. MICHAEL J. REALE

Name Parent Function Library Date Sheilah Chason Math 444

Transformations of Functions. 1. Shifting, reflecting, and stretching graphs Symmetry of functions and equations

Using the same procedure that was used in Project 5, enter matrix A and its label into an Excel spreadsheet:

Graphs and Functions

CS 351: Perspective Viewing

Transcription:

2D Transformations 7 Februar 27 Week 5-2D Transformations

Matri math Is there a difference between possible representations? a c b e d f ae bf ce df a c b d e f ae cf be df a b c d e f ae bf ce df 7 Februar 27 Week 5-2D Transformations 2

Pick a convention We ll use the column-vector representation for a point. Which implies that we use pre-multiplication of the transformation it appears before the point to be transformed in the equation. A C B D A B C D What if we needed to switch to the other convention (to use some librar, for instance)? How could we do that? 7 Februar 27 Week 5-2D Transformations 3

A translation moves all points in an object along the same straight-line path to new positions. Translation The path is represented b a vector, called the translation or shift vector. We can write the components: p' = p + t p' = p + t or in matri form: P' = P + T 7 Februar 27 Week 5-2D Transformations 4

Rotation A rotation repositions all points in an object along a circular path in the plane centered at the pivot point. First, we ll assume the pivot is at the origin. We can write the components: p' = p cos p sin p' = p sin + p cos or in matri form: P' = R P 7 Februar 27 Week 5-2D Transformations 5

7 Februar 27 Week 5-2D Transformations 6 More rotation Another convention, we ll take to be counterclockwise, as in our eample. R, the rotation matri, looks like: cos sin sin cos R cos sin sin cos cos sin sin cos 9 (5,) ), ( 5 5 5 cos9 sin9 5 sin9 cos9 5

Scaling alters the size of an object. Scales are about the the origin. Scale factors between and shrink objects. Scale factors greater than enlarge objects. We can write the components: p' = s p p' = s p or in matri form: P' = S P The scale factors need not be the same in each direction. Scaling 7 Februar 27 Week 5-2D Transformations 7

We write a scale matri as: More scaling S s s Scaling also translates objects; awa from the origin if the scale factor is greater than, or towards the origin if the scale factor is less than. What does scaling b do? What is that matri called? What does scaling b a negative value do? 7 Februar 27 Week 5-2D Transformations 8

Combining transformations We have a general transformation of a point: P' = M P + A When we scale or rotate, we set M, and A is the additive identit. When we translate, we set A, and M is the multiplicative identit. To combine multiple transformations, we must eplicitl compute each transformed point. It d be nicer if we could use the same matri operation all the time. But we d have to combine multiplication and addition into a single operation. 7 Februar 27 Week 5-2D Transformations 9

A less than obvious solution Let s move our problem into 3D. Let point (, ) in 2D be represented b point (,, ) in the new space. w Scaling our new point b an value a puts us somewhere along a particular line: (a, a, a). We can alwas map back to the original 2D point b dividing b the last coordinate. The fact that all the points along each line can be mapped back to the same point in 2D gives this coordinate sstem its name homogeneous coordinates. (,,) (,,) w =, 7 Februar 27 Week 5-2D Transformations

So what? Well, now we can wedge some addition into our multiplicative matri. Our point now has three coordinates. So our matri is needs to be 33. We want a matri which gives us: t t 7 Februar 27 Week 5-2D Transformations

7 Februar 27 Week 5-2D Transformations 2 Now what? t t t t

7 Februar 27 Week 5-2D Transformations 3 And? Rotations: Scales: cos sin sin cos s s

What of it? We can represent an of our three transformations as a single matri. No special cases when transforming a point matri vector. Composite transformations matri matri. Composite transformations: Rotate about an arbitrar point translate, rotate, translate Scale about an arbitrar point translate, scale, translate Change coordinate sstems translate, rotate, scale Does the order of operations matter? 7 Februar 27 Week 5-2D Transformations 4

7 Februar 27 Week 5-2D Transformations 5 Is matri multiplication associative? dhl cfl dgj cej dhk cfk dgi cei bhl afl bgj aej bhk afk bgi aei l k j i dh cf dg ce bh af bg ae l k j i h g f e d c b a dhl dgj cfl cej dhk dgi cfk cei bhl bgj afl aej bhk bgi afk aei hl gj hk gi fl ej fk ei d c b a l k j i h g f e d c b a

Is matri multiplication commutative? a c b d e g f h ae bg ce dg af cf bh dh e g f h a c b d ea ga fc hc eb gb fd hd 7 Februar 27 Week 5-2D Transformations 6

Order of operations So, it does matter. Let s look at an eample: 7 Februar 27 Week 5-2D Transformations 7

Useful compositions Rotate about a pivot point: T(pivot) R() T( pivot) P Scale about a fied point: T(fied) S(scale) T( fied) P General scaling directions: R( ) S(scale) R() P 7 Februar 27 Week 5-2D Transformations 8

7 Februar 27 Week 5-2D Transformations 9 Other transformations Reflection: -ais -ais

7 Februar 27 Week 5-2D Transformations 2 Other transformations Reflection: origin line =

7 Februar 27 Week 5-2D Transformations 2 Other transformations Shear: -direction -direction sh sh

Coordinate sstem transformations We often need to transform points from one coordinate sstem to another:. We might model an object in non-cartesian space (polar) 2. Objects ma be described in their own local sstem 3. Other reasons: tetures, displa, etc 7 Februar 27 Week 5-2D Transformations 22

Matri multiplication So we can do a lot with one basic operation. We d better make this operation as fast as possible. Let s start with the form of the matri: M a d e f c Wh haven t we used the bottom row of the matri? b 7 Februar 27 Week 5-2D Transformations 23

7 Februar 27 Week 5-2D Transformations 24 Matri multiplication Since we don t use the bottom row of the 2D transformation matri, we could have a special transform composition operation: f e d c b a M 2 l k j i h g M 2 f el di ek dh ej dg c bl ai bk ah bj ag l k j i h g f e d c b a M M