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

Similar documents
Last week. Machiraju/Zhang/Möller

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

2D Object Definition (1/3)

Overview. By end of the week:

Vector Algebra Transformations. Lecture 4

Transformations Week 9, Lecture 18

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

Transforms. COMP 575/770 Spring 2013

Linear and Affine Transformations Coordinate Systems

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

Computer Graphics: Geometric Transformations

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

Graphics Pipeline 2D Geometric Transformations

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

Computer Graphics Geometric Transformations

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

CT5510: Computer Graphics. Transformation BOCHANG MOON

Homogeneous coordinates, lines, screws and twists

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

2D and 3D Coordinate Systems and Transformations

GEOMETRIC TRANSFORMATIONS AND VIEWING

Geometric Transformations

2D/3D Geometric Transformations and Scene Graphs

Section III: TRANSFORMATIONS

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

UNIT 2 2D TRANSFORMATIONS

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

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

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

CS452/552; EE465/505. Geometry Transformations

Image warping , , Computational Photography Fall 2017, Lecture 10

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

Coordinate transformations. 5554: Packet 8 1

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

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

2D TRANSFORMATIONS AND MATRICES

Models and The Viewing Pipeline. Jian Huang CS456

3D GRAPHICS. design. animate. render

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

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

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

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

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

Viewing with Computers (OpenGL)

Coordinate Transformations & Homogeneous Coordinates

COMP3421. Vector geometry, Clipping

2D and 3D Transformations AUI Course Denbigh Starkey

window World space (Object space)

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

Lecture 5 2D Transformation

Today s Topics. 3. Transformations in 2D. 4. Coordinate-free geometry. 5. 3D Objects (curves & surfaces) 6. Transformations in 3D

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

CS354 Computer Graphics Rotations and Quaternions

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

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

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

Drawing in 3D (viewing, projection, and the rest of the pipeline)

3D Geometry and Camera Calibration

Lecture 9: Transformations. CITS3003 Graphics & Animation

Warping. 12 May 2015

CS 130 Final. Fall 2015

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

3-D D Euclidean Space - Vectors

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

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

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Modeling Transformations

N-Views (1) Homographies and Projection

Advanced Computer Graphics Transformations. Matthias Teschner

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

XPM 2D Transformations Week 2, Lecture 3

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

Perspective projection and Transformations

Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

Chapter 5. Projections and Rendering

Computer Vision I - Appearance-based Matching and Projective Geometry

Visual Recognition: Image Formation

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Projection Lecture Series

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

XPM 2D Transformations Week 2, Lecture 3

CS 4204 Computer Graphics

Transformations. Questions on Assignment 1? Announcements

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

CSE452 Computer Graphics

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation.

Transformations: 2D Transforms

Viewing. Reading: Angel Ch.5

Chapter 2 A top-down approach - How to make shaded images?

Part 3: 2D Transformation

MET71 COMPUTER AIDED DESIGN

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

Chapter 2 - Basic Mathematics for 3D Computer Graphics

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7

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

Specifying Complex Scenes

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

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

Transcription:

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

Geometry basics Scalar, point, and vector Vector space and affine space Basic point and vector operations Sided-ness test Lines, planes, and triangles Linear independence Coordinate systems and frames Machiraju/Zhang/Möller/Fuhrmann 2

From one CS to another Express point given in one frame/cs in another CS In 2D, need to solve system of two equations Assume the two CS have the same origin P = (1, 2) T P = (x, y) T Basis: (1, 1) T and (0, 1) T New set of basis: (-1,1) T and (1, 0) T Need to find x and y such that 1*(1,1) T + 2*(0,1) T = x*(-1,1) T + y*(1,0) T Alternatively (in matrix notation) Machiraju/Zhang/Möller/Fuhrmann 3

2D Transformations Introduction to Computer Graphics Torsten Möller Machiraju/Zhang/Möller/Fuhrmann

Graphics Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Texture/ Color Realism Machiraju/Zhang/Möller/Fuhrmann 5

Reading Chapter 4 of Angel Chapter 10 of Foley, van Dam, Machiraju/Zhang/Möller/Fuhrmann 6

Schedule Geometry basics Affine transformations Use of homogeneous coordinates Concatenation of transformations 3D transformations Transformation of coordinate systems Transform the transforms Transformations in OpenGL Machiraju/Zhang/Möller/Fuhrmann 7

Basic transformations The most basic ones Translation Scaling Rotation Shear And others, e.g., perspective transform, projection, etc. Basic types of transformations Rigid-body: preserves length and angle Affine: preserves parallel lines, not angles or lengths Free-form: anything goes Machiraju/Zhang/Möller/Fuhrmann 8

Translation in 2D Machiraju/Zhang/Möller/Fuhrmann 9

Scaling in 2D Machiraju/Zhang/Möller/Fuhrmann 10

Rotation about origin Positive angles: counterclockwise For negative angles Machiraju/Zhang/Möller/Fuhrmann 11

Derivation of rotation matrix Make use of polar coordinates: Machiraju/Zhang/Möller/Fuhrmann 12

Shearing in 2D Machiraju/Zhang/Möller/Fuhrmann 13

Schedule Geometry basics Affine transformations Use of homogeneous coordinates Concatenation of transformations 3D transformations Transformation of coordinate systems Transform the transforms Transformations in OpenGL Machiraju/Zhang/Möller/Fuhrmann 14

