3 D Geometry Outline l l Coordinate systems

  • Slides: 22
Download presentation
3 -D Geometry

3 -D Geometry

Outline l l Coordinate systems 3 -D homogeneous transformations l l Translation, scaling, rotation

Outline l l Coordinate systems 3 -D homogeneous transformations l l Translation, scaling, rotation Changes of coordinates l Rigid transformations

Vector Projection l The projection of vector a onto u is that component of

Vector Projection l The projection of vector a onto u is that component of a in the direction of u

Vector Cross Product T l Definition: If a = (xa, ya, za) yb, zb)T,

Vector Cross Product T l Definition: If a = (xa, ya, za) yb, zb)T, then: and b = (xb, c=axb l c is orthogonal to both a and b (direction given by right-hand rule), with magnitude |c| = |a||b| sin q from Hill

Coordinate System: Definitions l l Let x = (x, y, values mean? z)T be

Coordinate System: Definitions l l Let x = (x, y, values mean? z)T be a point in 3 -D space (R 3). What do these A coordinate system in Rn is defined by an origin o and n orthogonal basis vectors 3 l In R , positive direction of each axis X, Y, Z is indicated by unit vector i, j, k, respectively, where k = i X j (in a right-handed system) l Coordinate is length of projection of vector from origin to point onto axis basis vector. o x

3 -D Camera Coordinates l l Right-handed system From point of view of camera

3 -D Camera Coordinates l l Right-handed system From point of view of camera out into scene: § +X right, -X left § +Y down, -Y up § +Z in front of camera, -Z behind looking

Going from 2 -D to 3 -D l l Points: Add z coordinate Transformations:

Going from 2 -D to 3 -D l l Points: Add z coordinate Transformations: Become 4 x 4 matrices with extra row/column for z component—e. g. , translation:

3 -D Scaling

3 -D Scaling

3 -D Rotations l l l In 2 -D, we are always rotating in

3 -D Rotations l l l In 2 -D, we are always rotating in the plane of the image, but in 3 -D the axis of rotation itself is a variable Three canonical rotation axes are the coordinate axes X, Y, Z These are sometimes referred to in aviation terms: pitch, yaw or heading, and roll, respectively from Hill

3 -D Euler Rotation Matrices l l Similar to 2 -D rotation matrices, but

3 -D Euler Rotation Matrices l l Similar to 2 -D rotation matrices, but with coordinate corresponding to rotation axis held constant E. g. , a rotation about the X axis of q radians:

3 -D Rotation Matrices l General form is: l Properties l RT = R-1

3 -D Rotation Matrices l General form is: l Properties l RT = R-1 l Preserves vector lengths, angles between vectors l Upper-left block R 3 x 3 is orthogonal matrix l Rows form orthonormal basis (as do columns): Length = 1, mutually orthogonal l So R 3 x 3 x projects point by rows of R 3 x 3 x onto unit vectors represented

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z axis pointed in viewing direction World coordinates W: Arbitrary origin, axes l l C Way to specify camera location, orientation (aka pose) in same frame as scene objects x, Wx, : Same point in different coordinates

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z axis pointed in viewing direction World coordinates W: Arbitrary origin, axes l l C Way to specify camera location, orientation (aka pose) in same frame as scene objects x, Wx, : Same point in different coordinates

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z

Coordinate System Conversion l l Camera coordinates C: Origin at center of camera, Z axis pointed in viewing direction World coordinates W: Arbitrary origin, axes l l C Way to specify camera location, orientation (aka pose) in same frame as scene objects x, Wx, : Same point in different coordinates

Change of Coordinates: Special Case of Same Axes l Distinct origins, parallel basis vectors:

Change of Coordinates: Special Case of Same Axes l Distinct origins, parallel basis vectors:

Change of Coordinates: Special Case of Same Origin l l Just need to rotate

Change of Coordinates: Special Case of Same Origin l l Just need to rotate basis vectors so that they are aligned Rotation matrix is projection of basis vectors in new frame

Change of Coordinates: Special Case of Same Origin l Why is this? l A

Change of Coordinates: Special Case of Same Origin l Why is this? l A point p = (x, y, z) in R 3 has coordinates Ap = (Ax, Ay, Az) in A (defined by axes i , A j. A, and k. A) such that:

Change of Coordinates: Special Case of Same Origin l An equivalent way to write

Change of Coordinates: Special Case of Same Origin l An equivalent way to write this is with matrix products:

Change of Coordinates: Special Case of Same Origin l This leads immediately to: l

Change of Coordinates: Special Case of Same Origin l This leads immediately to: l If we write this as l And we call , then we have

3 -D Rigid Transformations l l Combination of rotation followed by translation without scaling

3 -D Rigid Transformations l l Combination of rotation followed by translation without scaling “Moves” an object from one 3 -D position and orientation (pose) to another T R M

3 -D Transformations: Arbitrary Change of Coordinates l A rigid transformation can be used

3 -D Transformations: Arbitrary Change of Coordinates l A rigid transformation can be used to represent a general change in the coordinate system that “expresses” a point’s location

Rigid Transformations: Homogeneous Coordinates l Points in one coordinate system are transformed to the

Rigid Transformations: Homogeneous Coordinates l Points in one coordinate system are transformed to the other as follows: l takes the camera to the world origin, transforming world coordinates to camera coordinates