COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Affine Transformations
Transformations Ed Angel Professor Emeritus of Computer Science
Computer Graphics Lecture 4 Geometry & Transformations.
John C. Hart CS 318 Interactive Computer Graphics
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
CMPE 466 COMPUTER GRAPHICS
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
3D Coordinate Systems and Transformations Revision 1
3-D Geometry.
3D orientation.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Technical Background.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Rotations and Translations
3D Kinematics Consists of two parts 3D rotation 3D translation  The same as 2D 3D rotation is more complicated than 2D rotation (restricted to z- axis)
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.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
3D Computer Graphics An oh so brief introduction.
2D Geometric Transformations
Rotations and Translations
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Geometric Transformations
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Geometric Objects and Transformation
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
This Week WeekTopic Week 1 Coordinate Systems, Basic Functions Week 2 Trigonometry and Vectors (Part 1) Week 3 Vectors (Part 2) Week 4 Vectors (Part 3:
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
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.
Computer Graphics I, Fall 2010 Transformations.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Fundamentals of Computer Animation Orientation and Rotation.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Transformations Review 4/18/2018 ©Babu 2009.
Computer Animation Algorithms and Techniques
Review: 3D Transforms Continued
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
3D Kinematics Consists of two parts
Game Design, Development, and Technology
Geometric Transformations Hearn & Baker Chapter 5
2D Transformations By: KanwarjeetSingh
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
Computer Graphics Transformations.
3D Transformations Source & Courtesy: University of Wisconsin,
Linear Algebra Review.
COMP 175: Computer Graphics February 9, 2016
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
(c) University of Wisconsin, CS559
UMBC Graphics for Games
CS-378: Game Technology Lecture #2: Transformations Prof. Okan Arikan
Geometric Objects and Transformations (II)
VIRTUAL ENVIRONMENT.
Image manipulation via matrices
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Screw Rotation and Other Rotational Forms
Presentation transcript:

COMPUTER GRAPHICS CHAPTERS 10-11 CS 482 – Fall 2017 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS

AFFINE TRANSFORMATIONS TRANSFORMATION TYPES To effectively place objects in a graphical environment, it is convenient to use certain matrix transformations to manipulate their position and orientation. The specific types of transformations that we use are: Scaling: multiply each dimension by a constant factor Translation: add a constant amount in each dimension Rotation: spin each object some angle around the origin Carefully combining these three types of transformations will permit a graphical object to be positioned and oriented in any desired fashion. CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 92

AFFINE TRANSFORMATIONS ROTATION 2D Rotation: (xcos - ysin, xsin + ycos)  (x, y) CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 93

AFFINE TRANSFORMATIONS 3D ROTATION Pitch: ROTATION ABOUT X-AXIS YAW: ROTATION ABOUT Y-AXIS Roll: ROTATION ABOUT Z-AXIS CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 94

AFFINE TRANSFORMATIONS SCALING 2D Scaling: (x, y) (k1x, k2y) CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 95

AFFINE TRANSFORMATIONS TRANSLATION 2D Translation: (x + x, y + y) y (x, y) x Any 2x2 matrix representing translation would require non-constant values in the matrix (requiring a separate matrix for each point being translated!) CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 96

AFFINE TRANSFORMATIONS HOMOGENEOUS COORDINATES The translation matrix problem is remedied by the use of homogeneous coordinates, which utilize an extra coordinate (i.e., a “weight” factor) for every 2D point. Rotation Scaling Translation (Note: In most of our work, the weight factor will merely be 1.) CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 97

AFFINE TRANSFORMATIONS COMBINING TRANSFORMATIONS By applying different transformations in a particular order, graphical objects can be manipulated to form complex variations of their original forms. Enlarge one copy of the original image via scaling, and then translate it to the right. Shrink another copy of the original image via scaling, rotate it slightly counterclockwise, and then translate it higher and to the right. Original Image Shrink a third copy of the original image via scaling, rotate it clockwise a bit less than the second image, and then translate it slightly higher and further to the right. CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 98

AFFINE TRANSFORMATIONS ORDER OF TRANSFORMATIONS Care must be taken when applying transformations, since the resulting image varies with the order in which the transformations are applied. R=60 Counterclockwise Rotation S=150% x-Scaling & 50% Y-Scaling T=Translation by (-3,-1) R first S second T third S first T second R third CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 99

CHAPTERS 10-11: TRANSFORMATIONS QUATERNIONS SMOOTH ROTATIONS Traditionally, a graphical object’s orientation has been defined via “Euler angle” rotations about the three coordinate axes (i.e., pitch, yaw, and roll). However, this approach can result in “gimbal lock”, in which rotation about one axis effectively overrides rotation about another axis. OpenGL uses rotation about a user-specified axis, but that approach can result in interpolations between orientations that do not appear smooth. A much smoother approach involves quaternions, four-dimensional versions of complex numbers that can essentially be viewed as a 3D vector, combined with a scalar. q=𝑤+𝑥i+𝑦j+𝑧k CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 100

QUATERNIONS ROTATING IN OBJECT SPACE To clarify, after combining several Euler angle rotations, it becomes difficult to rotate objects relative to their own space (due to Gimbal lock). Note in the image at right that an attempt to perform yaw rotation yields a spin around the y-axis in world space, but not in object space (as demonstrated by the non-stationary green arrow). Using quaternions eliminates this problem by performing operations in object space. Technically, quaternions space is a four-dimensional vector space that may be viewed as an extension of the two-dimensional complex plane, with a variation of cross products used for its (non-commutative) multiplication. CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 101

QUATERNIONS P  C Q SPHERICAL LINEAR INTERPOLATION quaternions may be used to create slerps, spherical linear interpolations, which compel the interpolated orientations to be along the great circle of a sphere. Given a sphere with center C and surface points P and Q, where the angle between the CP and CQ vectors is . P  The SLERP equation for all of the points on the great circle of the sphere joining P and Q is: C Q 𝑃 𝑡 =𝑃 sin 1−𝑡)𝜙 sin 𝜙 +𝑄 sin 𝑡𝜙 sin 𝜙 CS 482 – Fall 2017 CHAPTERS 10-11: TRANSFORMATIONS PAGE 102