3D Geometric  Transformation 고려대학교 컴퓨터 그래픽스 연구실
Contents Translation Scaling  Rotation Rotations with Quaternions Other Transformations Coordinate Transformations
Transformation in 3D Transformation Matrix 3  3 : Scaling, Reflection, Shearing, Rotation 3  1 : Translation 1  3 : Homogeneous representation 1  1 : Uniform global Scaling
3D Translation Translation of a Point x z y
3D Scaling Uniform Scaling x z y
Relative Scaling Scaling with a Selected Fixed Position x x x x z z z z y y y y Original position Translate Scaling Inverse Translate
3D Rotation Coordinate-Axes Rotations X-axis rotation Y-axis rotation Z-axis rotation General 3D Rotations Rotation about an axis that is parallel to one of the coordinate axes Rotation about an arbitrary axis
Coordinate-Axes Rotations Z-Axis Rotation X-Axis Rotation Y-Axis Rotation z y x z y x z y x
Order of Rotations Order of Rotation Affects Final Position X-axis    Z-axis Z-axis    X-axis
General 3D Rotations Rotation about an Axis that is Parallel to One of the Coordinate Axes Translate   the object so that the rotation axis  coincides with the parallel coordinate axis Perform the specified  rotation  about that axis Translate  the object so that the rotation axis is  moved back to its original position
General 3D Rotations Rotation about an Arbitrary Axis Basic Idea Translate (x1, y1, z1) to the origin Rotate (x’2, y’2, z’2) on to the z axis Rotate the object around the z-axis Rotate the axis to the original orientation Translate the rotation axis to the original position (x 2 ,y 2 ,z 2 ) (x 1 ,y 1 ,z 1 ) x z y R -1 T -1 R T
General 3D Rotations Step 1. Translation (x 2 ,y 2 ,z 2 ) (x 1 ,y 1 ,z 1 ) x z y
General 3D Rotations Step 2. Establish [ T R  ]  x   x  axis (a,b,c) (0,b,c) Projected Point   Rotated Point x y z
Arbitrary Axis Rotation Step 3. Rotate  about  y  axis by   (a,b,c) (a,0,d)  l d x y Projected Point z Rotated Point
Arbitrary Axis Rotation Step 4. Rotate  about  z  axis by the desired angle    l y x z
Arbitrary Axis Rotation Step 5. Apply the reverse transformation to place the axis back in its initial position x y l l z
Example Find the new coordinates of a unit cube 90º-rotated about an axis defined by its endpoints A(2,1,0) and B(3,3,1). A Unit Cube
Example Step1. Translate point A to the origin A’(0,0,0) x z y B’(1,2,1)
Example Step 2. Rotate axis  A’B’  about the x axis by and angle   , until it lies on the  xz  plane. x z y l B’(1,2,1)  Projected point  (0,2,1) B”(1,0,  5)
Example Step 3. Rotate axis  A’B’’  about the y axis by and angle   , until it coincides with the z axis. x z y l  B”(1,0,    5) (0,0,  6)
Example Step 4. Rotate the cube 90° about the z axis  Finally, the concatenated rotation matrix about the arbitrary axis AB becomes,
Example
Example Multiplying  R ( θ )  by the point matrix of the original cube
Rotations with Quaternions Quaternion Scalar part  s  + vector part  v  = ( a ,  b ,  c ) Real part + complex part (imaginary numbers  i ,  j ,  k ) Rotation about any axis Set up a unit quaternion ( u : unit vector) Represent any point position  P  in quaternion notation ( p  = ( x ,  y ,  z ))
Rotations with Quaternions Carry out with the quaternion operation ( q -1 =( s , – v ) ) Produce the new quaternion Obtain the rotation matrix by quaternion multiplication Include the translations:
Example Rotation about  z  axis Set the unit quaternion:  Substitute  a = b =0 ,  c =sin( θ /2)  into the matrix:
Other Transformations Reflection Relative to the xy Plane Z-axis Shear x z y x z y
Coordinate Transformations Multiple Coordinate System Local (modeling) coordinate system  World coordinate scene Local Coordinate System
Coordinate Transformations Multiple Coordinate System Local (modeling) coordinate system  World coordinate scene Word Coordinate System
Coordinate Transformations Example – Simulation of Tractor movement As tractor moves,  tractor coordinate system  and  front-wheel coordinate system   move  in world coordinate system Front wheels   rotate  in wheel coordinate system
Coordinate Transformations Transformation of an Object Description from One Coordinate System to Another Transformation Matrix Bring the two coordinates systems into alignment 1. Translation u ' y u ' z u ' x x y z (0,0,0) y’ z’ x’ u ' y u ' z u ' x ( x 0 , y 0 , z 0 ) x y z (0,0,0)
Coordinate Transformations 2. Rotation & Scaling y’ z’ x’ u ' y u ' z u ' x u ' y u ' z u ' x u ' y u ' z u ' x x y z (0,0,0) x y z (0,0,0) x y z (0,0,0)

