Modeling Transformation

Slides:



Advertisements
Similar presentations
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Advertisements

COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Transformations.
Geometric Transformations
Transformations II Week 2, Wed Jan 17
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
Computer Graphics with OpenGL 3e
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.
Introduction to Computer Graphics CS 445 / 645 Lecture 5 Transformations Transformations M.C. Escher – Smaller and Smaller (1956)
Geometric Transformation-2D
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Transformations Dr. Amy Zhang.
Graphics Graphics Korea University cgvr.korea.ac.kr 2D Geometric Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Lecture Notes: Computer Graphics.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Geometric Transformations Jehee Lee Seoul National University.
2D Geometric Transformations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
MIT EECS 6.837, Durand and Cutler Transformations.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Computer Graphics 3D Transformations. Translation.
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Multimedia Programming 07: Image Warping Keyframe Animation Departments of Digital Contents Sang Il Park.
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
CSCI 425/ D Mathematical Preliminaries. CSCI 425/525 2 Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system.
Affine Geometry.
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
7.5 Composition Transformations California Standards for Geometry 17: Prove theorems using coordinate geometry 22: Know the effect of rigid motions on.
Recap from Monday DCT and JPEG Point Processing Histogram Normalization Questions: JPEG compression levels Gamma correction.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Image Warping 2D Geometric Transformations
CSCE 441 Computer Graphics: 2D Transformations
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.
Computer Graphics Lecture 15 Fasih ur Rehman. Last Class Combining Transformations Affine versus Rigid body Transformations Homogenous Transformations.
Computer Graphics 2D Transformations
3. Transformation
Geometric Transformations Hearn & Baker Chapter 5
2D Geometric Transformations
Computer Graphics Transformations.
Review: Transformations
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Review: Transformations
Homogeneous Coordinates (Projective Space)
Image Warping (Szeliski Sec 2.1.2)
Image Warping (Szeliski Sec 2.1.2)
Computer Graphics Transformations
Image Warping : Computational Photography
Transformations.
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Image Warping : Computational Photography
Image Warping (Szeliski Sec 2.1.2)
Transformations 2 University of British Columbia
Presentation transcript:

Modeling Transformation

Overview 2D Transformation 3D Transformation Basic 2D transformations Matrix representation Matrix Composition 3D Transformation Basic 3D transformations Same as 2D Transformation Hierarchies Scene graphs Ray casting

Modeling Transformation Specify transformations for objects Allow definitions of objects in own coordinate systems Allow use of object definition multiple times in a scene Ref] Hearn & Baker

2D Modeling Transformations

2D Modeling Transformations

Basic 2D Transformations Translation x’ = x + tx y’ = y + ty Scale x’ = x * sx y’ = y * sy Shear x’ = x + hx * y y’ = y + hy * x Rotation x’ = x * cosq - y * sinq y’ = x * sinq + y * cosq

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

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

2 x 2 Matrices What types of transformations can be represented with a 2x 2 matrix? 2D Rotate around (0, 0) 2D Shear shx = 2

2 x 2 Matrices What types of transformations can be represented with a 2x 2 matrix? 2D Mirror (=Reflection) over Y axis 2D Mirror over (0, 0)

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

Linear Transformations Linear transformations are combinations of … Scale Rotation Shear Mirror (=Reflection) Properties of linear transformations Satisfies: Origin maps to origin Lines map to lines Parallel line remain parallel Ratios are preserved Closed under composition

2D Translation 2D Translation represented by a 3 x 3 matrix Point represented with homogeneous coordinate

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

Basic 2D Transformations Basic 2D Transformations as 3 x 3 matrices

Affine Transformations Affine Transformations are combinations of … Linear transformation Translation Properties of affine transformations Origin does not necessarily map to origin Lines map to lines Parallel line remain parallel Ratios are preserved Closed under composition

Transformation : Rigid-Body / Euclidean Transforms Rigid Body Transformation (=rigid motion) A transform made up of only translation and rotation Preserve the shape of the objects that they act on Preserves distances Preserves angles Rigid / Euclidean Identity Translation Rotation

Transformation : Similitudes / Similarity Transforms Similarity Transformations Preserves angles Translation, Rotation, Isotropic scaling Similitudes Rigid / Euclidean Identity Translation Isotropic Scaling Rotation

Transformation : Linear Transformations Similitudes Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear Translation is not linear

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

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

Projective Transformations Affine transformation Projective warps Properties of projective transformations Origin does not necessarily map to origin Lines map to lines Parallel line do not necessarily remain parallel Ratios are not preserved (but “cross-ratios” are) Closed under composition

Cross-ratio Given any four points A, B, C, and D, taken in order, define their cross ratio as Cross Ratio (ABCD) = cross ratio (ABCD) = cross ratio (A'B'C'D')

Matrix Composition Transformations can be combined by matrix multiplication

Matrix Composition Matrices are a convenient and efficient way to represent a sequence of transformations General purpose representations Hardware matrix multiply Efficiency with premultiplication

Matrix Composition Be aware: order of transformations matter Matrix multiplication is not commutative “Global” “Local”

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)

Matrix Composition Rotate by q around arbitrary point (a, b) M = T(a, b)* R(q) * T(-a, -b) Translate (a, b) to the origin do the rotation about origin translate back Scale by sx, sy around arbitrary point (a, b) M = T(a, b)* S(sx, sy) * T(-a, -b) do the scale about origin

Transformation Game

Overview 2D Transformation 3D Transformation Basic 2D transformations Matrix representation Matrix Composition 3D Transformation Basic 3D transformations Same as 2D Transformation Hierarchies Scene graphs Ray casting

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

Basic 3D transformations

Basic 3D transformations

Non-commutative Composition : Order of Rotations Order of Rotation Affects Final Position X-axis  Z-axis Z-axis  X-axis

Matrix Composition : Rotations in space Rotation about an Arbitrary Axis Rotate about some arbitrary a through angle Rotate about the z axis through an angle The axis a lies in the yz plane Rotate about the x axis through an angle The axis a coincident with the z axis Rotate about the a axis through Same as a rotation about the now coincident z axis Reverse the second rotation about the x axis Reverse the first rotation about the z axis Returning the axis a to its original position z a y x

Transformation Hierarchies Scene may have hierarchy of coordinate systems Each level stores matrix representing transformation from parent’s coordinate system

Transformation Example 1 Well-suited for humanoid characters

Transformation Example 1 Ref] Princeton University

Transformation Example 2 An object may appear in a scene multiple times

Transformation Example 2

Summary Coordinate systems World coordinates Modeling coordinates Representations of 3D modeling transformations 4 x 4 Matrices Scale, rotate, translate, shear, projections, etc. Not arbitrary warps Composition of 3D transformations Matrix multiplication (order matters) Transformation hierarchies