Transformations.

Slides:



Advertisements
Similar presentations
Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
Advertisements

1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Transformations Ed Angel Professor Emeritus of Computer Science
Computer Graphics Lecture 4 Geometry & Transformations.
Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Transformations Rüdiger Westermann Lehrstuhl für Computer Graphik und.
MIT EECS 6.837, Durand and Cutler Transformations.
Transformations II Week 2, Wed Jan 17
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
2D Geometric Transformations
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Lecture 3 – Transformation And Coordinate Systems
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Computer Graphics (Fall 2004) COMS 4160, Lecture 3: Transformations 1
CS 450: Computer Graphics 2D TRANSFORMATIONS
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Mathematical Fundamentals
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
CS 431/636 Advanced Rendering Techniques Dr. David Breen University Crossings 149 Tuesday 6PM  8:50PM Presentation 2 4/7/09.
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformations Dr. Amy Zhang.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Geometric Transformations Jehee Lee Seoul National University.
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
MIT EECS 6.837, Durand and Cutler Transformations.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
1 Chapter 2: Geometric Camera Models Objective: Formulate the geometrical relationships between image and scene measurements Scene: a 3-D function, g(x,y,z)
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
Affine Geometry.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
Cornell CS465 Fall 2004 Lecture 9© 2004 Steve Marschner 1 3D Transformations CS 465 Lecture 9.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Image Warping 2D Geometric Transformations
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
MIT EECS 6.837, Durand and Cutler Transformations & Local Illumination.
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
3. Transformation
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics Transformations.
Review: Transformations
Computer Graphics Transformations.
Review: Transformations
Lecture 2 Transformations
Transformations.
COMP 175: Computer Graphics February 9, 2016
2D Geometric Transformations
Geometrical Transformations
Presentation transcript:

Transformations

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis

Cool Results from Assignment 0 emmav alexg psoto koi scyudits

Notes on Assignments Make sure you turn in a linux or windows executable (so we can test your program) Don't use athena dialup Collaboration Policy Share ideas, not code Ask questions during office hours, or email 6.837-staff@graphics.csail.mit.edu Tell us how much time you spent on each assignment

Quick Review of Last Week Ray representation Generating rays from eyepoint / camera orthographic camera perspective camera Find intersection point & surface normal Primitives: spheres, planes, polygons, triangles, boxes

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis

What is a Transformation? Maps points (x, y) in one coordinate system to points (x', y') in another coordinate system For example, IFS: x' = ax + by + c y' = dx + ey + f

Common Coordinate Systems Object space local to each object World space common to all objects Eye space / Camera space derived from view frustum Screen space indexed according to hardware attributes

Simple Transformations Can be combined Are these operations invertible? Yes, except scale = 0

Transformations are used: Position objects in a scene (modeling) Change the shape of objects Create multiple copies of objects Projection for virtual cameras Animations

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Rigid Body / Euclidean Transforms Similitudes / Similarity Transforms Linear Affine Projective Representing Transformations Combining Transformations Change of Orthonormal Basis

Rigid-Body / Euclidean Transforms Preserves distances Preserves angles Rigid / Euclidean Identity Translation Rotation

Similitudes / Similarity Transforms Preserves angles Similitudes Rigid / Euclidean Identity Translation Isotropic Scaling Rotation

Linear Transformations Similitudes Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear

Linear Transformations L(p + q) = L(p) + L(q) L(ap) = a L(p) Similitudes Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear

Affine Transformations preserves parallel lines Affine Similitudes Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear

Projective Transformations preserves lines Projective Affine Similitudes Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear Perspective

Perspective Projection

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis

How are Transforms Represented? x' = ax + by + c y' = dx + ey + f x' y' a b d e x y c f = + p' = M p + t

Homogeneous Coordinates Add an extra dimension in 2D, we use 3 x 3 matrices In 3D, we use 4 x 4 matrices Each point has an extra value, w x' y' z' w' a e i m b f j n c g k o d h l p x y z w = p' = M p

Homogeneous Coordinates Most of the time w = 1, and we can ignore it If we multiply a homogeneous coordinate by an affine matrix, w is unchanged x' y' z' 1 a e i b f j c g k d h l 1 x y z 1 =

Homogeneous Visualization Divide by w to normalize (homogenize) W = 0? Point at infinity (direction) (0, 0, 1) = (0, 0, 2) = … w = 1 (7, 1, 1) = (14, 2, 2) = … (4, 5, 1) = (8, 10, 2) = … w = 2

Translate (tx, ty, tz) Translate(c,0,0) y Why bother with the extra dimension? Because now translations can be encoded in the matrix! p p' x c x' y' z' 1 x' y' z' 1 1 1 tx ty tz 1 x y z 1 =

