1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon.

Slides:



Advertisements
Similar presentations
Computer Graphics - Transformation -
Advertisements

Computer Graphics Lecture 4 Geometry & Transformations.
1 Computer Graphics Chapter 6 2D Transformations.
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
Modeling Objects by Polygonal Approximations
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
Objectives Learn to build arbitrary transformation matrices from simple transformations Learn to build arbitrary transformation matrices from simple transformations.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 OpenGL Transformations Ed Angel Professor of Computer Science, Electrical and Computer.
Chapter 3: Geometric Objects and Transformations Part 2
2IV60 Computer Graphics 2D transformations
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.
Transformations of Objects CVG lab. Introduction  Affine transformations : Affine transformations are a fundamental cornerstone of computer 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.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360.
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
2D Transformations.
Geometric Transformations Jehee Lee Seoul National University.
Transformations With OpenGL Courtesy of Drs. Carol O’Sullivan / Yann Morvan Trinity College Dublin.
PPT&Programs&Labcourse 1.
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.
Computer Graphics I, Fall 2010 OpenGL Transformations.
3D Transformations. Translation x’ = x + tx y’ = y + ty z’ = z + tz P = P’ = T = P’ = T. P tx ty tz xyz1xyz1 x’ y’ z’ 1 x y.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 OpenGL Transformations.
Affine Transformation. Affine Transformations In this lecture, we will continue with the discussion of the remaining affine transformations and composite.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
Composing Transformations
Transformations of objects
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 73 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 73 Computer Graphics Three-Dimensional Graphics II.
1 OpenGL Transformations. 2 Objectives Learn how to carry out transformations in OpenGL ­Rotation ­Translation ­Scaling Introduce OpenGL matrix modes.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
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.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Computer Graphics I, Fall 2010 Transformations.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSCE 441 Computer Graphics: 2D Transformations
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360/4360.
Modeling Transformations
OpenGL Transformations
OpenGL Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Summary of Properties of 3D Affine Transformations
Review: Transformations
OpenGL Transformations
Computer Graphics OpenGL Transformations
Introduction to Computer Graphics with WebGL
OpenGL Transformations
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Unit-5 Geometric Objects and Transformations-II
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Chapters 5/4 part2 understanding transformations working with matrices
Geometric Transformations
Lecture 6 and 7 Transformations
Transformations 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Transformations in OpenGL
Geometric Objects and Transformations (II)
OpenGL Transformations
TWO DIMENSIONAL TRANSFORMATION
OpenGL Transformations
Translation in Homogeneous Coordinates
Presentation transcript:

1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon

Transforming Pictures Sometimes objects exhibit certain symmetries, so only a part of it needs to be described, and the rest constructed by reflecting, rotating and translating the original part A designer may want to view and object from different vantage points, by rotating the object, or by moving a “synthetic camera” viewpoint. In animation, one or more objects must move relative to one another, so that their local co-ordinate systems must be shifted and rotated as the animation proceeds.

The snowflake exhibits symmetries. We design a single motif and draw the whole shape using appropriate reflections, rotations, and translations of the motif. Example 1

etc... Example 2 Object parts defined in a local co-ordinate system: Larger objects are then “assembled” by duplicating and transforming each of the constituent parts:

5 + + = This of course shouldn’t mean all objects need to share the same transformations Usually we model individual objects based on a local coordinate system Example 3

6 + = + transform + + Obviously we want something more versatile

5 steps of a “rotating cube” animation Example 4 At each frame of the animation, the object is transformed, in this case by a rotation. It could also be transformed by changing its size (scaling), or its shape (deformation), or its location (translation). Further animation effects can be achieved by not changing the object, but the way it is viewed zooming and panning the viewing window

Example 5 A designer may want to view an object from different vantage points. Positioning and reorienting a camera can be carried out through the use of 3D affine transformations.

Transformations A transformation on an object is an operation that changes how the object is finally drawn to screen There are two ways of understanding a transformation  An Object Transformation alters the coordinates of each point according to some rule, leaving the underlying coordinate system unchanged  A Coordinate Transformation produces a different coordinate system, and then represents all original points in this new system

{1,1} {.4, 2} Example: OBJECT TRANSFORMATION {1,1} Example: COORDINATE TRANSFORMATION More on this later…

11 Coordinate Transforms {1*,1*} v’ u’ {1,1} v u x y Object defined in Local Coordinate System Object after transformation in Global Coordinate System

12 x y x y Identity {1,1} v u v’ u’

13 x y Translation x y {1,1} v u {1+tx,1+ty} v’ u’ origin

14 x y Rotation x y {1,1} v u v’ u’

15 x y Scaling x y {1,1} v u {sx*1,sy*1} v u

16 3D Object Transformations translation rotation scaling

17 Scale all vectors are scaled from the origin: Originalscale all axesscale Y axis offset from origindistance from origin also scales

18 Scale Or in 3D homogeneous coordinates

19 Rotation Rotations are anti-clockwise about the origin: rotation of 45 o about the Z axis offset from origin rotation

20 Rotation 2D rotation of  about origin: 3D homogeneous rotations:

21 Translation Translation only applies to points, we never translate vectors. Remember: points have homogeneous co-ordinate w = 1 translate along y

Shear We shear along an axis according to another axis  Shearing along X axis preserves y and z values.  Shearing along Y axis preserves x and z values  Shearing along Z axis preserves x and y values Point are stretched along the shear axis in proportion to the distance of the point along another axis. Example: shearing along X according to Y

Shear originalshear along x (by y)shear along x (by z)

Transformation Composition More complex transformations can be created by concatenating or composing individual transformations together. Matrix multiplication is non-commutative  order is vital We can create an affine transformation representing rotation about a point P R : = translate to origin, rotate about origin, translate back to original location

Transformation Composition

Conceptually there is a 4 x 4 homogeneous coordinate matrix, the current transformation matrix (CTM) that is part of the state and is applied to all vertices that pass down the pipeline The CTM is defined in the user program and loaded into a transformation unit Current Transformation Matrix (CTM or CT) CTMvertices p p’=Cp C

In OpenGL matrices are part of the state Multiple types  Model-View (GL_MODELVIEW)  Projection (GL_PROJECTION)  Texture (GL_TEXTURE) (ignore for now)  Color(GL_COLOR) (ignore for now) Single set of functions for manipulation Select which to be manipulated by  glMatrixMode(GL_MODELVIEW);  glMatrixMode(GL_PROJECTION); OpenGL Matrices

Can load and multiply by matrices defined in the application program The matrix m is a one dimension array of 16 elements which are the components of the desired 4 x 4 matrix stored by columns In glMultMatrixf, m multiplies the existing matrix on the right Arbitrary Matrices glLoadMatrixf(m) glMultMatrixf(m)

glRotatef(theta, vx, vy, vz) Rotation, Translation, Scaling glTranslatef(dx, dy, dz) glScalef(sx, sy, sz) glLoadIdentity()  Load an identity matrix:  Multiply on right: theta in degrees, ( vx, vy, vz ) define axis of rotation  Each has a float (f) and double (d) format (glScaled)