Vector Algebra Transformations. Lecture 4

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

Geometric Transformations

2D/3D Geometric Transformations and Scene Graphs

Transforms. COMP 575/770 Spring 2013

Graphics Pipeline 2D Geometric Transformations

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

CT5510: Computer Graphics. Transformation BOCHANG MOON

Linear and Affine Transformations Coordinate Systems

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

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

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Graphics and Interaction Transformation geometry and homogeneous coordinates

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

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

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

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

GEOMETRIC TRANSFORMATIONS AND VIEWING

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

2D Object Definition (1/3)

3D Geometry and Camera Calibration

Lecture 5 2D Transformation

2D transformations: An introduction to the maths behind computer graphics

XPM 2D Transformations Week 2, Lecture 3

XPM 2D Transformations Week 2, Lecture 3

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

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

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

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

Transformations Week 9, Lecture 18

Computer Graphics Hands-on

Answers to practice questions for Midterm 1

CS354 Computer Graphics Rotations and Quaternions

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

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

Multiple View Geometry in Computer Vision

Monday, 12 November 12. Matrices

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS452/552; EE465/505. Geometry Transformations

Affine Transformation. Edith Law & Mike Terry

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

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

Computer Graphics. Geometric Transformations

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

CS559: Computer Graphics

CS4670/5670: Computer Vision Kavita Bala. Lecture 14: Feature matching and Transforms

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

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

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

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

CSE328 Fundamentals of Computer Graphics

Transformations. Examples of transformations: shear. scaling

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Homework 5: Transformations in geometry

Overview. By end of the week:

CS770/870 Spring 2017 Transformations

Computer Graphics. Geometric Transformations

CMSC 425: Lecture 6 Affine Transformations and Rotations

Section III: TRANSFORMATIONS

Computer Science 336 Fall 2017 Homework 2

2D and 3D Transformations AUI Course Denbigh Starkey

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

Visual Recognition: Image Formation

Specifying Complex Scenes

UNIT 2 2D TRANSFORMATIONS

Computer Graphics Hands-on

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

3-D D Euclidean Space - Vectors

Image warping , , Computational Photography Fall 2017, Lecture 10

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

Chapter 2 - Basic Mathematics for 3D Computer Graphics

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

Chapter 18. Geometric Operations

N-Views (1) Homographies and Projection

CV: 3D sensing and calibration

METR Robotics Tutorial 2 Week 2: Homogeneous Coordinates

Planes Intersecting Cones: Static Hypertext Version

Introduction to Homogeneous coordinates

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

The Three Dimensional Coordinate System

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

PetShop (BYU Students, SIGGRAPH 2006)

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

To do this the end effector of the robot must be correctly positioned relative to the work piece.

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

What You ll See in This Chapter. Word Cloud. Definitions. Matrix Components. Ian Parberry University of North Texas. Fletcher Dunn

Computer Graphics: Geometric Transformations

Orientation & Quaternions

Game Engineering: 2D

Homework 5: Transformations in geometry

Geometry of linear operators. Orthogonal opertors

Homogeneous coordinates, lines, screws and twists

CS4670: Computer Vision

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Chapter 1: Number and Operations

3D Viewing. CS 4620 Lecture 8

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

Math 462: Review questions

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b

(Refer Slide Time: 00:04:20)

Transcription:

Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1

Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures Coordinates are used to represent points and vectors a naming scheme The same point can be described by different coordinates Points vectors (60,-40) Coordinates [KAIST] 2

3

Geometry Linear Algebra Scalar Vector Linear independence Linear transformations Frames (=Coordinates) Points Vectors Affine transformations Translation Rotation 4

y z [a b c]t v x 5

6

t denotes transpose 7

Transforming geometry Move a subset of the space (in 2D case, plane) using a mapping from the plane to itself 2008 Steve Marschner 8

Linear transformations One way to define a transformation is by matrix multiplication: Such transformations are linear, which is to say: (and in fact all linear transformations can be written this way) 2008 Steve Marschner 9

What is a Matrix? A matrix is a set of elements, organized into rows and columns rows columns a b c d

Matrix operating on vectors Matrix is like a function that transforms the vectors on a plane Matrix operating on a general point => transforms x and y components System of linear equations: matrix is just the bunch of coefficients x = ax + by y = cx + dy a b x x' c d y y'

Bases & Orthonormal Bases Basis vectors (or axes): frame of reference Any point in a space is a linear combination of the basis vectors Usually, orthonormal matrices are used for defining coordinate frames Ortho Normal: orthogonal + normal [Orthogonal: dot product is zero Normal: magnitude is one ] x 1 0 0 T y 0 1 0 z 0 0 1 T T x y 0 x z 0 y z 0

Geometry of 2D linear trans. 2x2 matrices have simple geometric interpretations uniform scale non-uniform scale rotation shear reflection 2008 Steve Marschner 13

Linear transformation gallery Uniform scale 2008 Steve Marschner 14

Linear transformation gallery Nonuniform scale 2008 Steve Marschner 15

Linear transformation gallery Rotation 2008 Steve Marschner 16

