Tuesday, January 11, 2011

Computer Graphics

Tuesday, January 11, 2011

Transformtaion

A transformation is the process of mapping points to other locations.
Common transformations are:
1. Translation.
2. Scaling
3. Rotation

Translation

In translation an object is displaced a given distance and direction from its original position. If the displacement is given by the vector v = txI + tyJ, the new object point P'(x', y') can be found by applying the transformation Tv to P(x, y). See the figure below

P' = Tv(P)
where x' = x + tx and y' = y + ty.


As an example, consider a triangle defined by three vertices (20,0), (60, 0), and (40, 100) being translated 100 units to the right along the x-axis ( tx = 100) and 10 units up along the y-axis (ty = 10). The new vertices are (120, 10), (160, 10), and (140, 110), see figure below:

Scaling

Scaling is the process of expanding or compressing the dimensions of an object. Positive scaling constants Sx and Sy are used to describe changes in length with respect to the x direction and y direction. A scaling constant > 1 creates an expansion (magnification) of length, and < 1 a compression (reduction) of length. Scaling occurs along the x-axis and y-axis to create a new point from the original. This is achieved using the following transformation:
P' = TSx,Sy (P),
where x' = Sx * x ,and y' = Sy * y

If Sx and Sy are not equal, they have the effect of distorting pictures by elongating or shrinking them along the directions parallel to the coordinate axes. The mirror image of an object can be generated by using the negative values for Sx and Sy.

Rotation

In rotation, the object is rotated ø° about the origin. The convention is that the direction of the rotation is CCW if ø is a positive angle and CW if the ø is a negative angle. The transformation for rotation Rø is
P' = Rø(P)
where x' = x cos(ø) - y sin(ø) and y' = x sin(ø) + y cos(ø)


For example a triangle (20,0), (60,0), (40,100) rotated 45° clockwise about the origin is (14.14, -14.14), (42.43, -42.43), (98.99, -42.43)

For more details Visit: http://www.gurukpo.com/

5 comments:

  1. I m not able to understand Rotation.... will u plz explain somthng more about it..

    ReplyDelete
  2. could you please explain with proper example?

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Two dimensional rotation is applied to an object by repostioning it along a circular path in the xy plane.To generate a rotation, we specify a roation angle,Ɵ and the position
    (xr, yr) of the ratation point about which the object is to be rotated.

    ReplyDelete
  5. it's really very helpful for us to understand the topic.

    ReplyDelete