Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics CC416 Week 15 3D Graphics.

Similar presentations


Presentation on theme: "Computer Graphics CC416 Week 15 3D Graphics."— Presentation transcript:

1 Computer Graphics CC416 Week 15 3D Graphics

2 3D Transformations

3 Three Dimensional Modeling Transformations
Methods for object modeling transformation in three dimensions are extended from two dimensional methods by including consideration for the z coordinate.

4 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

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

6 3D Point Homogenous Coordinate
A 3D point P is represented in homogeneous coordinates by a 4-dim. Vect:

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

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

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

10 3D Translation

11 3D Translation P is translated to P' by:

12 3D Translation An object is translated in 3D dimensional by transforming each of the defining points of the objects .

13 3D Translation Inverse Translation:
An Object represented as a set of polygon surfaces, is translated by translate each vertex of each surface and redraw the polygon facets in the new position. Inverse Translation:

14 3D Scaling

15 3D Scaling About origin: Changes the size of the object and repositions the object relative to the coordinate origin.

16 3D Scaling About any fixed point:

17 3D Reflections

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

19 3D Reflections About a plane: A reflection through the xy plane: A reflections through the xz and the yz planes are defined similarly.

20 3D Shearing

21 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 zref

22 3D Shearing

23 Composite 3D Transformations

24 Composite 3D Transformations
Same way as in two dimensions: Multiply matrices Rightmost term in matrix product is the first transformation to be applied

25 3D Rotation

26 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.

27 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.

28 Coordinate Axis Rotations

29 Coordinate Axis Rotations
Z-axis rotation: For z axis same as 2D rotation:

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

31 Coordinate Axis Rotations
X-axis rotation:

32 Coordinate Axis Rotations
Y-axis rotation:

33 General Three Dimensional
Rotations

34 General Three Dimensional Rotations
Rotation axis parallel with coordinate axis (Example x axis):

35 General Three Dimensional Rotations
An arbitrary axis (with the rotation axis projected onto the Z axis):

36 General Three Dimensional Rotations
A rotation matrix for any axis that does not coincide with a coordinate axis can be set up as a composite transformation involving combination of translations and the coordinate-axes rotations: Translate the object so that the rotation axis passes through the coordinate origin Rotate the object so that the axis rotation coincides with one of the coordinate axes Perform the specified rotation about that coordinate axis Apply inverse rotation axis back to its original orientation Apply the inverse translation to bring the rotation axis back to its original position

37 Transformations Between
Coordinate Systems

38 Transformations Between Coordinate Systems
Translate such that the origins overlap Rotate such that the axes overlap


Download ppt "Computer Graphics CC416 Week 15 3D Graphics."

Similar presentations


Ads by Google