Matrices: Scaling, Rotation, Identity Scaling without rotation => diagonal matrix Rotation without stretching => orthonormal matrix O Identity ( do nothing ) matrix = unit scaling, no rotation r1 0 0 r2 [0,1]T scaling [0,r2]T [r1,0]t [1,0]T cos -sin sin cos [0,1]T rotation [1,0]T [-sin, cos ]T [cos, sin ]T

Linear transformation gallery Reflection can consider it a special case of nonuniform scale 2008 Steve Marschner 18

Linear transformation gallery Shear 2008 Steve Marschner 19

Composing transformations Want to move an object, then move it some more We need to represent S o T ( S compose T ) and would like to use the same representation as for S and T 2008 Steve Marschner 20

Composing transformations Composing linear transformations is straightforward Transforming first by MT then by MS is the same as transforming by MSMT only sometimes commutative e.g. 2D rotations & uniform scales e.g. non-uniform scales w/o rotation Note MSMT, or S o T, is T first, then S 2008 Steve Marschner 21

Translation P t P P ' ( x t x, y t y ) P t ty y P t P x tx

Composing translations Composing translations is easy Translation by ut then by us is translation by ut + us commutative! 2008 Steve Marschner 23

Is translation linear transformation? Translation is the simplest transformation: Inverse: 2008 Steve Marschner 24

Is translation linear transformation? No! because T(v)= I v + u!= I v Affine transformation T(v)=Mv + u 2008 Steve Marschner 25

Affine transformations straight lines preserved; parallel lines preserved ratios of lengths along lines preserved (midpoints preserved) Origin 2008 Steve Marschner 26

Combining linear with translation Need to use both in single framework Can represent arbitrary seq. as e. g. Transforming by MT and ut, then by MS and us, is the same as transforming by MSMT and MsuT+ us This will work but is a little awkward 2008 Steve Marschner 27

Homogeneous coordinates A trick for representing the foregoing more elegantly Extra component w for vectors, extra row/column for matrices for affine, can always keep w = 1 Represent linear transformations with dummy extra row and column 2008 Steve Marschner 28

Homogeneous coordinates Represent translation using the extra column 2008 Steve Marschner 29

Homogeneous coordinates Composition just works, by 3x3 matrix multiplication This is exactly the same result but cleaner and generalizes in useful ways as we ll see later 2008 Steve Marschner 30

Homogeneous coordinates in 3D (Affine transformation) ( v 1x v 2x v 3x o x c 1 v x c +o x v 1y v 2y v 3y o y c 2 v y c+o y V c +o = = 1 v 1z v 2z v 3z o z c 3 v z c+o z 0 0 0 1 1 1 )( ) ( ) transformation coordinates ( ) 31

32

Coordinates : 33

34

35

2D Affine transformation gallery Translation 2008 Steve Marschner 36

Affine transformation gallery Uniform scale 2008 Steve Marschner 37

Affine transformation gallery Nonuniform scale 2008 Steve Marschner 38

Affine transformation gallery Rotation 2008 Steve Marschner 39

Affine transformation gallery Reflection can consider it a special case of nonuniform scale 2008 Steve Marschner 40

Affine transformation gallery Shear 2008 Steve Marschner 41

Composite affine transformations In general not commutative: order matters! rotate, then translate translate, then rotate 2008 Steve Marschner 42

Composite affine transformations Another example scale, then rotate rotate, then scale 2008 Steve Marschner 43

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2008 Steve Marschner 44

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2008 Steve Marschner 45

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2008 Steve Marschner 46

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 47

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 48

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 49

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 50

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 51

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2008 Steve Marschner 52

More math background Coordinate systems Expressing vectors with respect to bases Linear transformations as changes of basis 2008 Steve Marschner 53

Affine change of coordinates Six degrees of freedom or 2008 Steve Marschner 54

Affine change of coordinates A new way to read off the matrix e.g. shear from earlier can look at picture, see effect on basis vectors, write down matrix Also an easy way to construct transforms e. g. scale by 2 across direction (1,2) 2008 Steve Marschner 55

Rigid motions (Proper Euclidean space) A transform made up of only translation and rotation is a rigid motion or a rigid body transformation The linear part is an orthonormal matrix Inverse of orthonormal matrix is transpose so inverse of rigid motion is easy: 2008 Steve Marschner 56

Transforming points and vectors Recall distinction points vs. vectors vectors are just offsets (differences between points) points have a location represented by vector offset from a fixed origin Points and vectors transform differently points respond to translation; vectors do not 2008 Steve Marschner 57

Transforming points and vectors Homogeneous coords. let us exclude translation just put 0 rather than 1 in the last place and note that subtracting two points cancels the extra coordinate, resulting in a vector! 2008 Steve Marschner 58

59

60

61

Note that = 62

63

64

65

66

67

68

Vectors: Cross Product The cross product of vectors A and B is a vector C which is perpendicular to A and B The magnitude of C is proportional to the sin of the angle between A and B The direction of C follows the right hand rule if we are working in a right-handed coordinate system A B B A A B A B sin( )

MAGNITUDE OF THE CROSS PRODUCT

DIRECTION OF THE CROSS PRODUCT The right hand rule determines the direction of the cross product

72

73

74