Computer Graphics Lecture 4 Geometry & Transformations.

Slides:



Advertisements
Similar presentations
Affine Transformations
Advertisements

Computer Graphics 02/10/09Lecture 41 Computer Graphics Lecture 3 Transformations.
Transformations Ed Angel Professor Emeritus of Computer Science
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Transformations Rüdiger Westermann Lehrstuhl für Computer Graphik und.
Transformations.
Geometric Transformations
Transformations II Week 2, Wed Jan 17
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
2D Geometric Transformations
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
3-D Geometry.
©College of Computer and Information Science, Northeastern UniversityJune 26, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 11.
Transformations I CS5600Computer Graphics by Rich Riesenfeld 27 February 2002 Lecture Set 5.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CS 450: Computer Graphics 2D TRANSFORMATIONS
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
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.
Transformations Dr. Amy Zhang.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
Autonomous Navigation for Flying Robots Lecture 2.2: 2D Geometry
1 2D Transformations 几何变换. 2 What is a transformation? A transformation is an operation that transforms or changes a shape (line, drawing etc.) There.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction to computer vision Chapter 2: Image.
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.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Introduction to Computer Graphics Geometric Transformations
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Affine Geometry.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
Transformations of objects
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Image Warping 2D Geometric Transformations
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
3. Transformation
Lecture 3 Jitendra Malik
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics Transformations.
Review: Transformations
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Review: Transformations
Computer Graphics Transformations
Lecture 2 Transformations
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
2D Geometric Transformations
Reflections in Coordinate Plane
Geometrical Transformations
TWO DIMENSIONAL TRANSFORMATION
Presentation transcript:

Computer Graphics Lecture 4 Geometry & Transformations

Computer Graphics 7/10/2008Lecture 42 Some Basics Basic geometric types. –Scalars s –Vectors v –Points p = p + s * v Transformations –Types of transformation: rotation, translation, scale. –Matrix representation –Order Geometric modelling –Hierarchical modelling –Polyhedral shapes.

Computer Graphics 7/10/2008Lecture 43 Transformations. What is a transformation? P=T(P) Why use them? Modelling - Create objects in natural/convenient coordinates - Multiple instances of a prototype shape - Kinematics of linkages/skeletons - robot animation Viewing –Windows and device independence –Virtual camera: parallel and perspective projections

Computer Graphics 7/10/2008Lecture 44 Types of Transformations Continuous (preserves neighbourhoods) One to one, invertible Classify by invariants or symmetries Isometry (distance preserved) –Reflections (interchanges left-handed and right- handed) –Rigid body motion: Rotations + Translations Similarity (preserves angles) –Uniform scale Affine (preserves parallel lines) –Non-uniform scales, shears or skews Collineation (lines remain lines) –Perspective Non-linear (lines become curves) –Twists, bends, warps, morphs,...

Computer Graphics 7/10/2008Lecture 45 2D Translations. P P’

Computer Graphics 7/10/2008Lecture 46 2D Scaling from the origin. P P’

Computer Graphics 7/10/2008Lecture 47 2D Rotation about the origin. y x r r P’(x’,y’) P(x,y) 

Computer Graphics 7/10/2008Lecture 48 2D Rotation about the origin. y x r r P’(x’,y’) P(x,y)   y x

Computer Graphics 7/10/2008Lecture 49 2D Rotation about the origin. y x r r P’(x’,y’) P(x,y)   y x

Computer Graphics 7/10/2008Lecture 410 2D Rotation about the origin. Substituting for r : Gives us :

Computer Graphics 7/10/2008Lecture 411 2D Rotation about the origin. Rewriting in matrix form gives us :

Computer Graphics 7/10/2008Lecture 412 Transformations. Translation. –P=T + P Scale –P=S  P Rotation –P=R  P We would like all transformations to be multiplications so we can concatenate them  express points in homogenous coordinates.

Computer Graphics 7/10/2008Lecture 413 Homogeneous coordinates Add an extra coordinate, W, to a point. –P(x,y,W). Two sets of homogeneous coordinates represent the same point if they are a multiple of each other. –(2,5,3) and (4,10,6) represent the same point. At least one component must be non-zero  (0,0,0) is not defined. If W  0, divide by it to get Cartesian coordinates of point (x/W,y/W,1). If W=0, point is said to be at infinity.

