Chapter IV Spaces and Transforms

Slides:



Advertisements
Similar presentations
1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Advertisements

Transformations Ed Angel Professor Emeritus of Computer Science
Geometric Transformations
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
MSU CSE 803 Fall 2008 Stockman1 CV: 3D sensing and calibration Coordinate system changes; perspective transformation; Stereo and structured light.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CS 4731: Computer Graphics Lecture 8: 3D Affine transforms Emmanuel Agu.
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.
CS 450: Computer Graphics 2D TRANSFORMATIONS
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
Rotations and Translations
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.
Transformation of Graphics
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
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.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Geometric Transformations
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Transformation.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Geometric Transformations
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Computer Graphics I, Fall 2010 Transformations.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Computer Graphic 2 D Transformation.
CSCE 441 Computer Graphics: 2D Transformations
Modeling Transformation
Robotic Arms and Matrices By Chris Wong and Chris Marino.
1 Part B Tensors Or, inverting The graph above represents a transformation of coordinates when the system is rotated at an angle  CCW.
Computer Graphics 2D Transformations
Transforms.
Geometric Transformations
3. Transformation
Geometric Transformations Hearn & Baker Chapter 5
2D Transformations By: KanwarjeetSingh
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
2D Transformations with Matrices
Review: Transformations
3D Geometric Transformations
Chapter 5 2-D Transformations.
Computer Graphics Transformations.
Review: Transformations
2D Transformations y y x x y x.
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
2-D Geometry.
Geometric Camera Models
Chapter II Mathematics: Basics
Chapter V Vertex Processing
2D Geometric Transformations
Transformations Ed Angel
Geometric Objects and Transformations (II)
TWO DIMENSIONAL TRANSFORMATION
Translation in Homogeneous Coordinates
Presentation transcript:

Chapter IV Spaces and Transforms

Scaling 2D scaling with the scaling factors, sx and sy Examples When a polygon is scaled, all of its vertices are processed by the same scaling matrix.

Rotation 2D rotation

Rotation (cont’d) By default, the rotation is counter-clockwise. The matrix for the clockwise rotation by θ is obtained by inserting -θ into the 2D rotation matrix. Note that rotation by -θ is equivalent to rotation by 2π-θ.

Translation and Homogeneous Coordinates Translation is represented as vector addition. Fortunately, we can describe translation as matrix multiplication if we use the homogeneous coordinates. Homogeneous coordinates for the point to be translated: (x,y)  (x,y,1) Translation matrix Matrix-point multiplication (x+dx, y+dy) (dx, dy) (x, y)

Translation and Homogeneous Coordinates (cont’d) For a point, the fourth component of the homogeneous coordinates is not necessarily 1 and is denoted by w. Cartesian coordinates (x, y) are converted into homogeneous coordinates (wx, wy, w) with non-zero w. For example, the Cartesian coordinates (2,3) can be converted into multiple homogeneous coordinates, (2,3,1), (4,6,2), (6,9,3), etc. The line connecting (2, 3, 1) and the origin represents infinitely many points in homogeneous coordinates. Given the homogeneous coordinates (X, Y, w), the corresponding Cartesian coordinates are (X/w, Y/w). It is often described as projecting a point on the line onto the plane.

Translation and Homogeneous Coordinates (cont’d) For handling the homogeneous coordinates, the 3x3 matrices for scaling and rotation need to be altered.

Transform Composition An object may go through multiple transforms.

Transform Composition (cont’d) Matrix multiplication is not commutative. Rotation (R) followed by translation (T) vs. T followed by R

Transform Composition (cont’d) So far, rotations are about the origin. Let us now consider rotation about an arbitrary point, which is not the origin. Example: rotation of (5,2) about (3,2) Rotating a point at (x,y) about an arbitrary point, (a,b) Translating (x,y) by (-a,-b) Rotating the translated point about the origin Back-translating the rotated point by (a,b)

Transform Composition (cont’d)

Affine Transform Affine transform Linear transform Scaling (S) Rotation (R) Translation (T) No matter how many affine matrices are given, they can be combined into a matrix. When a series of affine transforms is concatenated to make a single 3x3 matrix, the third row is always (0 0 1).

Affine Transform (cont’d) Ignoring the third row of an affine matrix, we often denote the remaining 2x3 elements by [L|t], where L is a 2x2 matrix and t is a 2D column vector. L represents a ‘combined’ linear transform, which does not include any terms from the input translations. In contrast, t represents a ‘combined’ translation, which may contain the input linear-transform terms.

