Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
9 views60 pages

Transformation

The document discusses transformations in 2D and 3D geometry, including composite transformations achieved through matrix concatenation. It explains the significance of the order of transformations and provides examples of scaling, reflection, and the window-to-viewport transformation in computer graphics. Additionally, it covers clipping algorithms for points and lines to determine visibility within a defined viewing pane.

Uploaded by

a2641150
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views60 pages

Transformation

The document discusses transformations in 2D and 3D geometry, including composite transformations achieved through matrix concatenation. It explains the significance of the order of transformations and provides examples of scaling, reflection, and the window-to-viewport transformation in computer graphics. Additionally, it covers clipping algorithms for points and lines to determine visibility within a defined viewing pane.

Uploaded by

a2641150
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

1

13
A transformation of the plane T1 is followed by a second plane
transformation T2, then the result itself may be represented by a single
transformation T which is the composition of T1 and T2 taken in that order.
This is written as T = [T1]*[T2].
Composite transformation can be achieved by concatenation of transformation
matrices to obtain a combined transformation matrix.
A combined matrix −
[T][X] = [T1] [T2] [T3] [T4] …. [Tn] [X]
Where [Ti] is any combination of
•Translation
•Scaling
•Shearing
•Rotation
•Reflection
The change in the order of transformation would lead to different results, as in
general matrix multiplication is not cumulative, that is [A] . [B] ≠ [B] . [A] and the
order of multiplication. The basic purpose of composing transformations is to gain
efficiency by applying a single composed transformation to a point, rather than
applying a series of transformation, one after another.
There is no such thing as a 3D projector
(yet), so it’s harder to Imagine projective
geometry in 3D,
but the W value works exactly the same
as it does in 2D.
When W increases, the coordinate
expands (scales up).
When W decreases, the coordinate
shrinks (scales down).
The W is basically a scaling
transformation for the 3D coordinate.
20
27
A 2-D triangle is defined PQR with vertices P(30,20) , Q(90,20) and R(30,80) is to be
scaled by factor 0.5 about a point X(50,40). Determine:
1. The composite transformation matrix
2. The coordinates of the vertices for a scaled triangle

Step-1 :Translate point X(50,40) on origin

Step-2 :Scale the triangle about the origin

Step3 - : Inverse translation of point X


Step-4 : Calculate Composite Matrix
Composite Matrix =

Step-5 : New position Of Triangle = [CT]* [P]


= [CT] *[Q]
= [CT]* [R]
CT=

PQR=

A 2-D triangle is defined PQR with vertices P(50,40) , Q(100,60) and R(70,80) is to be
scaled by factor SX=0.5 and sy = 0.7 about a point P). Determine:
1. The composite transformation matrix
2. The coordinates of the vertices for a scaled triangle

P’(50,40), Q’(75,54), R’(60,68)


35
A 2D triangle is defined PQR with vertices P(2,5) , Q(6,7) and R(2,7) is to be reflected about
line Y= 0.5x +3. Determine:
1. The composite transformation matrix
2. The coordinates of the vertices for a reflected Triangle

(2,7) (6,7)
Y= 0.5x +3

(2,5)

(0,3)

(0,0)
Step-1 Original Points
Step-2 Translation
Step-3 Rotation
Step-4 Reflection about X axis
Step-5 Inverse Rotation
Step-6 Inverse Translation

Calculate Composite Matrix=

New position Of Triangle = [CT]* [P]


= [CT] *[Q]
= [CT]* [R]
[CT]=

P’(2.8,3.4), Q’(6.8,5.4), R’(4.4,2.2)


3D Transformation
Parallel Projection
Perspective Projection
Orthography Projection
Orthography and oblique Projection
Isometric Projection

Transformation for Isometric View


=[Front View]* [Rotation about x with -35.26 Degree]* [Rotation about y with -45
degee]
Perspective Transformation
Window to Viewport
Window

➢ World-coordinate area selected for display is called a


window.
➢ In computer graphics, a window is a graphical control
element.
➢ It consists of a visual area containing some of the
graphical user interface of the program it belongs to and
is framed by a window decoration.
➢ A window defines a rectangular area in world
coordinates. You define a window with a GWINDOW
statement. You can define the window to be larger than,
the same size as, or smaller than the actual range of data
values, depending on whether you want to show all of the
data or only part of the data.
Viewport

➢ An area on a display device to which a window is mapped is


called a viewport.
➢ A viewport is a polygon viewing region in computer graphics. The
viewport is an area expressed in rendering-device-specific
coordinates, e.g. pixels for screen coordinates, in which the
objects of interest are going to be rendered.
➢ A viewport defines in normalized coordinates a rectangular area
on the display device where the image of the data appears. You
define a viewport with the GPORT command. You can have your
graph take up the entire display device or show it in only a
portion, say the upper-right part.
Window to viewport transformation

•Window-to-Viewport transformation is the process of transforming


a two-dimensional, world-coordinate scene to device coordinates.
•In particular, objects inside the world or clipping window are
mapped to the viewport. The viewport is displayed in the interface
window on the screen.
•In other words, the clipping window is used to select the part of the
scene that is to be displayed. The viewport then positions the scene
on the output device.
Window to viewport Transformation

➢ This transformation involves developing formulas that start with


a point in the world window, say (xw, yw).
➢ The formula is used to produce a corresponding point in
viewport coordinates, say (xv, yv). We would like for this
mapping to be "proportional" in the sense that if xw is 30% of
the way from the left edge of the world window, then xv is 30%
of the way from the left edge of the viewport.
➢ Similarly, if yw is 30% of the way from the bottom edge of the
world window, then yv is 30% of the way from the bottom edge
of the viewport. The picture below shows this proportionality.
Window to viewport Transformation
Point Clipping Algorithm

Clipping: In computer graphics our screen act as a 2-D coordinate system. it is not
necessary that each and every point can be viewed on our viewing plane(i.e. our computer
screen). We can view points, which lie in particular range (0,0) and (Xmax, Ymax). So,
clipping is a procedure that identifies those portions of a picture that are either inside or
outside of our viewing pane.
In case of point clipping, we only show/print points on our window which are in range of
our viewing pane, others points which are outside the range are discarded
Line Clipping Algorithm

Cohen-Sutherland Line Clippings:


•This algorithm uses the clipping window as shown in the following figure.
•The minimum coordinate for the clipping region is(
XWmin,YWmin)(XWmin,YWmin)
•and the maximum coordinate for the clipping region is
(XWmax,YWmax)(XWmax,YWmax).
We will use 4-bits to divide the entire region. These 4 bits represent the
Top, Bottom, Right, and Left of the region as shown in the following figure.
Here, the TOP and LEFT bit is set to 1 because it is the TOP-LEFT corner.
•There are 3 possibilities for the line:
•Line can be completely inside the window (This line should be accepted).
•Line can be completely outside of the window (This line will be completely removed
from the region).
•Line can be partially inside the window (We will find intersection point and draw only
that portion of line that is inside region).

You might also like