1 Computer Graphics Chapter 6 2D Transformations.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Advertisements

Computer Graphics Lecture 4 Geometry & Transformations.
1 Computer Graphics Chapter 8 3D Transformations.
Geometric Transformations
Chapter 5 Geometric Transformations
Two-Dimensional Geometric Transformations
2D 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.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
Computer Graphics University of Palestine Dr. Sana’a Wafa Al-Sayegh
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.
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
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.
Transformation of Graphics
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
Graphics Graphics Korea University cgvr.korea.ac.kr 2D Geometric Transformations 고려대학교 컴퓨터 그래픽스 연구실.
2D Transformation of Graphics
Geometric Transformations Jehee Lee Seoul National University.
Part7: 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.
Geometric Transformations
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Geometric Objects and Transformation
2D Transformation. Transformation changes an object’s: – Position(Translation) – Size(Scaling) – Orientation(Rotation) – Shape(Deformation) Transformation.
Transformation.
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
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Affine Geometry.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Instructor: Mircea Nicolescu Lecture 9
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
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
3D Geometry and Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Robotic Arms and Matrices By Chris Wong and Chris Marino.
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.
Computer Graphics Lecture 15 Fasih ur Rehman. Last Class Combining Transformations Affine versus Rigid body Transformations Homogenous Transformations.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Transforms.
3. Transformation
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics 3D Transformations
Line and Character Attributes 2-D Transformation
2D Geometric Transformations
Geometrical Transformations
Transformations 2 University of British Columbia
TWO DIMENSIONAL TRANSFORMATION
Translation in Homogeneous Coordinates
Presentation transcript:

1 Computer Graphics Chapter 6 2D Transformations

[6]-2RM Transform every point on an object according to certain rule. Initial Object Transformed Object P (x,y) Q (x’, y’) xx’ yy’ Transformation T The point Q is the image of P under the transformation T.

[6]-3RM (10,5)(30,5) (20,35) (55,60) (65,30) (45,30) Translation The vector (t x, t y ) is called the offset vector.

[6]-4RM Translation (OpenGL)

[6]-5RM (x,y) (x’,y’)  o (x,y) (x’,y’) x y Rotation About the Origin The above 2D rotation is actually a rotation about the z-axis (0,0,1) by an angle .

[6]-6RM Rotation About the Origin

[6]-7RM (x p, y p ) (x,y) (x’,y’) Pivot Point Pivot point is the point of rotation Pivot point need not necessarily be on the object Rotation About a Pivot Point

[6]-8RM (x p, y p ) (x,y) (x1, y1) STEP-1: Translate the pivot point to the origin Rotation About a Pivot Point

[6]-9RM (x1, y1) STEP-2: Rotate about the origin (x2, y2) Rotation About a Pivot Point

[6]-10RM STEP-3: Translate the pivot point to original position (x2, y2) (x p, y p ) (x’, y’) Rotation About a Pivot Point

[6]-11RM Rotation About a Pivot Point

[6]-12RM UniformNon-Uniform (x,y) (x’,y’) (x,y) (x’,y’) Scaling About the Origin The parameters s x, s y are called scale factors.

[6]-13RM Scaling About the Origin

[6]-14RM (x f, y f ) (x,y) (x’,y’) Translate the fixed point to origin Scale with respect to the origin Translate the fixed point to its original position. Scaling About a Fixed Point

[6]-15RM Reflections Initial Object Reflection about x y =  y x y Reflection about origin x =  x y =  y Reflection about y x =  x

[6]-16RM Reflections

[6]-17RM Shear A shear transformation in the x-direction (along x) shifts the points in the x-direction proportional to the y-coordinate. The y-coordinate of each point is unaffected.

[6]-18RM Translation Rotation [Origin] Scaling [Origin] Matrix Representations

[6]-19RM Reflection about x Matrix Representations Reflection about y Reflection about the Origin

[6]-20RM Shear along x Matrix Representations Shear along y

[6]-21RM Homogeneous Coordinates To obtain square matrices an additional row was added to the matrix and an additional coordinate, the w-coordinate, was added to the vector for a point. In this way a point in 2D space is expressed in three-dimensional homogeneous coordinates. This technique of representing a point in a space whose dimension is one greater than that of the point is called homogeneous representation. It provides a consistent, uniform way of handling affine transformations.

[6]-22RM Cartesian Homogeneous Examples: (5, 8) (15, 24, 3) (x, y) (x, y, 1) Homogeneous Coordinates If we use homogeneous coordinates, the geometric transformations given above can be represented using only a matrix pre-multiplication. A composite transformation can then be represented by a product of the corresponding matrices.

[6]-23RM Translation P’=TP Rotation [O] P’=RP Scaling [O] P’=SP Basic Transformations Homogeneous Coordinates

[6]-24RM If, then, Examples: Inverse of Transformations

[6]-25RM Additional Properties: Transformation Matrices

[6]-26RM Transformation T followed by Transformation Q followed by Transformation R: Example: (Scaling with respect to a fixed point) Composite Transformations Order of Transformations

[6]-27RM In composite transformations, the order of transformations is very important. Order of Transformations Rotation followed by Translation: Translation followed by Rotation:

[6]-28RM OpenGL postmultiplies the current matrix with the new transformation matrix Order of Transformations (OpenGL) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(tx, ty, 0); glRotatef(theta, 0, 0, 1.0); glVertex2f(x,y); Rotation followed by Translation !! Current Matrix [ I ] [ T ] [ T ] [ R ] [ T ] [ R ] P

[6]-29RM Preserved Attributes General Properties

[6]-30RM A general invertible, linear, transformation. Affine Transformation Transformation Matrix:

[6]-31RM Product of affine transformations is affine. Affine transformations preserve linearity of segments. Affine transformations preserve parallelism between lines. Affine transformations are invertible. Affine Transformation: Properties