Lecture 8: 3D Transforms Li Zhang Spring 2008

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
Computer Graphics Lecture 4 Geometry & Transformations.
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
2D Geometric Transformations
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
Ch. 2: Rigid Body Motions and Homogeneous Transforms
Outline for Today More math… Finish linear algebra: Matrix composition
3-D Geometry.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Computer Graphics (Fall 2004) COMS 4160, Lecture 3: Transformations 1
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
CS 450: Computer Graphics 2D TRANSFORMATIONS
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
ME/ECE Professor N. J. Ferrier Forward Kinematics Professor Nicola Ferrier ME Room 2246,
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
Mathematical Fundamentals
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
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.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Affine Transformations.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
2/17/04© University of Wisconsin, CS559 Spring 2004 Last Time Resampling –Ideal reconstruction –You can only ideally reconstruct band-limited functions.
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Affine Geometry.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
Computer Graphics Matrices
3D Coordinate Systems o3D computer graphics involves the additional dimension of depth, allowing more realistic representations of 3D objects in the real.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
CS559: Computer Graphics Lecture 5: Color and Edge Li Zhang Spring 2008 Most Slides from Stephen Chenney.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
Geometric Transformations
Spatcial Description & Transformation
Ch. 2: Rigid Body Motions and Homogeneous Transforms
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
2D Transformations with Matrices
Review: Transformations
Computer Graphics Transformations.
3D Transformations Source & Courtesy: University of Wisconsin,
Review: Transformations
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Lecture 8: Dynamic Range and Trichromacy Li Zhang Spring 2008
COMP 175: Computer Graphics February 9, 2016
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Transformations 3 University of British Columbia
Chapter IV Spaces and Transforms
(c) 2002 University of Wisconsin, CS 559
(c) University of Wisconsin, CS559
Geometric Objects and Transformations (II)
CSCE441: Computer Graphics 2D/3D Transformations
Linear Algebra A gentle introduction
Presentation transcript:

Lecture 8: 3D Transforms Li Zhang Spring 2008 CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney

Today Finish Color space 3D Transforms and Coordinate system Reading: Shirley ch 6 Last time, we talked how to sample a continuous light pattern into a discrete iamge. How to resample an discrete at different resolution or sampling rate. This lecture, we’ll look at what operation we can do on a discrete image. We’ll start with convolution

RGB and HSV Different ways to represent/parameterize color Black (0,0,0) Red (1,0,0) Green(0,1,0) Blue (0,0,1) Magenta (0,1,1) White(1,1,1) Yellow (1,1,0) Cyan (0,1,1) Different ways to represent/parameterize color

Photoshop Color Picker

L-A-B Color Space L-A-B L: luminance/Brightness A: position between magenta and green (negative values indicate green while positive values indicate magenta) B: position between yellow and blue (negative values indicate blue and positive values indicate yellow) http://en.wikipedia.org/wiki/Lab_color_space http://en.wikipedia.org/wiki/CIE_1931_color_space

Spatial resolution and color G In the next few slides, I’ll change these individual channels to you will see how the modification will change the final look of the color image. B original

Blurring the G component original processed

Blurring the R component original processed

Blurring the B component processed original

Lab Color Component L A rotation of the color coordinates into directions that are more perceptually meaningful: L: luminance, a: magenta-green, b: blue-yellow a b

Bluring L L a b processed original

Bluring a L a b processed original

Bluring b L a b processed original

Application to image compression (compression is about hiding differences from the true image where you can’t see them).

Where to now… We are now done with images We will spend several weeks on the mechanics of 3D graphics 3D Transform Coordinate systems and Viewing Drawing lines and polygons Lighting and shading We will finish the semester with modeling and some additional topics

3D Graphics Pipeline Rendering Modeling (Creating, shading images from geometry, lighting, materials) Modeling (Creating 3D Geometry)

3D Graphics Pipeline Rendering Modeling (Creating, shading images from geometry, lighting, materials) Modeling (Creating 3D Geometry) Want to place it at correct location in the world Want to view it from different angles Want to scale it to make it bigger or smaller Need transformation between coordinate systems -- Represent transformations using matrices and matrix-vector multiplications.

Recall: All 2D Linear Transformations Linear transformations are combinations of … Scale, Rotation, Shear, and Mirror

2D Rotation Rotate counter-clockwise about the origin by an angle  y x x

Rotating About An Arbitrary Point What happens when you apply a rotation transformation to an object that is not at the origin? y ? Imaging, I stand here. I want to rotate the screen of my laptop so that it’s facing me. Can we just apply the rotation matrix? x

Rotating About An Arbitrary Point What happens when you apply a rotation transformation to an object that is not at the origin? It translates as well y x x

