Presentation is loading. Please wait.

Presentation is loading. Please wait.

3D Transformation.

Similar presentations


Presentation on theme: "3D Transformation."— 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 Anil Verma, IOE Pulchowk

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

4 Anil Verma, IOE Pulchowk
3D Translation Anil Verma, IOE Pulchowk

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

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

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

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

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

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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

11 Anil Verma, IOE Pulchowk
June 10, 2018 3D Rotation – (z-axis) Rotating around the z axis: Anil Verma, IOE Pulchowk

12 Anil Verma, IOE Pulchowk
June 10, 2018 3D Rotation – (x-axis) Rotation around the X axis: Anil Verma, IOE Pulchowk

13 Anil Verma, IOE Pulchowk
June 10, 2018 3D Rotation – (y-axis) Rotation around the Y axis: Anil Verma, IOE Pulchowk

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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

16 Arbitrary Axis Rotation
Step 1. Translation (x2,y2,z2) (x1,y1,z1) x z y Anil Verma, IOE Pulchowk 3D Geometric Transformations

17 Arbitrary Axis Rotation
Step 2. Establish [ TR ]x x axis (a,b,c) (0,b,c) Projected Point Rotated Point x y z Anil Verma, IOE Pulchowk 3D Geometric Transformations

18 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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

19 Arbitrary Axis Rotation
Step 4. Rotate about z axis by the desired angle  y l x z Anil Verma, IOE Pulchowk 3D Geometric Transformations

20 Arbitrary Axis Rotation
Step 5. Apply the reverse transformation to place the axis back in its initial position x y l z Anil Verma, IOE Pulchowk 3D Geometric Transformations

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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

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

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) Anil Verma, IOE Pulchowk 3D Geometric Transformations

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 Anil Verma, IOE Pulchowk 3D Geometric Transformations

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, Anil Verma, IOE Pulchowk 3D Geometric Transformations

26 Anil Verma, IOE Pulchowk
Example Anil Verma, IOE Pulchowk 3D Geometric Transformations

27 Anil Verma, IOE Pulchowk
Example Multiplying [TR]AB by the point matrix of the original cube Anil Verma, IOE Pulchowk 3D Geometric Transformations

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

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. Anil Verma, IOE Pulchowk 3D Geometric Transformations


Download ppt "3D Transformation."

Similar presentations


Ads by Google