Affine Transform (cont’d) Transforming an object by [L|t] is conceptually decomposed into two steps: L is applied first and then the linearly transformed object is translated by t.

Rigid Motion Consider a combination of rotations and translations only, i.e., no scaling is involved. When the combined affine matrix applies to an object, the pose of the object is changed but its shape is not. In this sense, the transform is named rigid-body motion or simply rigid motion. No matter how many rotations and translations are combined, the resulting matrix is of the structure, [R|t], where R represents the ‘combined’ rotation, which does not include any translation terms, and t represents the ‘combined’ translation, which usually includes the rotation terms. Transforming an object by [R|t] is conceptually decomposed into two steps: R is applied first and then the rotated object is translated by t .

3D Scaling 3D scaling If all of the scaling factors are identical, the scaling is called uniform. Otherwise, it is a non-uniform scaling.

3D Rotation Unlike 2D rotation which requires a center of rotation, 3D rotation requires an axis of rotation. Let’s consider 3D rotations about x-axis (Rx), y-axis (Ry), and z-axis (Rz) First of all, Rz. (x',y',z') (x,y,z)

3D Rotation (cont’d) Observation for Rx. Obviously, x'=x. When the thumb of the right hand is aligned with the rotation axis, the other fingers curl from the y-axis to the z-axis. Returning to Rz, observe the fingers curl from the x-axis to the y-axis. Shifting from Rz to Rx, the x-axis is replaced with the y-axis, and the y-axis is replaced with the z-axis. By making such replacements, the matrix for Rx is obtained. y' y z y z' z Rx Rz

3D Rotation (cont’d) In the same manner, we can define the matrix for Ry.

3D Rotation (cont’d) CCW vs. CW rotations If the rotation is CCW with respect to the axis pointing toward you, the rotation angle is positive. If the rotation is CW, its matrix is defined with the negated rotation angle. Note that rotation by -θ is equivalent to rotation by 2π-θ.

3D Translation Matrix-point multiplication The 3x3 matrices developed for 3D scaling and rotation are extended to 4x4 matrices.

Application: World Transform The coordinate system used for creating an object is named object space. The object space for a model typically has no relationship to that of another model. The world transform ‘assembles’ all models into a single coordinate system called world space.

Application: World Transform (cont’d)

3D Affine Transforms The discussions we had on 2D affine transforms apply to 3D affine transforms. First of all, matrix multiplication is not commutative. When 3D scaling, rotation, and translation matrices are concatenated to make a 4x4 matrix, the fourth row is always (0 0 0 1).

3D Affine Transforms (cont’d) Ignoring the fourth row of an affine matrix, we often denote the remaining 3x4 elements by [L|t], where L is a 3x3 matrix that represents a ‘combined’ linear transform, and t is a 3D column vector that represents a ‘combined’ translation. [L|t] is conceptually decomposed into two steps: L is applied first and then the linearly transformed object is translated by t.

Rotation and Object-space Basis Once an object is created, it is fixed within its object space. An object can be thought of as being stuck to its object space. Initially the object space can be considered identical to the world space. The object-space basis is {u, v, n}. The world-space basis (standard basis) is {e1, e2, e3}. A rotation applied to an object changes its orientation, which can be described by the ‘rotated’ basis of the object space.

Rotation and Object-space Basis (cont’d) By R, e1 is rotated into u, and it is described as follows: Similarly, R transforms e2 and e3 into v and n, respectively: The above three are combined: R’s columns are u, v, and n. Given the ‘rotated’ object-space basis, {u, v, n}, the rotation matrix is immediately determined, and vice versa. u v n

Rotation and Object-space Basis (cont’d) The observation we have made holds in general.

Inverses of Translation and Scaling Inverse translation Inverse transform in inverse matrix Inverse scaling (x+dx, y+dy, z+dz) (dx, dy, dz) (x, y, z) (-dx, -dy, -dz)

Inverse Rotation Note that {u, v, n} is an orthonormal basis, i.e., u·u = v·v = n·n = 1 and u·v = v·n = n·u = 0. Let’s multiply R’s transpose (RT) with R: This says that R-1=RT, i.e., the inverse of a rotation matrix is its transpose. Because u, v, and n form the columns of R, they form the rows of R-1.

Inverse Rotation (cont’d) Recall that u, v, and n form the columns of R. As R-1=RT, u, v, and n form the rows of R-1.