How Do We Fix it? How do we rotate an about an arbitrary point? Hint: we know how to rotate about the origin of a coordinate system

Rotating About An Arbitrary Point x x y y What is this tranformation? Simple transfomration can be concatentated to do complex things. x x

Scaling an Object not at the Origin What happens if you apply the scaling transformation to an object not at the origin? Based on the rotating about a point composition, what should you do to resize an object about its own center? The center will move

Back to Rotation About a Pt Say R is the rotation matrix to apply, and p is the point about which to rotate Translation to Origin: Rotation: Translate back: How to express all the transformation using matrix multiplication? Not to worry about multiply rotation and translation together

Homogeneous Coordinates Use three numbers to represent a point Translation can now be done with matrix multiplication!

Homogeneous Coordinates Use three numbers to represent a point Translation can now be done with matrix multiplication! Only need to the conversion between at the end of transformation chain

Basic Transformations Translation: Rotation: Scaling:

Composing rotations, scales How to computer inverse of RS Rotation and scaling are not commutative.

Inverting Composite Transforms Say I want to invert a combination of 3 transforms Option 1: Find composite matrix, invert Option 2: Invert each transform and swap order

Inverting Composite Transforms Say I want to invert a combination of 3 transforms Option 1: Find composite matrix, invert Option 2: Invert each transform and swap order Obvious from properties of matrices

Homogeneous Transform Advantages Unified view of transformation as matrix multiplication Easier in hardware and software To compose transformations, simply multiply matrices Order matters: BA vs AB Allows for transforming directional vectors Allows for non-affine transformations: Perspective projections!

Directions vs. Points We have been talking about transforming points Directions are also important in graphics Viewing directions Normal vectors Ray directions Directions are represented by vectors, like points, and can be transformed, but not like points x y Direction is translation invariant (1,1) (-2,-1)

Transforming Directions Say I define a direction as the difference of two points: d=a–b This represents the direction of the line between two points Now I translate the points by the same amount: a’=a+t, b’=b+t d’=a’–b’=d How should I transform d? Laptop screen is standing upward, no matter where I stand.

Homogeneous Directions Translation does not affect directions! Homogeneous coordinates give us a very clean way of handling this The direction (x,y) becomes the homogeneous direction (x,y,0) The correct thing happens for rotation and scaling also Scaling changes the length of the vector, but not the direction Normal vectors are slightly different – we’ll see more later

Transforming normal vectors tangent normal tangent’ normal’ M How do we describe the orthogonal relationship between two vectors mathematically? Tangent vector can be transformed in a standard way But normal vectors can not for a general affine transform If M is a rotation,

3D Transformations Homogeneous coordinates: (x,y,z)=(wx,wy,wz,w) Transformations are now represented as 4x4 matrices

3D Affine Transform

3D Rotation Rotation in 3D is about an axis in 3D space passing through the origin Using a matrix representation, any matrix with an orthonormal top-left 3x3 sub-matrix is a rotation Rows/columns are mutually orthogonal (0 dot product) Determinant is 1 Implies columns are also orthogonal, and that the transpose is equal to the inverse

Specifying a rotation matrix Because of the redundency, we can generate an arbitray matrix. Let’s look at the simplest case. Why so? Consider r1, r2, r3 as reseult of unit vectors This implies how many degree of freedom does a rotation matrix have? http://pratt.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm

Specifying a rotation matrix Euler angles: Specify how much to rotate about X, then how much about Y, then how much about Z Hard to think about, and hard to compose

Alternative Representations Specify the axis and the angle (OpenGL method) Hard to compose multiple rotations A rotation by an angle around axis specified by the unit vector is given by http://mathworld.wolfram.com/RodriguesRotationFormula.html

Non-Commutativity Not Commutative (unlike in 2D)!! Rotate by x, then y is not same as y then x Order of applying rotations does matter Follows from matrix multiplication not commutative R1 * R2 is not the same as R2 * R1

Other Rotation Issues Rotation is about an axis at the origin For rotation about an arbitrary axis, use the same trick as in 2D: Translate the axis to the origin, rotate, and translate back again

Transformation Leftovers Scale, shear etc extend naturally from 2D to 3D Rotation and Translation are the rigid-body transformations: Do not change lengths or angles, so a body does not deform when transformed

Coordinate Frames All of discussion in terms of operating on points But can also change coordinate system Example, motion means either point moves backward, or coordinate system moves forward

Coordinate Frames: Rotations We can think of point rotation as coordinate rotation The coord of P’ is the same as P in the new coordinate system u-v That is to say, equation Is it correct? Let’s verify it in another way. projection

Geometric Interpretation 3D Rotations Rows of matrix are 3 unit vectors of new coord frame Can construct rotation matrix from 3 orthonormal vectors Effectively, projections of point into new coord frame