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

Similar documents
CSE 167: Introduction to Computer Graphics Lecture #4: Coordinate Systems

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

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

Geometric Transformations

Autonomous Navigation for Flying Robots

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

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

CS354 Computer Graphics Rotations and Quaternions

GEOMETRIC TRANSFORMATIONS AND VIEWING

An idea which can be used once is a trick. If it can be used more than once it becomes a method

Linear and Affine Transformations Coordinate Systems

2D/3D Geometric Transformations and Scene Graphs

Vector Algebra Transformations. Lecture 4

Quaternions and Euler Angles

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Transforms. COMP 575/770 Spring 2013

Graphics Pipeline 2D Geometric Transformations

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

Camera Model and Calibration

Introduction to Robotics

CV: 3D sensing and calibration

Humanoid Robotics. Projective Geometry, Homogeneous Coordinates. (brief introduction) Maren Bennewitz

Development of intelligent systems

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

CT5510: Computer Graphics. Transformation BOCHANG MOON

METR Robotics Tutorial 2 Week 3: Homogeneous Coordinates SOLUTIONS & COMMENTARY

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

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Advanced Computer Graphics Transformations. Matthias Teschner

Quaternions & Rotation in 3D Space

Affine Transformations in 3D

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

Transformations Week 9, Lecture 18

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Camera Model and Calibration. Lecture-12

Translations. Geometric Image Transformations. Two-Dimensional Geometric Transforms. Groups and Composition

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

CSE328 Fundamentals of Computer Graphics

6.837 LECTURE 7. Lecture 7 Outline Fall '01. Lecture Fall '01

Computer Graphics Hands-on

Homework 5: Transformations in geometry

Visual Recognition: Image Formation

Overview. By end of the week:

Orientation & Quaternions

Computer Graphics: Geometric Transformations

Modeling Transformations

Computer Graphics: Viewing in 3-D. Course Website:

Vision Review: Image Formation. Course web page:

Computer Graphics Hands-on

Last week. Machiraju/Zhang/Möller/Fuhrmann

METR Robotics Tutorial 2 Week 2: Homogeneous Coordinates

Viewing with Computers (OpenGL)

CIS 580, Machine Perception, Spring 2016 Homework 2 Due: :59AM

XPM 2D Transformations Week 2, Lecture 3

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Camera model and multiple view geometry

Index. 3D reconstruction, point algorithm, point algorithm, point algorithm, point algorithm, 253

Quaternions and Rotations

Inverse Kinematics of 6 DOF Serial Manipulator. Robotics. Inverse Kinematics of 6 DOF Serial Manipulator

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

Agenda. Rotations. Camera models. Camera calibration. Homographies

COMP 558 lecture 19 Nov. 17, 2010

Camera Models and Image Formation. Srikumar Ramalingam School of Computing University of Utah

Index. 3D reconstruction, point algorithm, point algorithm, point algorithm, point algorithm, 263

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

CMSC 425: Lecture 6 Affine Transformations and Rotations

XPM 2D Transformations Week 2, Lecture 3

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Introduction to Computer Vision

Monday, 12 November 12. Matrices

UNIT 2 2D TRANSFORMATIONS

3D GRAPHICS. design. animate. render

Specifying Complex Scenes

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

CSE 252B: Computer Vision II

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Quaternions and Rotations

Homework 5: Transformations in geometry

Exponential Maps for Computer Vision

Kinematics. Kinematics analyzes the geometry of a manipulator, robot or machine motion. The essential concept is a position.

METR 4202: Advanced Control & Robotics

For each question, indicate whether the statement is true or false by circling T or F, respectively.

CS184: Using Quaternions to Represent Rotation

ME 115(a): Final Exam (Winter Quarter 2009/2010)

Visualizing Quaternions

Assignment 2 : Projection and Homography

Transformations. Examples of transformations: shear. scaling

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

CSE 167: Introduction to Computer Graphics Lecture #2: Coordinate Transformations

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Viewing and Projection

Transcription:

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

CSE 167: Computer Graphics 3D points as vectors Geometric transformations in 3D Coordinate frames CSE 167, Winter 2018 2

Representing 3D points using vectors 3D point as 3 vector 3D point using affine homogeneous as 4 vector CSE 167, Winter 2018 3

Geometric transformations Translation Linear transformations Scale Rotation 3D rotations Affine transformation Linear transformation followed by translation Euclidean transformation Rotation followed by translation Composition of transformations Transforming normal vectors CSE 167, Winter 2018 4

3D translation Using homogeneous CSE 167, Winter 2018 5

3D nonuniform scale Using homogeneous CSE 167, Winter 2018 6

3D rotation about X axis CSE 167, Winter 2018 7

3D rotation about Y axis CSE 167, Winter 2018 8

3D rotation about Z axis CSE 167, Winter 2018 9

Rotation matrix A rotation matrix is a special orthogonal matrix Properties of special orthogonal matrices The inverse of a special orthogonal matrix is also a special orthogonal matrix Transformation matrix using homogeneous CSE 167, Winter 2018 10