Scale (sx, sy, sz) Isotropic (uniform) scaling: sx = sy = sz x' y' z' Scale(s,s,s) y p' Isotropic (uniform) scaling: sx = sy = sz p q' q x x' y' z' 1 sx sy sz 1 x y z 1 =

Rotation About z axis x' y' z' 1 cos θ sin θ -sin θ cos θ 1 1 x y z 1 ZRotate(θ) y p' About z axis θ p x z x' y' z' 1 cos θ sin θ -sin θ cos θ 1 1 x y z 1 =

Rotation About x axis: About y axis: x' y' z' 1 1 cos θ sin θ -sin θ cos θ sin θ -sin θ cos θ 1 x y z 1 = x' y' z' 1 cos θ -sin θ 1 sin θ cos θ 1 x y z 1 =

Rotation Rotate(k, θ) y About (kx, ky, kz), a unit vector on an arbitrary axis (Rodrigues Formula) θ k x z x' y' z' 1 kxkx(1-c)+c kykx(1-c)+kzs kzkx(1-c)-kys kzkx(1-c)-kzs kzkx(1-c)+c kzkx(1-c)-kxs kxkz(1-c)+kys kykz(1-c)-kxs kzkz(1-c)+c 1 x y z 1 = where c = cos θ & s = sin θ

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis

How are transforms combined? Scale then Translate (5,3) Scale(2,2) (2,2) Translate(3,1) (1,1) (3,1) (0,0) (0,0) Use matrix multiplication: p' = T ( S p ) = TS p 1 1 1 3 1 1 2 2 1 2 2 3 1 TS = = Caution: matrix multiplication is NOT commutative!

Non-commutative Composition Scale then Translate: p' = T ( S p ) = TS p (5,3) Scale(2,2) (2,2) Translate(3,1) (1,1) (3,1) (0,0) (0,0) Translate then Scale: p' = S ( T p ) = ST p (8,4) Translate(3,1) (4,2) Scale(2,2) (1,1) (6,2) (3,1) (0,0)

Non-commutative Composition Scale then Translate: p' = T ( S p ) = TS p 1 1 3 1 2 2 1 2 2 3 1 TS = = Translate then Scale: p' = S ( T p ) = ST p 2 1 2 1 1 1 3 1 1 2 2 6 2 ST = =

Outline Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis

Review of Dot Product b a

Change of Orthonormal Basis Given: coordinate frames xyz and uvn point p = (x,y,z) Find: p = (u,v,n) y p x v v u u y x y v p u n x z

Change of Orthonormal Basis y y y . u v v y . v u u x . v x x n x . u z x y z = (x . u) u (y . u) u (z . u) u + (x . v) v (y . v) v (z . v) v + (x . n) n (y . n) n (z . n) n

Change of Orthonormal Basis x y z = (x . u) u (y . u) u (z . u) u + (x . v) v (y . v) v (z . v) v + (x . n) n (y . n) n (z . n) n Substitute into equation for p: p = (x,y,z) = x x + y y + z z p = x [ y [ z [ (x . u) u (y . u) u (z . u) u + (x . v) v (y . v) v (z . v) v + (x . n) n (y . n) n (z . n) n ] + ]

Change of Orthonormal Basis p = x [ y [ z [ (x . u) u (y . u) u (z . u) u + (x . v) v (y . v) v (z . v) v + (x . n) n (y . n) n (z . n) n ] + ] Rewrite: p = [ x (x . u) x (x . v) x (x . n) + y (y . u) y (y . v) y (y . n) + z (z . u) z (z . v) z (z . n) ] u + ] v + ] n

Change of Orthonormal Basis p = [ x (x . u) x (x . v) x (x . n) + y (y . u) y (y . v) y (y . n) + z (z . u) z (z . v) z (z . n) ] u + ] v + ] n p = (u,v,n) = u u + v v + n n Expressed in uvn basis: u v n = x (x . u) x (x . v) x (x . n) + y (y . u) y (y . v) y (y . n) + z (z . u) z (z . v) z (z . n)

Change of Orthonormal Basis u v n = x (x . u) x (x . v) x (x . n) + y (y . u) y (y . v) y (y . n) + z (z . u) z (z . v) z (z . n) In matrix form: where: u v n ux vx nx uy vy ny uz vz nz x y z ux = x . u = uy = y . u etc.

Change of Orthonormal Basis u v n ux vx nx uy vy ny uz vz nz x y z x y z = = M What's M-1, the inverse? x y z xu yu zu xv yv zv xn yn zn u v n ux = x . u = u . x = xu = M-1 = MT

Adding Transformations to the Ray Caster (Assignment 2) Next Time: Adding Transformations to the Ray Caster (Assignment 2)