Homogeneous coordinates Only translation cannot be expressed as matrix-vector multiplications But we can add a third coordinate Homogeneous coordinates for 2D points (x, y) turns into (x, y, W) if (x, y, W) and (x', y', W ) are multiples of one another, they represent the same point typically, W 0. points with W = 0 are points at infinity Machiraju/Zhang/Möller/Fuhrmann 15

2D Homogeneous Coordinates Cartesian coordinates of the homogenous point (x, y, W): x/w, y/w (divide through by W) Our typical homogenized points: (x, y, 1) Connection to 3D? (x, y, 1) represents a 3D point on the plane W = 1 A homogeneous point is a line in 3D, through the origin Machiraju/Zhang/Möller/Fuhrmann 16

Transformation in homogeneous coordinates General form of affine (linear) transformation E.g., 2D translation in homogeneous coordinates Machiraju/Zhang/Möller/Fuhrmann 17

Basic 2D transformations Machiraju/Zhang/Möller/Fuhrmann 18

Inverse of transformations Inverse of T(dx, dy): T( dx, dy) T( dx, dy) = T(dx, dy) 1 R(θ) 1 = R( θ) S(sx, sy) 1 = S(1/sx, 1/sy) Sh(ax) 1 = Sh( ax) Machiraju/Zhang/Möller/Fuhrmann 19

Duality 2D line equation Duality of 3D points to a line 3D plane equation: Duality of 4D points to a plane Machiraju/Zhang/Möller/Fuhrmann 20

Schedule Geometry basics Affine transformations Use of homogeneous coordinates Concatenation of transformations 3D transformations Transformation of coordinate systems Transform the transforms Transformations in OpenGL Machiraju/Zhang/Möller/Fuhrmann 21

Compound transformations Often we need many transforms to build objects (or to direct them) e.g., rotation about an arbitrary point/line? Concatenate basic transforms sequentially This corresponds to multiplication of the transform matrices, thanks to homogeneous coordinates Machiraju/Zhang/Möller/Fuhrmann 22

Compound translation What happens when a point goes through T(d x1, d y1 ) and then T(d x2, d y2 )? Combined translation: T(d x1 +d x2, d y1 +d y2 ) Concatenation of transformations: matrix multiplication Machiraju/Zhang/Möller/Fuhrmann 23

Compound rotation What happens when a point goes through R(θ) and then R(φ)? Combined rotation: R(θ + φ) Scaling or shearing (in one direction) is similar These concatenations are commutative Machiraju/Zhang/Möller/Fuhrmann 24

Commutativity Transformations that do commute: Translate translate Rotate rotate (around the same axis) Scale scale Uniform scale rotate Shear in x (y) shear in x (y), etc. In general, the order in which transformations are composed is important After all, matrix multiplications are not commutative Machiraju/Zhang/Möller/Fuhrmann 25

Commutativity the order in which we compose matrices is important: matrix multiplication does not commute y y y z X then Z x z x z x y y Z then X z x z x Machiraju/Zhang/Möller/Fuhrmann 26

Example (X3d) Machiraju/Zhang/Möller/Fuhrmann

Rotation about an arbitrary point Break it down into easier problems: Translate to the origin: T( x1, y1) Rotate: R(q) And translate back: T(x1, y1) Machiraju/Zhang/Möller/Fuhrmann 28

Rotation about an arbitrary point Compound transformation (non-commutative): T(x1, y1) R(q) T( x1, y1) P = T(x1, y1)r(q)t( x1, y1)p = AP Why combine these matrices into a single A? Machiraju/Zhang/Möller/Fuhrmann 29

Another example Compound transformation: T(x2, y2) R(90 o ) S(sx, sy) T( x1, y1) Machiraju/Zhang/Möller/Fuhrmann 30

Rigid-body transformation A transformation matrix where the upper 2 2 submatrix is orthonormal, preserves angles and lengths called rigid-body transformation any sequence of translation and rotation give a rigid-body transformation Machiraju/Zhang/Möller/Fuhrmann 31

Affine transformation Preserves parallelism, not lengths or angles Unit cube Rot( 45 o ) Scale in x Product of a sequence of translation, scaling, rotation, and shear is affine Machiraju/Zhang/Möller/Fuhrmann 32

Types of Transforms Classification: Euclidean (preserves angles) translation, rotation, uniform scale Affine (preserves parallel lines) Euclidean plus non-uniform scale, shearing Projective (preserves lines) Isometry (preserves distance) Reflection, rigid body motion Nonlinear (lines become curves) Twists, Bends, warps, morphs Machiraju/Zhang/Möller/Fuhrmann 33

Window-To-Viewport Transformation Important example of compound transform World coords : space users work in need to map world to the screen window in world-coordinate space and viewport in screen coordinate space Machiraju/Zhang/Möller/Fuhrmann 34

Window-To-Viewport Transformation (2) one can specify non-uniform scaling results in distorted images What property of window and viewport indicates whether the mapping will distort the images? Machiraju/Zhang/Möller/Fuhrmann 35

Window-To-Viewport Transformation (3) Specify transform in matrix form Machiraju/Zhang/Möller/Fuhrmann 36

Next Lecture: 3-dimensional transformations Homogeneous coordinates Machiraju/Zhang/Möller/Fuhrmann