More on Transformations. COS 426, Spring 2019 Princeton University

Similar documents
CS559: Computer Graphics

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Homogeneous Coordinates

Geometric Transformations

Modeling Transformations

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Image Warping (Szeliski Sec 2.1.2)

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Modeling Transformations

Transformations II. Week 2, Wed Jan 17

4. Two Dimensional Transformations

CS F-07 Objects in 2D 1

To Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1

2D/3D Geometric Transformations and Scene Graphs

3-Dimensional Viewing

Modeling Transformations

Modeling Transformations Revisited

3D Geometry and Camera Calibration

Vector Algebra Transformations. Lecture 4

CS770/870 Spring 2017 Transformations

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Transforms. COMP 575/770 Spring 2013

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Image Warping. Some slides from Steve Seitz

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

What does OpenGL do?

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Scene Graphs & Modeling Transformations COS 426

What and Why Transformations?

The 3-D Graphics Rendering Pipeline

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Modeling Transformations

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Geometric Model of Camera

Transformations Review

Modeling Transformations

Warping, Morphing and Mosaics

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

CS354 Computer Graphics Rotations and Quaternions

Image Warping CSE399b, Spring 07 Computer Vision

Motivation. General Idea. Goals. (Nonuniform) Scale. Outline. Foundations of Computer Graphics. s x Scale(s x. ,s y. 0 s y. 0 0 s z.

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

2D Transformations. 7 February 2017 Week 5-2D Transformations 1

Linear and Affine Transformations Coordinate Systems

Chapter 3 : Computer Animation

CS770/870 Spring 2017 Transformations

Lecture 4: Viewing. Topics:

Geometric Transformations

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

Viewing and Projection

2D Geometric Transformations and Matrices

Two Dimensional Viewing

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

MEM380 Applied Autonomous Robots Winter Robot Kinematics

Transformations Week 9, Lecture 18

Image Warping. Some slides from Steve Seitz

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

3D Kinematics. Consists of two parts

High Dimensional Rendering in OpenGL

Last Lecture. Edge Detection. Filtering Pyramid

CPSC 314, Midterm Exam 1. 9 Feb 2007

CSCI-4530/6530 Advanced Computer Graphics

Image Metamorphosis By Affine Transformations

CS5620 Intro to Computer Graphics

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

How is project #1 going?

Transformations III. Week 2, Fri Jan 19

Lecture 9: Transformations. CITS3003 Graphics & Animation

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Orientation & Quaternions

Chap 7, 2009 Spring Yeong Gil Shin

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Introduction to Homogeneous Transformations & Robot Kinematics

CSCI-4530/6530 Advanced Computer Graphics

CMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics

Polynomials. Math 4800/6080 Project Course

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

UNIT NUMBER 5.2. GEOMETRY 2 (The straight line) A.J.Hobson

Scientific Manual FEM-Design 16.0

Linear Algebra and Image Processing: Additional Theory regarding Computer Graphics and Image Processing not covered by David C.

CS Computer Graphics: Transformations & The Synthetic Camera

8.6 Three-Dimensional Cartesian Coordinate System

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

Introduction to Homogeneous Transformations & Robot Kinematics

Outcomes List for Math Multivariable Calculus (9 th edition of text) Spring

IMGD The Game Development Process: 3D Modeling and Transformations

Perspective Projection Transformation

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

2D transformations and homogeneous coordinates

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

Transcription:

More on Transformations COS 426, Spring 2019 Princeton Universit

Agenda Grab-bag of topics related to transformations: General rotations! Euler angles! Rodrigues s rotation formula Maintaining camera transformations! First-person! Trackball How to transform normals

3D Coordinate Sstems Right-handed vs. left-handed z z

3D Coordinate Sstems Right-handed vs. left-handed Right-hand rule for rotations: positive rotation = counterclockwise rotation about ais

General Rotations Recall: set of rotations in 3-D is 3-dimensional! Rotation group SO(3)! Non-commutative! Corresponds to orthonormal 3 3 matrices with determinant = +1 Need 3 parameters to represent a general rotation (Euler s rotation theorem)

Euler Angles Specif rotation b giving angles of rotation about 3 coordinate aes 12 possible conventions for order of aes, but one standard is Z-X-Z

Euler Angles Another popular convention: X-Y-Z Can be interpreted as aw, pitch, roll of airplane

Rodrigues s Formula Even more useful: rotate b an arbitrar angle (1 number) about an arbitrar ais (3 numbers, but onl 2 degrees of freedom since unit-length) q a z

Rodrigues s Formula An arbitrar point p ma be decomposed into its components along and perpendicular to a p = a (p a) + [p a (p a)] p a

Rodrigues s Formula Rotating component along a leaves it unchanged Rotating component perpendicular to a (call it p^) moves it to p^cos q + (a p^) sin q

Rodrigues Formula Putting it all together: Rp = a (p a) + p^cos q + (a p^) sin q = aa T p + (p aa T p) cos q + (a p) sin q So: R = aa T + (I aa T ) cos q + [a] sin q where [a] is the cross product matri [ a] æ 0 ç = ç az ç è- a - a 0 a z - a Olinde Rodrigues, "Des lois géometriques qui regissent les déplacements d' un sstéme solide dans l' espace, et de la variation des coordonnées provenant de ces déplacement considérées indépendant des causes qui peuvent les produire", J. Math. Pures Appl. 5 (1840), 380 440. a 0 ö ø Wh?

Rotating One Direction into Another Given two directions d 1, d 2 (unit length), how to find transformation that rotates d 1 into d 2?! There are man such rotations!! Choose rotation with minimum angle Ais = d 1 d 2 Angle = acos(d 1 d 2 ) More stable numericall: atan2( d 1 d 2, d 1 d 2 )

Agenda Grab-bag of topics related to transformations: General rotations! Euler angles! Rodrigues s rotation formula Maintaining camera transformations! First-person! Trackball How to transform normals

Camera Coordinates Canonical camera coordinate sstem! Convention is right-handed (looking down z ais)! Convenient for projection, clipping, etc. Camera up vector maps to Y ais Camera back vector maps to Z ais (pointing out of page) z Camera right vector maps to X ais

Viewing Transformation Mapping from world to camera coordinates! Ee position maps to origin! Right vector maps to +X ais! Up vector maps to +Y ais! Back vector maps to +Z ais z View plane up Camera back right World

Finding the viewing transformation We have the camera (in world coordinates) We want T taking objects from world to camera Trick: find T -1 taking objects in camera to world w p T c p = û ù ë é û ù ë é = û ù ë é w z p o n m l k j i h g f e d c b a w z ' ' ' ' c p T w p -1 =?

Finding the Viewing Transformation Trick: map from camera coordinates to world! Origin maps to ee position! Z ais maps to Back vector! Y ais maps to Up vector! X ais maps to Right vector This matri is T -1 so we invert it to get T eas! û ù ë é û ù ë é = û ù ë é w z E B U R E B U R E B U R E B U R w z w w w w z z z z ' ' ' '

Maintaining Viewing Transformation For first-person camera control, need 2 operations: Turn: rotate(q, 0,1,0) in local coordinates Advance: translate(0, 0, v*dt) in local coordinates Ke: transformations act on local, not global coords To accomplish: right-multipl b translation, rotation M new M old T v*dt,z R q,

Maintaining Viewing Transformation Object manipulation: trackball or arcball interface Map mouse positions to surface of a sphere Mouse click Mouse release Compute rotation ais, angle Appl rotation to global coords: left-multipl M new R q,a M old

Agenda Grab-bag of topics related to transformations: General rotations! Euler angles! Rodrigues s rotation formula Maintaining camera transformations! First-person! Trackball How to transform normals

Transforming Normals Normals do not transform the same wa as points!! Not affected b translation! Not affected b shear perpendicular to the normal

Transforming Normals Ke insight: normal remains perpendicular to surface tangent Let t be a tangent vector and n be the normal t n = 0 or t T n = 0 If matri M represents an affine transformation, it transforms t as t M L t where M L is the linear part (upper-left 3 3) of M

Transforming Normals So, after transformation, want (M L t) T n transformed = 0 But we know that t T n = 0 t T M LT (M LT ) -1 n = 0 (M L t) T (M LT ) -1 n = 0 So, n transformed = (M LT ) -1 n

Transforming Normals Conclusion: normals transformed b inverse transpose of linear part of transformation Note that for rotations, inverse = transpose, so inverse transpose = identit! normals just rotated

COS 426 Midterm eam This Thursda, April 14 Regular time/place: 3:00-4:20, Friend 006 Covers everthing through week 5: color, image processing, shape representations transformations (but not toda s lecture)! Also responsible for material in required parts of first two programming assignments Closed book, no electronics, one page of notes / formulas