1 / 29

3D Transformation

3D Transformation. Transformation. A transformation is an operation that transforms or changes a shape . There are several basic ways you can change a shape: Translation (moving it) Rotation (turning it round) Scaling (making it bigger or smaller). Shear (changing the main shape).

hardyr
Télécharger la présentation

3D Transformation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D Transformation

  2. Anil Verma, IOE Pulchowk Transformation • A transformation is an operation that transforms or changes a shape . • There are several basic ways you can change a shape: • Translation (moving it) • Rotation (turning it round) • Scaling (making it bigger or smaller). • Shear (changing the main shape). • Reflection (mirroring the shape about axis). • Transforming an object means transforming all of its points

  3. Anil Verma, IOE Pulchowk 3D Transformation Same as 2D. Add z-axis and z-coordinate. Use 4X4 homogenous matrix. In part I, we discussed translation, rotation and scaling.

  4. Anil Verma, IOE Pulchowk 3D Translation

  5. Anil Verma, IOE Pulchowk 3D Scaling (relative to the origin point) x, y and z values multiplied by scaling factors sx, sy and sz

  6. Anil Verma, IOE Pulchowk 3D Scaling (relative to the origin point)

  7. Anil Verma, IOE Pulchowk 3D Scaling (relative to fixed point) Fixed point

  8. Anil Verma, IOE Pulchowk 3D Scaling (relative to fixed point) • Scaling with a Selected Fixed Position y y y y x x x x z z z z Original position Translate Scaling Inverse Translate

  9. Anil Verma, IOE Pulchowk 3D Scaling (relative to fixed point) • for general scaling (relative to fixed point F) • where

  10. Anil Verma, IOE Pulchowk 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

  11. Anil Verma, IOE Pulchowk 3D Rotation – (z-axis) • Rotating around the z axis:

  12. Anil Verma, IOE Pulchowk 3D Rotation – (x-axis) • Rotation around the X axis:

  13. Anil Verma, IOE Pulchowk 3D Rotation – (y-axis) • Rotation around the Y axis:

  14. Anil Verma, IOE Pulchowk 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

  15. Anil Verma, IOE Pulchowk 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 y T (x2,y2,z2) R (x1,y1,z1) R-1 x T-1 z

  16. Anil Verma, IOE Pulchowk y (x2,y2,z2) (x1,y1,z1) x z ArbitraryAxis Rotation • Step 1. Translation

  17. Anil Verma, IOE Pulchowk ArbitraryAxis Rotation • Step 2. Establish [ TR ]xx axis y (0,b,c) (a,b,c) Projected Point   x z Rotated Point

  18. Anil Verma, IOE Pulchowk ArbitraryAxis Rotation • Step 3. Rotate about y axis by  y (a,b,c) l Projected Point d x  (a,0,d) Rotated Point z

  19. Anil Verma, IOE Pulchowk ArbitraryAxis Rotation • Step 4. Rotate about z axis by the desired angle  y l x  z

  20. Anil Verma, IOE Pulchowk ArbitraryAxis Rotation • Step 5. Apply the reverse transformation to place the axis back in its initial position y l l x z

  21. Anil Verma, IOE Pulchowk Example Ex) 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

  22. Anil Verma, IOE Pulchowk y B’(1,2,1) x z Example • Step1. Translate point A to the origin A’(0,0,0)

  23. Anil Verma, IOE Pulchowk Example • Step 2. Rotate axis A’B’ about the x axis by and angle , until it lies on the xz plane. y Projected point (0,2,1) B’(1,2,1) l  x z B”(1,0,5)

  24. Anil Verma, IOE Pulchowk Example • Step 3. Rotate axis A’B’’ about the y axis by and angle , until it coincides with the z axis. y l x  (0,0,6) B”(1,0,  5) z

  25. Anil Verma, IOE Pulchowk Example • Step 4. Rotate the cube 90° about the z axis Finally, the concatenated rotation matrix about the arbitrary axis AB becomes,

  26. Anil Verma, IOE Pulchowk Example

  27. Anil Verma, IOE Pulchowk Example • Multiplying [TR]AB by the point matrix of the original cube

  28. Anil Verma, IOE Pulchowk 3D Reflection • Reflection Relative to the xy Plane • [Do also Reflection Relative to the yz,zx Plane...] y y z x z x

  29. Anil Verma, IOE Pulchowk 3D Shear Z-axis shear Where a and b are the shear factors for x and y respectively. Do, X-axis and Y-axis shear.

More Related