Computer Graphics 7/10/2008Lecture 414 Homogeneous coordinates If we represent (x,y,W) in 3-space, all triples representing the same point describe a line passing through the origin. If we homogenize the point, we get a point of form (x,y,1) –homogenised points form a plane at W=1. P X Y W W=1 plane

Computer Graphics 7/10/2008Lecture 415 Translations in homogenised coordinates Transformation matrices for 2D translation are now 3x3.

Computer Graphics 7/10/2008Lecture 416 Concatenation. We perform 2 translations on the same point:

Computer Graphics 7/10/2008Lecture 417 Concatenation. Matrix product is variously referred to as compounding, concatenation, or composition

Computer Graphics 7/10/2008Lecture 418 Concatenation. Matrix product is variously referred to as compounding, concatenation, or composition. This single matrix is called the Coordinate Transformation Matrix or CTM.

Computer Graphics 7/10/2008Lecture 419 Properties of translations. Note : 3. translation matrices are commutative.

Computer Graphics 7/10/2008Lecture 420 Homogeneous form of scale. Recall the (x,y) form of Scale : In homogeneous coordinates :

Computer Graphics 7/10/2008Lecture 421 Concatenation of scales.

Computer Graphics 7/10/2008Lecture 422 Homogeneous form of rotation.

Computer Graphics 7/10/2008Lecture 423 Orthogonality of rotation matrices.

Computer Graphics 7/10/2008Lecture 424 Other properties of rotation.

Computer Graphics 7/10/2008Lecture 425 Types of transformations. Rotation and translation –Angles and distances are preserved –Unit cube is always unit cube –Rigid-Body transformations. Rotation, translation and scale. –Angles & distances not preserved. –But parallel lines are. –Affine transformations.

Computer Graphics 7/10/2008Lecture 426 3D Transformations. Use homogeneous coordinates, just as in 2D case. Transformations are now 4x4 matrices. We will use a right-handed (world) coordinate system - ( z out of page ). z (out of page) y x Note: Convenient to think of display as Being left-handed !! ( z into the screen )

Computer Graphics 7/10/2008Lecture 427 Translation in 3D. Simple extension to the 3D case:

Computer Graphics 7/10/2008Lecture 428 Scale in 3D. Simple extension to the 3D case:

Computer Graphics 7/10/2008Lecture 429 Rotation in 3D Need to specify which axis the rotation is about. z-axis rotation is the same as the 2D case.

Computer Graphics 7/10/2008Lecture 430 Rotation in 3D For rotation about the x and y axes:

Computer Graphics 7/10/2008Lecture 431 Rotation about an arbitrary axis? Hard! But we know how to rotate about the major axes. So turn required rotation into one about major axis. We need to translate arbitrary axis a to pass through origin, rotate to align with major axis, perform rotation, and rotate and translate back to original position. Say M z is the compound transformation to translate and rotate a to align with z-axis, then M z -1 is the reverse transformation required to restore a to its original position. Ignore translation for present, a passes through origin…..

Computer Graphics 7/10/2008Lecture 432 How do we define M? M transforms a into a vector along the z-axis, ie. Ma = k Construct the rotation matrix R  as follows: R a (  ) = M -1 R z (  )M A suitable M -1 can be found with a little effort, ie. M -1 k = a First define axis direction a as a unit vector as: a = (a 1,a 2,a 3 ) = R z (-  )R x (-  )k = (sin  sin , sin  cos , cos  ) Thus:and:

Computer Graphics 7/10/2008Lecture 433 Rotation about arbitrary axis So: M -1 = R z (  )R x (  ) and therefore: M = R x (  )R z (  ) And the full expression for a rotation about an arbitrary axis is: R a (  ) = T -1 R z (  )R x (  )R z (  )R x (  )R z (  )T Example: consider axis through origin, Thus  = 45 o and  0 o and R a (  ) = R x (-45 o )R z (  )R x (45 o )

Computer Graphics 7/10/2008Lecture 434 Transformations of coordinate systems. Have been discussing transformations as transforming points. Useful to think of them as a change in coordinate system. Model objects in a local coordinate system, and transform into the world system. Unrealistic to think all objects are defined in the same coordinate system.

Computer Graphics 7/10/2008Lecture 435 Transformations of coordinate systems.

Computer Graphics 7/10/2008Lecture 436 Transform Left-Right, Right-Left Transforms between world coordinates and viewing coordinates. That is: between a right-handed set and a left- handed set.