3D Transformation in Computer Graphics

sabbirantor 23,734 views 41 slides Aug 13, 2017
Slide 1
Slide 1 of 41
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41

About This Presentation

Transformation:
Transformations are a fundamental part of the computer graphics. Transformations are the movement of the object in Cartesian plane.
Types of transformation
Why we use transformation
3D Transformation
3D Translation
3D Rotation
3D Scaling
3D Reflection
3D Shearing


Slide Content

World University Of Bangladesh

INTRODUCTION Here we introduce to about 3D Transformation

OBJECTIVE

Transformations are a fundamental part of the computer graphics. Transformations are the movement of the object in Cartesian plane . Transformation

Transformation are used to position objects , to shape object , to change viewing positions , and even how something is viewed. In simple words transformation is used for 1) Modeling 2) viewing Why we use transformation

Three Dimensional Transformations When the transformation takes place on a 3D plane , it is called 3D transformation. Methods for object modeling transformation in three dimensions are extended from two dimensional methods by including consideration for the z coordinate.

Three Dimensional Modeling Transformations Generalize from 2D by including z coordinate Straightforward for translation and scale, rotation more difficult Homogeneous coordinates: 4 components Transformation matrices: 4×4 elements

3D Transformation . Simple transformation Complex & Conjugate transformation Translation Rotation Scaling Reflection Shearing 3D Transformation

3D Point We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented as:

3D Point Homogenous Coordinate We don't lose anything The main advantage: it is easier to compose translation and rotation Everything is matrix multiplication

3D Coordinate Systems Right Hand coordinate system: Left Hand coordinate system:

3D Transformation In homogeneous coordinates, 3D transformations are represented by 4×4 matrixes:

TRANSLATION

3D translation An object is translated in 3D dimensional by transforming each of the defining points of the objects. Moving of object is called translation. In 3 dimensional homogeneous coordinate representation , a point is transformed from position P = ( x, y , z) to P’=( x’, y’, z’) This can be written as:- Using P’ = T . P

3D translation The matrix representation is equivalent to the three equation. x’=x+ t x , y’=y+ t y , z’=z+ t z Where parameter t x , t y , t z are specifying translation distance for the coordinate direction x , y , z are assigned any real value. Translate an object by translating each vertex in the object.

ROTATION

3D Rotation In general, rotations are specified by a rotation axis and an angle. In two-dimensions there is only one choice of a rotation axis that leaves points in the plane.

3D Rotation The easiest rotation axes are those that parallel to the coordinate axis. Positive rotation angles produce counterclockwise rotations about a coordinate axix , if we are looking along the positive half of the axis toward the coordinate origin. fig: 3D rotation

Coordinate Axis Rotations Obtain rotations around other axes through cyclic permutation of coordinate parameters: Fig:Coordinate Axis Rotations

Coordinate Axis Rotations Z-axis rotation: For z axis same as 2D rotation : x’=x* cos θ -y*sin θ Y’=x*sin θ +y* cos θ Z’=z Fig : Z-axis rotation

Coordinate Axis Rotations X-axis rotation : Y’=y* cos θ -z*sin θ Z’=z*sin θ +x* cos θ X’=x Fig : X-axis rotation

Coordinate Axis Rotations Y-axis rotation: Z’=z* cos θ -x*sin θ X’=z*sin θ +x* cos θ Y’=y Fig : Y-axis rotation

SCALING

3D Scaling You can change the size of an object using scaling transformation . In the scaling process , you either expand or compress the dimensions of the object . Scaling can be achieved by multiplying the original coordinates of the object with scaling factor to get the desired result.

3D Scaling About origin: Changes the size of the object and repositions the object relative to the coordinate origin . where Sx = scale factor in the x direction, Sy = scale factor in the y direction, and Sz = scale factor in the z direction. Fig: Scaling

3D Scaling About any fixed point : Scaling with respect to an arbitrary fixed point is not as simple as scaling with respect to the origin . The procedure of scaling with respect to an arbitrary fixed point is: Translate the object so that the fixed point coincides with the origin. Scale the object with respect to the origin. Use the inverse translation of step 1 to return the objects to its original position.

3D Scaling About any fixed point: fig : fixed point scaling The corresponding composite transformation matrix is:

3d scaling The equations for scaling : x’ = x . sx S sx,sy,sz  y’ = y . sy z’ = z . sz fig name: After scaling

REFLECTIONS

3D Reflections About an axis: equivalent to 180 ˚ rotation about that axis.

3D reflection Reflection in computer graphics is used to emulate reflective objects like mirrors and shiny surfaces. Reflection may be an x-axis y-axis , z-axis. and also in the planes xy - plane,yz -plane , and zx -plane. Reflection relative to a given Axis are equivalent to 180 Degree rotations . Fig: reflection

3d reflection Reflection about x-axis:- x’=x y’=-y z’=-z 1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 Reflection about y-axis:- y’=y x’=-x z’=-z Fig: X axis reflection Fig:Y axis reflection

3D reflection The matrix for reflection about y-axis:- -1 0 0 0 0 1 0 0 0 0 -1 0 0 0 0 1 Reflection about z-axis:- x’=-x y’=-y z’=z -1 0 0 0 0 -1 0 0 0 0 1 0 0 0 0 1 Fig: Z axis reflection

SHEARING

3D Shearing A transformation that distorts the shape of an object such that the transformed shape appears as if the object were composed of internal layers that had been caused to slide over each other is called a shearing.

3D Shearing In two dimensions, transformations relative to the x or y axes to produce distortions in the shapes of objects. In three dimensions, we can also generate shears relative to the z axis. fig: before shearing fig: after shearing

3D Shearing Modify object shapes Useful for perspective projections: E.g. draw a cube (3D) on a screen (2D) Alter the values for x and y by an amount proportional to the distance from z ref

SHEARING ABOUT XY AXIS Parameters a and b can be assigned any real values. The effect of this transformation matrix is to alter x- and y-coordinate values by an amount that is proportional to the z value, while leaving the z coordinate unchanged. Boundaries of planes that are perpendicular to the z axis are thus shifted by an amount proportional to z. An example of the effect of this shearing matrix on a unit cube is shown in Fig., for shearing values a=b=1. Shearing matrices for the x axis and y axis are defined similarly.

In space, we divide shear transformation according to the direction of the surfaces xy,xz and yz . Values of Sx,Sy and Sz determine shear transformation sizes for all the directions. A shear transformation about the xy plane :       | 1  0 0 0 |       Axy =   |  0  1 0 0 | | Sx Sy 0 0|       |  0  0 0 1 | A shear matrix about the xz plane :        |  1  0  0  0 |     Axz =     | Sx   1 Sz   0| |  0  1  1  0 |        |  0  0  0  1 | A shear matrix about the yz plane :        | 1 Sy Sz 0 |       | 0  1  0 0 | Ayz = | 0  0  1 0 |      | 0  0  0 1 |

Thank you so much for being with us up to now