Overview of Transformation
Transformation
Transformation changes the way
object appears.
Implementing changes in size of
object, its position on screen or its orientation called Transformation.
Basic 2D Transformation
Translation
Scaling
Rotation
Translation
Translation is a process of
changing the position of an object in a straight line path from one coordinate
location to another.
A translation moves all points
in an object along the same straight-line path to new positions.
The path is represented by a
vector, called the translation or shift vector.
Rotation
Rotation transformation
re-position an object along a circular path in the xy plane.
The rotation is performed with certain angle θ, known as
rotation angle
A rotation re-positions all points
in an object along a circular path in the plane centered at the pivot point.
Reflection
Produces a mirror image of an
object relative to an axis of reflection.
Shear
A transformation that slants the
shape of an object is called the shear transformation
X Shear
preserves
y coordinates but changes x values
Y Shear
preserves
x coordinates but changes y values
3D Coordinate Systems
3 D Translation
In translation, an object is displaced and direction from
its original position.
The new object point p’=(x’,z’,z’) can be found by applying
the transform Ttx,ty,tz to p=(x,y,z)
Here tx=distance moved by object along x-axis
ty=distance
moved by object along y-axis
tz=distance
moved by object along z-axis
3D Translation
P is translated to P' by:
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.
3D Rotation
Coordinate Axis Rotations
Coordinate Axis RotationsRotation About Z-axis In
Clockwise direction.
Note that the +ve values of rotation angle Ө will produce a rotation
in the anticlockwise direction whereas –ve values of Ө produce a rotation
in the clockwise direction.
in this case angle Ө is taken as –ve.
According to the trigonometric law
cos(Ө)= cos Ө
sin(- Ө)=
-sin Ө
Scaling Transformation
A scaling transformation alters the size of an object.
An object can be scaled (stretched or shrunk) along the x, y
and z axis by multiplying all its points by the scale factors Sx, Sy, Sz
All points P(x, y, z) on the scaled shape will now become
P’(x’, y’, z’). Such that
x’=x.Sx
y’=y,Sy
z’=z.Sz
3D Scaling
Scaling Transformation
If values of Sx, Sy and Sz<1
then size of objects reduced or the object move closer to the coordinate
origin.
If values of Sx, Sy and Sz>1
then size of objects increased or the object move farther to the coordinate
origin.
2 types of projections
Parallel
In parallel projection,
coordinate positions are transformed to the view plane along parallel lines.
Perspective
In perspective projection, object
position are transformed to the view plane along lines that come together to a
point called projection reference point
Parallel Projection
Z coordinate is discarded.
Parallel lines from each vertex on the object
are extended until they intersect the view plane.
The point of intersection is the projection of
vertex.
Projected vertices are connected by line
segments to correspond connection on original object.
Perspective Projection
Produces realistic views but does not preserves
relative proportions.
Lines of projection are not parallel.
Instead they all converge at single point
called projection reference point.