Example: confidence

Geometric transformations in 3D and coordinate frames

Geometric transformations in 3D and coordinate framesComputer GraphicsCSE 167 Lecture 3 CSE 167: Computer Graphics 3D points as vectors Geometric transformations in 3D coordinate framesCSE 167, Winter 20182 Representing 3D points using vectors 3D point as 3 vector 3D point using affine homogeneous coordinates as 4 vectorCSE 167, Winter 20183 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 vectorsCSE 167.

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

Tags:

  Transformation, Vector, Geometric

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Geometric transformations in 3D and coordinate frames

1 Geometric transformations in 3D and coordinate framesComputer GraphicsCSE 167 Lecture 3 CSE 167: Computer Graphics 3D points as vectors Geometric transformations in 3D coordinate framesCSE 167, Winter 20182 Representing 3D points using vectors 3D point as 3 vector 3D point using affine homogeneous coordinates as 4 vectorCSE 167, Winter 20183 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 vectorsCSE 167.

2 Winter 201843D translationCSE 167, Winter 20185 Usinghomogeneous coordinates3D nonuniform scaleCSE 167, Winter 20186 Usinghomogeneous coordinates3D rotation about X axisCSE 167, Winter 201873D rotation about Y axisCSE 167, Winter 201883D rotation about Z axisCSE 167, Winter 20189 Rotation matrix A rotation matrix is a special orthogonal matrix Properties of special orthogonal matrices transformation matrix using homogeneous coordinatesCSE 167, Winter 201810 The inverse of a special orthogonal matrix is also a special orthogonal matrix3D 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 2018113D rotation, Euler angles A sequence of 3 elemental rotations 12 possible sequences Example.

3 Roll Pitch Yaw (ZYX convention) Rotation about X axis, followed byrotation about Y axis, followed byrotation about Z axisCSE 167, Winter 201812X Y XX Y ZX Z XX Z YY X YY X ZY Z XY Z YZ X YZ X ZZ Y XZ Y ZTait Bryan angles, alsoComposition of rotations3D rotation, Euler axis and angle 3D rotation about an arbitrary axis Axis defined by unit vector Corresponding rotation matrixCSE 167, Winter 201813 Cross product revisited3D affine transformation Linear transformation followed by translationCSE 167, Winter 201814 Usinghomogeneous coordinatesAis linear transformationmatrixtis translation vectorNotes:1.

4 Invert an affine transformation using a general 4x4 matrix inverse2. An inverse affine transformation is also an affine transformationAffine transformation using homogeneous coordinates Translation Linear transformation is identity matrix Scale Linear transformation is diagonal matrix Rotation Linear transformation is special orthogonal matrixCSE 167, Winter 201815 Ais linear transformationmatrix3D Euclidean transformation Rotation followed by translationCSE 167, Winter 201816 Usinghomogeneous coordinatesA Euclidean transformation is an affine transformation where the linear component is a rotationInverse Euclidean transformationCSE 167, Winter 201817 Usinghomogeneous coordinatesAn inverse Euclidean transformation is also a Euclidean transformationEuclidean transformationInverse Euclidean transformationUse this instead of a general 4x4 matrix inverseComposition of transformations Compose Geometric transformation by multiplying 4x4 transformation matricesCSE 167.

5 Winter 201818 Composition of two transformationsComposition of ntransformationsOrder of matrices is important!Matrix multiplication is not(in general) commutativeTransforming normal vectors Tangent vector tat surface point Xis orthogonal to normal vector nat X Transformed tangent vector and transformed normal vector must also be orthogonalCSE 167, Winter 201819 Transforming normal vectors Tangent vector can be thought of as a difference of points, so it transforms the same as a surface point Normal vector does not transform the same as tangent vectorCSE 167, Winter 201820 How is Mrelated to A?

6 We are only concerned about direction of vectors, so do not add translation vectorTransforming normal vectors How is Mrelated to A? Solve for M Transform normal vectors usingCSE 167, Winter 201821 coordinate frames In computer graphics, we typically use at least three coordinate frames Object coordinate frame World coordinate frame Camera coordinate frameCSE 167, Winter 201822 World coordinatesObjectcoordinatesCameracoordi natesBased on slides courtesy of Jurgen SchulzeObject coordinates Local coordinates in which points and other object geometry are given Often origin is in Geometric center, on the base.

7 Or in a corner of the object Depends on how object is generated or usedCSE 167, Winter 201823 World coordinatesObjectcoordinatesCameracoordi natesSource: coordinates 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 screenCSE 167, Winter 201824 World coordinatesObjectcoordinatesCameracoordi natesObject transformation The transformation from object coordinates to world coordinates is different for each object Defines placement of object in scene Given by model matrix (model to world transformation )

8 MCSE 167, Winter 201825 World coordinatesObjectcoordinatesCameracoordi natesCamera coordinates Origin defines center of projection of camera X Y plane is parallel to image plane Z axis is orthogonal to image planeCSE 167, Winter 201826 World coordinatesObjectcoordinatesCameracoordi natesCamera coordinates The camera matrix defines the transformation from camera coordinates to world coordinates Placement of camera in worldCSE 167, Winter 201827 World coordinatesObjectcoordinatesCameracoordi natesCamera matrix Given: Center point of projection e Look at point d Camera up vector uCSE 167, Winter 201828 World coordinatesCameracoordinatesuedCamera matrix Construct xc, yc, zcWorld coordinatesCameracoordinates29uedCSE 167, Winter 2018 Camera matrix Step 1: Z axis Step 2: X axis Step 3: Y axis Camera Matrix:CSE 167, Winter 201830 0001 Transforming object coordinates to camera coordinates Object to world coordinates: M Camera to world coordinates: C Point to transform.

9 P Resulting transformation equation p = C 1 MpCSE 167, Winter 201831 World coordinatesObjectcoordinatesCameracoordi natesUse inverse of Euclidean transformation (slide 17) instead of a general 4x4 matrix inverseTips for notation Indicate coordinate systems with every point or matrix Point: pobject Matrix: Mobject world Resulting transformation equation:pcamera= (Ccamera world) 1 Mobject worldpobject In source code use similar names: Point: p_object orp_obj orp_o Matrix: object2world orobj2wld oro2w Resulting transformation equation:wld2cam = inverse(cam2wld);p_cam = p_obj * obj2wld * wld2cam;32 CSE 167, Winter 2018 Objects in camera coordinates 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, , have negative Z values But objects are still in 3D Next step: project scene to 2D planeCSE 167, Winter 201833


Related search queries