Transformations 3 University of British Columbia

Slides:



Advertisements
Similar presentations
Geometric Transformations
Advertisements

1 Computer Graphics Chapter 6 2D Transformations.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations III Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Transformations II Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations Week 2,
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
2D Geometric Transformations
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
University of British Columbia © MIchiel van de Panne Geometric Transformations and quick OpenGL intro.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Transformations III Week.
Representation CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
2D Transformations x y x y x y. 2D Transformation Given a 2D object, transformation is to change the object’s Position (translation) Size (scaling) Orientation.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Lecture Notes: Computer Graphics.
2D Geometric Transformations
Transformations Jehee Lee Seoul National University.
©College of Computer and Information Science, Northeastern University CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 12 – October 1, 2012.
Geometrical Transformations 2 Adapted from Fundamentals of Interactive Computer Graphics, Foley and van Dam, pp , by Geb Thomas.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Transformations
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Transformations: Projection CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Affine Geometry.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
Computer Graphics I, Fall 2010 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.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Geometric Transformations for Computer Graphics
Geometric Transformations for Computer Graphics
Computer Graphics 2D Transformations
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Final Review I University of British Columbia
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
Spatcial Description & Transformation
Transformations Objectives
Ch. 2: Rigid Body Motions and Homogeneous Transforms
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
3D Geometric Transformations
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Transformations 6 University of British Columbia
COMP 175: Computer Graphics February 9, 2016
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Geometric Transformations for Computer Graphics
Transformations 4 University of British Columbia
Rigid Body Transformations
Geometric Objects and Transformations (II)
Transformations III Week 3, Mon Jan 21
Transformations II Week 2, Fri Jan 18
Lecture 8: 3D Transforms Li Zhang Spring 2008
Transformations 2 University of British Columbia
TWO DIMENSIONAL TRANSFORMATION
Rigid Body Transformations
Translation in Homogeneous Coordinates
Presentation transcript:

Transformations 3 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Transformations 3 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016

Readings for Transformations 1-5 Shirley/Marschner Ch 6: Transformation Matrices except 6.1.6, 6.3.1 Sect 12.2 Scene Graphs Gortler Ch 2: Linear, Sec 2.5-2.6 Ch 3: Affine Ch 4: Respect Ch 5: Frames in Graphics, 5.3-5.4

Homogeneous Coordinates Review

Homogeneous Coordinates Geometrically cartesian / w x y w w=1 point in 2D cartesian + weight w = point P in 3D homog. coords multiples of (x,y,w) form a line L in 3D all homogeneous points on L represent same 2D cartesian point example: (2,2,1) = (4,4,2) = (1,1,0.5)

Homogeneous Coordinates Summary may seem unintuitive, but they make graphics operations much easier allow all affine transformations to be expressed through matrix multiplication we’ll see even more later... use 3x3 matrices for 2D transformations use 4x4 matrices for 3D transformations

3D Transformations

3D Rotation About Z Axis

3D Rotation in X, Y around x axis: around y axis:

3D Scaling

3D Translation

3D Shear general shear to avoid ambiguity, always say "shear along <axis> in direction of <axis>"

Summary: Transformations translate(a,b,c) scale(a,b,c)

Undoing Transformations: Inverses (R is orthogonal)

Composing Transformations

Composing Transformations translation so translations add

Composing Transformations scaling rotation so scales multiply so rotations add

Composing Transformations Ta Tb = Tb Ta, but Ra Rb != Rb Ra and Ta Rb != Rb Ta translations commute rotations around same axis commute rotations around different axes do not commute rotations and translations do not commute

Composing Transformations suppose we want Fh FW

Composing Transformations suppose we want Rotate(z,-90) Fh FW FW Fh

Composing Transformations suppose we want Rotate(z,-90) Translate(2,3,0) Fh Fh FW FW FW Fh

Composing Transformations suppose we want Rotate(z,-90) Translate(2,3,0) Fh Fh FW FW FW Fh

Composing Transformations which direction to read?

Composing Transformations which direction to read? right to left interpret operations wrt fixed coordinates moving object left to right interpret operations wrt local coordinates changing coordinate system in GL, cannot move object once it is drawn!! object specified as set of coordinates wrt specific coord sys

Correction: Composing Transformations which direction to read? right to left interpret operations wrt fixed global coordinates moving object draw thing rotate thing by 45 degrees wrt fixed global coords translate it (2, 3) over wrt fixed global coordinates

Correction: Composing Transformations which direction to read? left to right interpret operations wrt local coordinates changing coordinate system translate coordinate system (2, 3) over rotate coordinate system 45 degrees wrt LOCAL origin draw object in current coordinate system

Composing Transformations which direction to read? right to left interpret operations wrt fixed coordinates moving object left to right interpret operations wrt local coordinates changing coordinate system GL updates current matrix with postmultiply translate(2,3,0); rotate(-90,0,0,1); vertex(1,1,1); specify vector last, in final coordinate system first matrix to affect it is specified second-to-last GL pipeline ordering!

Interpreting Transformations moving object translate by (-1,0) (1,1) (2,1) intuitive? changing coordinate system (1,1) GL same relative position between object and basis vectors

Matrix Composition matrices are convenient, efficient way to represent series of transformations general purpose representation hardware matrix multiply matrix multiplication is associative p′ = (T*(R*(S*p))) p′ = (T*R*S)*p procedure correctly order your matrices! multiply matrices together result is one matrix, multiply vertices by this matrix all vertices easily transformed with one matrix multiply