Geometric Transformations

Slides:



Advertisements
Similar presentations
3D Transformations Assist. Prof. Dr. Ahmet Sayar
Advertisements

Computer Graphics: 3D Transformations
Transformations Ed Angel Professor Emeritus of Computer Science
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Three Dimensional Modeling Transformations
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
1 Computer Graphics Chapter 6 2D Transformations.
Two-Dimensional Geometric Transformations
CMPE 466 COMPUTER GRAPHICS
Transformations II Week 2, Wed Jan 17
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
©College of Computer and Information Science, Northeastern UniversityJune 26, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 11.
Transformations 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.
UNIT - 5 3D transformation and viewing. 3D Point  We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Lecture Notes: Computer Graphics.
Geometric Transforms Changing coordinate systems.
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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
1 Computer Graphics Week9 -3D Geometric Transformation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Introduction to Computer Graphics Geometric Transformations
Computer Graphics 3D Transformations. Translation.
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
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.
Geometric Transformations
2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Homogeneous Coordinates and Matrix Representations Cartesian coordinate (x, y, z) Homogeneous coordinate (x h, y h, z h, h) Usually h = 1. But there are.
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.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSCE 441 Computer Graphics: 2D Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Instructor: Dr. Shereen Aly Taie Basic Two-Dimensional Geometric Transformation 5.2 Matrix Representations and Homogeneous Coordinates 5.3 Inverse.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Transforms.
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics 3D Transformations
3D Geometric Transformations
Clipping Polygon Clipping Polygon : Area primitive
Introduction to Computer Graphics CS 445 / 645
Lecture 7 Geometric Transformations (Continued)
Computer Graphics Transformations
Geometric Objects and Transformations (II)
Transformations 2 University of British Columbia
TWO DIMENSIONAL TRANSFORMATION
Presentation transcript:

Geometric Transformations Basic 2D geometric transformation Homogeneous coordinates 2D transformations Translation Scaling Rotation Composite transformations Other transformation: Shearing, Reflection 3D transformations Other 3D transformation: Shearing, Reflection OpenGL Matrix stack Lecture 7 Transformation

1. Basic 2D Transformation 2D Translation A translation moves a vertex to a new position by adding a displacement vector to it. Eg, The following translates the vertex to by adding (3,13) (7,7) Lecture 7 Transformation

2D Rotation r   (x’,y’) (x,y) x=r cos y=r sin x’ = r cos(+) = r cos cos  r sin sin = x cos - y sin y’ = r sin(+) = r sin cos + r cos sin = x sin + y cos y=r sin Lecture 7 Transformation

2D Scaling x’ = x sx y’ = y sy (x, y) (x’, y’) Lecture 7 Transformation

2. Linear Transformations on vertices A linear transformation moves a vertex to a new position by multiplying it with a non-singular matrix. Eg, The following transforms the vertex (2, 3) to (3, 13) (3,13) (2,3) Lecture 7 Transformation

Affine Transformations on vertices An affine transformation is a linear transformation followed by a translation. Its 2D general form is Affine transformations preserve lines. Many geometric movements of objects, eg, translations, rotations, and scalings are affine transformations. Lecture 7 Transformation

3. Homogeneous coordinates A point in homogeneous coordinates (x, y, w), w ≠ 0, corresponds to the 2-D vertex (x/w, y/w) in Cartesian coordinates Conceive that the Cartesian coordinates axes lies on the plane of w = 1. The intersection of the plane and the line connecting the origin and (x, y, w) gives the corresponding Cartesian coordinates w (x, y, w) w = 1 (x/w, y/w, 1) x y y x w = 0 Lecture 7 Transformation

E.g. both the points (6, 9, 3) and (4, 6, 2) in the homogeneous coordinates corresponds to (2, 3) in the Cartesian coordinates. Conversely, the point (2, 1) of the Cartesian corresponds to (2, 1, 1), (4, 2, 2) or (6, 3, 3) of the homogeneous w 6, 3, 3) (4, 2, 2) w = 1 (2, 1, 1) x y y x w = 0 Lecture 7 Transformation

Homogeneous coordinates of vectors A 2-D vector (x, y) of Cartesian corresponds to (x, y, 0) in homogeneous coordinates and vice versa. Note that vectors and vertices have different representations in homogeneous coordinates. On the other hand, the transformation formulas for both vectors and vertices in homogeneous coordinates are identical. Such generalization enhances simplicity, and thus the reliability, of a graphics system Lecture 7 Transformation

4. 2D Transformation in Homogeneous form 2D Translation in Homogeneous form (1,1) (5,1) (1,3) (x,y) (3,2) (7,2) (3,4) (x’, y’) Lecture 7 Transformation

2D Rotation in Homogeneous form Lecture 7 Transformation

Eg, to rotate 45o (/4 radian) sin /4 = cos /4 = 0.7071 (1,1) (5,1) (1,3) (x,y) (0,1.4) (2.8, 4.2) (-1.4, 2.8) (x’, y’) Lecture 7 Transformation

2D Translation in Homogeneous (1,1) (5,1) (1,3) (x,y) (2,1/2) (10,1/2) (2,3/2) (x’, y’) Lecture 7 Transformation

5. Composite a sequence of transformations Translate the right-angle vertex to the origin (Tx = -1, Ty = -1) Rotate 45o (/4 radian) sin /4 = cos /4 = 0.7071 (1,1) (5,1) (1,3) (0,0) (4,0) (0,2) (2.8,2.8) (-1.4,1.4) Lecture 7 Transformation

Lecture 7 Transformation

6. Composite Transformation Implementation All practical transformations on vertices and vectors in homogeneous coordinates can be expressed as pure matrix multiplications. Such uniformity greatly enhance the run-time efficiency of a graphics system. Suppose that a set of 1 million vertices needs to go through three transformations representing by the matrices M1, M2, and M3. A straightforward formula of the overall transformations for a vertex v is v´ = M3*M2*M1*v. As matrix multiplication is associative, we can compute M = M3*M2*M1 in advance, then transform all 1 million vertices using the formula v´ = M*v. Lecture 7 Transformation

7. Other 2D Transformation Shearing Uneven scaling and shearing change the shape of an object An example of 2D shearing in x direction (To alter x-coordinates by an amount proportional to the y value.) y x (0,0) (0,1) (1,0) (1,1) (2,1) (3,1) x’ = x + 2y y’ = y Lecture 7 Transformation

x’ = x y’ = 2x + y y x y x (0,0) (0,1) (1,2) (1,3) (0,0) (0,1) (1,0) (1,1) x’ = x y’ = 2x + y Lecture 7 Transformation

(x,y) (x,-y) Reflection about the x axis Reflection about the y axis ? Reflection w.p.t the origin ? Reflection w.p.t the x = y Lecture 7 Transformation

y =mx+b Reflection along a line Translate (0, -b) so that the line passes through the origin Rotate the line onto the x axis by -o Reflect about the x axis Backward rotate backward translate (Be reminded that these operations must be specified in reverse order.) b  Lecture 7 Transformation