Modeling Transformations

Similar documents
Coordinate transformations. 5554: Packet 8 1

UNIT 2 2D TRANSFORMATIONS

2D TRANSFORMATIONS AND MATRICES

Modeling Transformations

Modeling Transformations

Animating Transformations

Affine Transformation. Edith Law & Mike Terry

Hello, welcome to the video lecture series on Digital Image Processing. So in today's lecture

Warping. 12 May 2015

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

Last week. Machiraju/Zhang/Möller/Fuhrmann

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Transformations Week 9, Lecture 18

Computer Graphics: Geometric Transformations

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Modeling Transformations Revisited

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

2D transformations: An introduction to the maths behind computer graphics

Computer Science 336 Fall 2017 Homework 2

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Computer Graphics Geometric Transformations

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z

2D and 3D Transformations AUI Course Denbigh Starkey

Geometric Transformations

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Modeling Transformations

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

Single View Geometry. Camera model & Orientation + Position estimation. What am I?

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

N-Views (1) Homographies and Projection

Vector Algebra Transformations. Lecture 4

CS4670: Computer Vision

Section III: TRANSFORMATIONS

GEOMETRIC TRANSFORMATIONS AND VIEWING

Scene Graphs & Modeling Transformations COS 426

Perspective projection and Transformations

Transforms. COMP 575/770 Spring 2013

Graphics and Interaction Transformation geometry and homogeneous coordinates

Affine Transformations. Transforming shape models Combining affine transformations Scene graphs, interactor trees Hit tests on transformed shapes

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

2D and 3D Coordinate Systems and Transformations

Ray Casting. Connelly Barnes CS 4810: Graphics

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

CV: 3D sensing and calibration

Global Illumination. Connelly Barnes CS 4810: Graphics

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

Computer Vision cmput 428/615

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Image warping , , Computational Photography Fall 2017, Lecture 10

Moving Objects. We need to move our objects in 3D space.

Coordinate Transformations & Homogeneous Coordinates

Early Fundamentals of Coordinate Changes and Rotation Matrices for 3D Computer Vision

Something noteworthy

Linear and Affine Transformations Coordinate Systems

Overview. Affine Transformations (2D and 3D) Coordinate System Transformations Vectors Rays and Intersections

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Image Filtering, Warping and Sampling

Monday, 12 November 12. Matrices

Graphics Transformations

2D/3D Geometric Transformations and Scene Graphs

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

CS184: Using Quaternions to Represent Rotation

CS354 Computer Graphics Rotations and Quaternions

CS 4204 Computer Graphics

Lecture 18 of 41. Scene Graphs: Rendering Lab 3b: Shader

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Transformations. Questions on Assignment 1? Announcements

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

Modeling Transformations

Chapter 2 - Basic Mathematics for 3D Computer Graphics

Rotation of Ellipsoid

Epipolar Geometry Prof. D. Stricker. With slides from A. Zisserman, S. Lazebnik, Seitz

Transformations: 2D Transforms

Figure 1: 2D arm. Figure 2: 2D arm with labelled angles

UNIT 2. Translation/ Scaling/ Rotation. Unit-02/Lecture-01

Modeling Transformations

CS612 - Algorithms in Bioinformatics

1 Affine and Projective Coordinate Notation

Transformation Algebra

Motion Control (wheeled robots)

Affine Transformations in 3D

Viewing and Projection

Image Warping, Linear Algebra CIS581

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

Visualisation Pipeline : The Virtual Camera

Quaternions and Euler Angles

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations

CS770/870 Spring 2017 Transformations

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

Transcription:

Modeling Transformations Connelly Barnes CS 4810: Graphics Acknowledgment: slides by Connelly Barnes, Misha Kazhdan, Allison Klein, Tom Funkhouser, Adam Finkelstein and David Dobkin

Modeling Transformations Specify transformations for objects Allows definitions of objects in own coordinate systems Allows use of object definition multiple times in a scene H&B Figure 109 2

Overview 2D Transformations Basic 2D transformations Matrix representation Matrix composition 3D Transformations Basic 3D transformations Same as 2D 3

Simple 2D Transformations Translation y P P x

Simple 2D Transformations Translation y x

Simple 2D Transformations Scale y z x

Simple 2D Transformation Rotation (around origin) y z x

2D Modeling Transformations Modeling Coordinates y Scale Translate x Scale Rotate Translate World Coordinates

2D Modeling Transformations Modeling Coordinates y x Let s look at this in detail World Coordinates

2D Modeling Transformations Modeling Coordinates y x

2D Modeling Transformations Modeling Coordinates y x Scale.3,.3 Rotate -90 Translate 5, 3

2D Modeling Transformations Modeling Coordinates y x Scale.3,.3 Rotate -90 Translate 5, 3

2D Modeling Transformations Modeling Coordinates y x Scale.3,.3 Rotate -90 Translate 3, 5 World Coordinates

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ Transformations can be combined (with simple algebra) 14

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ 15

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ (x,y ) (x,y) x = x*sx y = y*sy 16

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ (x,y ) x = (x*sx)*cosθ (y*sy)*sinθ y = (x*sx)*sinθ + (y*sy)*cosθ 17

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ (x,y ) x = ((x*sx)*cosθ (y*sy)*sinθ) + tx y = ((x*sx)*sinθ + (y*sy)*cosθ) + ty 18

Basic 2D Transformations Translation: x = x + tx y = y + ty Scale: x = x * sx y = y * sy Rotation: x = x*cosθ - y*sinθ y = x*sinθ + y*cosθ x = ((x*sx)*cosθ (y*sy)*sinθ) + tx y = ((x*sx)*sinθ + (y*sy)*cosθ) + ty 19