3D rotations A 3D rotation can be parameterized with three numbers Common 3D rotation formalisms Rotation matrix 3x3 matrix (9 parameters), with 3 degrees of freedom Euler angles 3 parameters Euler axis and angle 4 parameters, axis vector (to scale) Quaternions 4 parameters (to scale) CSE 167, Winter 2018 11

3D rotation, Euler angles A sequence of 3 elemental rotations 12 possible sequences X Y X X Y Z X Z X X Z Y Y X Y Y X Z Y Z X Y Z Y Z X Y Z X Z Z Y X Z Y Z Tait Bryan angles, also Example: Roll Pitch Yaw (ZYX convention) Rotation about X axis, followed by rotation about Y axis, followed by rotation about Z axis Composition of rotations CSE 167, Winter 2018 12

3D rotation, Euler axis and angle 3D rotation about an arbitrary axis Axis defined by unit vector Corresponding rotation matrix Cross product revisited CSE 167, Winter 2018 13

3D affine transformation Linear transformation followed by translation A is linear transformation matrix t is translation vector Using homogeneous Notes: 1. Invert an affine transformation using a general 4x4 matrix inverse 2. An inverse affine transformation is also an affine transformation CSE 167, Winter 2018 14

Affine transformation using homogeneous Translation Linear transformation is identity matrix Scale Linear transformation is diagonal matrix Rotation A is linear transformation matrix Linear transformation is special orthogonal matrix CSE 167, Winter 2018 15

3D Euclidean transformation Rotation followed by translation Using homogeneous A Euclidean transformation is an affine transformation where the linear component is a rotation CSE 167, Winter 2018 16

Inverse Euclidean transformation Euclidean transformation Inverse Euclidean transformation Using homogeneous Use this instead of a general 4x4 matrix inverse An inverse Euclidean transformation is also a Euclidean transformation CSE 167, Winter 2018 17

Composition of transformations Compose geometric transformation by multiplying 4x4 transformation matrices Composition of two transformations Composition of n transformations Order of matrices is important! Matrix multiplication is not (in general) commutative CSE 167, Winter 2018 18

Transforming normal vectors Tangent vector t at surface point X is orthogonal to normal vector n at X Transformed tangent vector and transformed normal vector must also be orthogonal CSE 167, Winter 2018 19

Transforming normal vectors Tangent vector can be thought of as a difference of points, so it transforms the same as a surface point We are only concerned about direction of vectors, so do not add translation vector Normal vector does not transform the same as tangent vector How is M related to A? CSE 167, Winter 2018 20

Transforming normal vectors How is M related to A? Solve for M Transform normal vectors using CSE 167, Winter 2018 21

Coordinate frames In computer graphics, we typically use at least three coordinate frames Object coordinate frame World coordinate frame Camera coordinate frame Camera Object Based on slides courtesy of Jurgen Schulze World CSE 167, Winter 2018 22

Object Local in which points and other object geometry are given Often origin is in geometric center, on the base, or in a corner of the object Depends on how object is generated or used Camera Object Source: http://motivate.maths.org World CSE 167, Winter 2018 23

World Common reference frame for all objects in the scene No standard for coordinate frame orientation If there is a ground plane, usually X Y plane is horizontal and positive Z is up Otherwise, X Y plane is often screen plane and positive Z is out of the screen Camera Object World CSE 167, Winter 2018 24

Object transformation The transformation from object to world is different for each object Defines placement of object in scene Given by model matrix (model to world transformation) M Camera Object World CSE 167, Winter 2018 25

Camera Origin defines center of projection of camera X Y plane is parallel to image plane Z axis is orthogonal to image plane Camera Object World CSE 167, Winter 2018 26

Camera The camera matrix defines the transformation from camera to world Placement of camera in world Camera Object World CSE 167, Winter 2018 27

Camera matrix e Camera u Given: Center point of projection e Look at point d Camera up vector u d World CSE 167, Winter 2018 28

Construct x c, y c, z c Camera matrix u e Camera d World CSE 167, Winter 2018 29

Camera matrix Step 1: Z axis Step 2: X axis Step 3: Y axis Camera Matrix: 0 0 0 1 CSE 167, Winter 2018 30

Transforming object to camera Object to world : M Camera to world : C Point to transform: p Resulting transformation equation p = C 1 Mp Camera World Object Use inverse of Euclidean transformation (slide 17) instead of a general 4x4 matrix inverse CSE 167, Winter 2018 31

Tips for notation Indicate coordinate systems with every point or matrix Point: p object Matrix: M object world Resulting transformation equation: p camera = (C camera world ) 1 M object world p object In source code use similar names: Point: p_object or p_obj or p_o Matrix: object2world or obj2wld or o2w Resulting transformation equation: wld2cam = inverse(cam2wld); p_cam = p_obj * obj2wld * wld2cam; CSE 167, Winter 2018 32

Objects in camera We have things lined up the way we like them on screen The positive X axis points to the right The positive Y axis points up The negative Z axis points into the screen (positive Z axis points out of the screen) Objects to look at are in front of us, i.e., have negative Z values But objects are still in 3D Next step: project scene to 2D plane CSE 167, Winter 2018 33