transformation 3d

  • 1.
    3D Geometric Transformation 고려대학교 컴퓨터 그래픽스 연구실
  • 2.
    Contents Translation Scaling Rotation Rotations with Quaternions Other Transformations Coordinate Transformations
  • 3.
    Transformation in 3DTransformation Matrix 3  3 : Scaling, Reflection, Shearing, Rotation 3  1 : Translation 1  3 : Homogeneous representation 1  1 : Uniform global Scaling
  • 4.
  • 5.
    3D Scaling UniformScaling x z y
  • 6.
    Relative Scaling Scalingwith a Selected Fixed Position x x x x z z z z y y y y Original position Translate Scaling Inverse Translate
  • 7.
    3D Rotation Coordinate-AxesRotations X-axis rotation Y-axis rotation Z-axis rotation General 3D Rotations Rotation about an axis that is parallel to one of the coordinate axes Rotation about an arbitrary axis
  • 8.
    Coordinate-Axes Rotations Z-AxisRotation X-Axis Rotation Y-Axis Rotation z y x z y x z y x
  • 9.
    Order of RotationsOrder of Rotation Affects Final Position X-axis  Z-axis Z-axis  X-axis
  • 10.
    General 3D RotationsRotation about an Axis that is Parallel to One of the Coordinate Axes Translate the object so that the rotation axis coincides with the parallel coordinate axis Perform the specified rotation about that axis Translate the object so that the rotation axis is moved back to its original position
  • 11.
    General 3D RotationsRotation about an Arbitrary Axis Basic Idea Translate (x1, y1, z1) to the origin Rotate (x’2, y’2, z’2) on to the z axis Rotate the object around the z-axis Rotate the axis to the original orientation Translate the rotation axis to the original position (x 2 ,y 2 ,z 2 ) (x 1 ,y 1 ,z 1 ) x z y R -1 T -1 R T
  • 12.
    General 3D RotationsStep 1. Translation (x 2 ,y 2 ,z 2 ) (x 1 ,y 1 ,z 1 ) x z y
  • 13.
    General 3D RotationsStep 2. Establish [ T R ]  x x axis (a,b,c) (0,b,c) Projected Point   Rotated Point x y z
  • 14.
    Arbitrary Axis RotationStep 3. Rotate about y axis by  (a,b,c) (a,0,d)  l d x y Projected Point z Rotated Point
  • 15.
    Arbitrary Axis RotationStep 4. Rotate about z axis by the desired angle   l y x z
  • 16.
    Arbitrary Axis RotationStep 5. Apply the reverse transformation to place the axis back in its initial position x y l l z
  • 17.
    Example Find thenew coordinates of a unit cube 90º-rotated about an axis defined by its endpoints A(2,1,0) and B(3,3,1). A Unit Cube
  • 18.
    Example Step1. Translatepoint A to the origin A’(0,0,0) x z y B’(1,2,1)
  • 19.
    Example Step 2.Rotate axis A’B’ about the x axis by and angle  , until it lies on the xz plane. x z y l B’(1,2,1)  Projected point (0,2,1) B”(1,0,  5)
  • 20.
    Example Step 3.Rotate axis A’B’’ about the y axis by and angle  , until it coincides with the z axis. x z y l  B”(1,0,  5) (0,0,  6)
  • 21.
    Example Step 4.Rotate the cube 90° about the z axis Finally, the concatenated rotation matrix about the arbitrary axis AB becomes,
  • 22.
  • 23.
    Example Multiplying R ( θ ) by the point matrix of the original cube
  • 24.
    Rotations with QuaternionsQuaternion Scalar part s + vector part v = ( a , b , c ) Real part + complex part (imaginary numbers i , j , k ) Rotation about any axis Set up a unit quaternion ( u : unit vector) Represent any point position P in quaternion notation ( p = ( x , y , z ))
  • 25.
    Rotations with QuaternionsCarry out with the quaternion operation ( q -1 =( s , – v ) ) Produce the new quaternion Obtain the rotation matrix by quaternion multiplication Include the translations:
  • 26.
    Example Rotation about z axis Set the unit quaternion: Substitute a = b =0 , c =sin( θ /2) into the matrix:
  • 27.
    Other Transformations ReflectionRelative to the xy Plane Z-axis Shear x z y x z y
  • 28.
    Coordinate Transformations MultipleCoordinate System Local (modeling) coordinate system World coordinate scene Local Coordinate System
  • 29.
    Coordinate Transformations MultipleCoordinate System Local (modeling) coordinate system World coordinate scene Word Coordinate System
  • 30.
    Coordinate Transformations Example– Simulation of Tractor movement As tractor moves, tractor coordinate system and front-wheel coordinate system move in world coordinate system Front wheels rotate in wheel coordinate system
  • 31.
    Coordinate Transformations Transformationof an Object Description from One Coordinate System to Another Transformation Matrix Bring the two coordinates systems into alignment 1. Translation u ' y u ' z u ' x x y z (0,0,0) y’ z’ x’ u ' y u ' z u ' x ( x 0 , y 0 , z 0 ) x y z (0,0,0)
  • 32.
    Coordinate Transformations 2.Rotation & Scaling y’ z’ x’ u ' y u ' z u ' x u ' y u ' z u ' x u ' y u ' z u ' x x y z (0,0,0) x y z (0,0,0) x y z (0,0,0)