Overview 2D Transformations Basic 2D transformations Matrix representation Matrix composition 3D Transformations Basic 3D transformations Same as 2D 20

Matrix Representation Represent 2D transformation by a matrix Multiply matrix by column vector apply transformation to point

Matrix Representation Transformations combined by multiplication Matrices are a convenient and efficient way to represent a sequence of transformations!

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)? 2D Rotate around (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)? 2D Rotate around (0,0)?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)? 2D Rotate around (0,0)? 2D Mirror over Y axis?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)? 2D Rotate around (0,0)? 2D Mirror over Y axis?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Scale around (0,0)? Like scale with negative scale values 2D Mirror over Y axis?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Translation?

2x2 Matrices What types of transformations can be represented with a 2x2 matrix? 2D Translation? NO! Only linear 2D transformations can be represented with a 2x2 matrix

Linear Transformations Linear transformations are combinations of Scale, and Rotation Properties of linear transformations: Satisfies: Origin maps to origin Lines map to lines Parallel lines remain parallel Closed under composition 32

Linear Transformations Linear transformations are combinations of Scale, and Rotation Properties of linear transformations: Satisfies: Origin maps to origin Lines map to lines Parallel lines remain parallel Closed under composition Translations do not map the origin to the origin 33

Homogeneous Coordinates Add a 3rd coordinate to every 2D point (x, y, w) represents a point at location (x/w, y/w) (x, y, 0) represents a point at infinity (0, 0, 0) is not allowed y 2 1 (2,1,1) or (4,2,2) or (6,3,3) 1 2 x Convenient coordinate system to represent many useful transformations 34

2D Translation 2D translation represented by a 3x3 matrix Point represented with homogeneous coordinates 35

2D Translation 2D translation represented by a 3x3 matrix Point represented with homogeneous coordinates 36

Basic 2D Transformations Basic 2D transformations as 3x3 matrices Translate Scale Rotate

Affine Transformations Affine transformations are combinations of Linear transformations, and Translations Properties of affine transformations: Origin does not necessarily map to origin Lines map to lines Parallel lines remain parallel Closed under composition 38

Projective Transformations Projective transformations Affine transformations, and Projective warps Properties of projective transformations: Origin does not necessarily map to origin Lines map to lines Parallel lines do not necessarily remain parallel Closed under composition 39

Overview 2D Transformations Basic 2D transformations Matrix representation Matrix composition 3D Transformations Basic 3D transformations Same as 2D 40

Matrix Composition Transformations can be combined by matrix multiplication p = T(tx,ty) R(Θ) S(sx,sy) p

Matrix Composition Matrices are a convenient and efficient way to represent a sequence of transformations General purpose representation Hardware matrix multiply Efficiency with pre-multiplication Matrix multiplication is associative p = (T * (R * (S*p) ) ) p = (T*R*S) * p 42

Matrix Composition Be aware: order of transformations matters»matrix multiplication is not commutative p = T * R * S * p Global Local

Matrix Composition Rotate by Θ around arbitrary point (a,b) (a,b) (a,b)

Matrix Composition Rotate by Θ around arbitrary point (a,b) M=T(a,b) * R(Θ) * T(-a,-b) The trick: First, translate (a,b) to the origin. Next, do the rotation about origin. Finally, translate back. (a,b) Scale by sx,sy around arbitrary point (a,b) M=T(a,b) * S(sx,sy) * T(-a,-b) (Use the same trick.) (a,b) 45

Overview 2D Transformations Basic 2D transformations Matrix representation Matrix composition 3D Transformations Basic 3D transformations Same as 2D 46

3D Transformations Same idea as 2D transformations Homogeneous coordinates: (x,y,z,w) 4x4 transformation matrices 47

Basic 3D Transformations Identity Scale Translation

Basic 3D Transformations Pitch-Roll-Yaw Convention: Any rotation can be expressed as the combination of a rotation about the x-, the y-, and the z-axis. Rotate around Z axis: Rotate around Y axis: Rotate around X axis:

Basic 3D Transformations Pitch-Roll-Yaw Convention: Any rotation can be expressed as the combination of a rotation about the x-, the y-, and the z-axis. Rotate around Z axis: How would you rotate Rotate around Y axis: around an arbitrary axis U? Rotate around X axis:

Rotation By ψ Around Arbitrary Axis U Align U with major axis T(a,b,c) = Translate U by (a,b,c) to pass through origin Rx(θ), Ry(φ)= Do two separate rotations around two other axes (e.g. x, and y) by θ and φ degrees to get it aligned with the third (e.g. z) Perform rotation by ψ around the major axis = Rz(ψ) Do inverse of original transformation for alignment y U y U y z x T (a,b,c) z x R y (φ) R x (θ) z U x 51

Rotation By ψ Around Arbitrary Axis U Align U with major axis T(a,b,c) = Translate U by (a,b,c) to pass through origin Rx(θ), Ry(φ)= Do two separate rotations around two other axes (e.g. x, and y) by θ and φ degrees to get it aligned with the third (e.g. z) Perform rotation by ψ around the major axis = Rz(ψ) Do inverse of original transformation for alignment Aligning Transformation 52

Rotation By ψ Around Arbitrary Axis U Homogeneous coordinates matrix to rotate an angle ψ around axis U passing through origin: Here (x, y, z) are components of U (a unit vector) c = cos(ψ) s = sin(ψ) Derivation: this is Rodrigues' rotation formula in matrix form 53