CGA Unit 2 Class Notes
CGA Unit 2 Class Notes
08-02-21
_CGA_Lecture - 12
| 2D Transformation
| i- Translation
Example
Binah
o' . Initial Coordinates of the object - (Xold, Yoid)
New coordinates of the object = (Xnew knew)
•Translation vector or shift Vector = (Tx. Ir) i t . Give a Translation vector
(Tx, Ty)
• Tx defines the distance the fold XI ! coordinate has be
moved
Knerte jo Ty defines the distance the fold
has be moved.
DATE
LLLL
LL
Matrix Representation
&
Xoew [newed
=Xold all-rold
TX It
|{Xnew Il Yoew]
Li+ls
4
À = | Xnew.1 - Lol.+fil = 1
too l Yew it. 13.-::L '
B
,
Y new ]
___
Q. || Translate
and by
a polygon with 3 units in x
coordinates A (2,5), B12,60), C60, 2) direction and 4 units in y
direction
new
ew
Xnew Y new
1 3 1 1 13 il 4 l eo lol
li
Rotation
۲۱۵
• It is a process of rotating an
object with respect to an angle
ab in a two-dimensionel plane --7----- : Consider a point object
o bas to
v i . be rotated from one angle to C i ofanother in a 20 planet
io l.01. Initial coordinatew.of the xnow xold * obiecto = (Xold, Yold)
a se 11. Rotation anglė = 0 DO C . New Cordinates of the object o
after rotation = (Xnewer I crewed
Matrix Representation. In
Xold
Xnews LYnew
.coOSO - Sino | sino cosol
Yold
1 Xnew
new
c os o lsin o
sin o 24 cos o 4
=
cos 30 L sin 30
- Sin 30
cos 301
Xnew = Irnew.
cos 90. -Sin 90 | | Sin 90 cosaol lol
DATE
11-02-21
CGA Lecture. 13.
| in
Scaling
l
le
restaurant
Mynewtó
oll Xold sy 1 Yold I
pe
c's | 2
o
13x2 3x0
0X3oXo di
0 31
10. || PC1, 4) Q (4,4) R (4,0
T (13.) Scaling
factor 3 on 4-axis
la on y-aris
1.
Sy
1.
Yold
i
P
new
02-02-21
CGA "Lecturc.
14
liv. Reflection :
Reflections
O
n
r- anis
Matrix
Representation
:
I
new
rnew
=
o-
lo
X old IX new =
Xold on Yold Xn
ew=-Yold
x-axis
1 Xnew = n
MYnew TO
o xold Xnew=-Xold On Y-anis IT Yold) Ynew = Yold
-
DATE
sa -3 -2 -
2
i4
éo
-
-
-
DATE
(ИТ.
. | Given a triangle with co-ordinate points A(3,4), B (5, 4).cls, od
|Apply the reflection on the raris and obtain the new I coordinates of the obiecte
inca
Cill v. Shear
is ille flies
Carte
Fig
X- Shear
Fig: Y-Shear
MATRIX Representation _
1 x new
Ynew
ali shx x xold! 1
lol lYold
B
x-axis
10 Y- aris
X new
Tynewl
[shy
l
Xold l rold! Yold)
Xnew = Xold. Ymew = Yold tsby Xold
(new
DATE
Q. Givena triangle_with__points (
W 600) and (10) Apply || shear_parameter 2
on x gais. 912d 2 on Lars sind Hout_the_new coordinates of the objecte
On y-anis
A(1,1) - A'ri shr 1 xl xold 1 » 12/ T
lo
( Yold ] o l
aris
Bloo)
On t-axis
On
t-axis
ACL,1)
Xold
.
Ashy
ol
I roid
.
1.2
clo) ME
DATE
MO
22-02-21
CGA Lecture
15 L
-
0 | Homogeneous Co-ordinates
u For Translation
medi
a s
Y
' = 10 , ty 1 X Il lo o il
P'(tx, dyl. P
12. For
Rotation
Her
cos o | = sin o I LO
- Sino O
coso 01x O is
p! =R[0] p_
13. For
Scaling
Composite
Transformation, combined
• Sequence 1. Forming
called as
of Transformation of products of transformation matrix is also
concatenation or composition of matrices
up >> t ve
down ay ove CGA Lecture 16
right o> +ve
left » -ve I
DATE
T
25-02-211
O
Give a 3x3 homogencaces coordinate transformation matik for each of the
following franslations
A. Shift the image to right 3 units. B. Shift the image up by 2 units c. Move the
image down by 2 unit and right by 1 unit D. Move the image down by 2/3 unit
and right by 4 unit
Ixl
ao 1 ty X Y
-
A.= Ti 031 | 3:
10
B. Əli o 01 L
6
lco
3
12.5
DAT
lo 1 -2/3 X lo olu
A = (1,0).
ve To DC, 13=(0,0)!!
!ics
c=(1,1)
urz
Yuz
YE
-YE
Y
282
vra TOMTOT
ir a Wrze Y2 252 Too Todo
s ir I le
o
yr o ri le 752)
152 22
Ye + Yr21 o
lol )
2/82
-
-
-
-
RTE
CGA_Lecture
26-02 - 21)
Rotation
about an Arbitrary_Point
To rotate an object about an arbitrary_point (repryp) We have
to perform three steps: L. Translate point (ap, yp) to the origin Lii. Rotate it about
the origin ii. Translate the center of rotation back to original Looint.
I Ć
(o.s o -
21 o 21 fois ou Lo 0.5-2
2 1 = Loois / Loo lo o
LO O
DATE
no. of rows in
no. of columns in
2-
5+
اا
- بن
ونه ها.
اے
|-|
0
0
بر
انا
3
xاه 3
4x 3 .
||
|
د
و
-| 5
اد .و
ه ا=5 1
3-
در 0.5 و-
اس 5
3
) ی 5 10 ٥۰
م
.
م
و و
و
ه
| رآ: , 5
|2
ا2.
.
2 -
ا
داد
,اا
و ا رة ا, و,ر
. جي
.2 2 کا
|
21-03-21
_CGA. Lecture 18
TRI
lo
x It
cos o sino
sino olo on coso o oolanty
r
Icos o I sin o h
0
-şine
cos o
0
n
t (1- Cos 0) + yt sin o yt (1-cos o) å ut sin o
na ilala
L
I(x+y): RCO).. I(-24, -94): = R(x4y4, 0)
o
-
perform anticlock wise rotations of 45 degree to a triangle
A(2,3) B(5,5), C(4,3) about a pivot point (1,1) seillyz -Yvq oli
0-1) lo 1 || Yra Yra olo L-| loi lo o illo o il
[ Yra Yr . L
Yuz Yuz 1-2 Le_b1 @ I
10.7071
0.7071
-0.7071 I
0.7071 -0.4142
»
p'- [2
5 4
3 1 0 .7071 Ś 0.7071 3 | | | 0
-0.7071. 0.7071
0
-0.4142
|| answer not
right ?
DATE
3. Magnify the
(5,2) to fixed
triangle with vertices A (0,0) BULL) and twice of its size
while keeping c(5,2) as
7 | Txe = 5
5x=2
Ty = 2 Sy=2
_
OR
ه
ه
) ||
م
و=ه
0
2
|||0
|
||
وات2 او واال
و
.... () 2- يج
||
»
و
DATE'-,
020 - Transformation
2
:
T2
Il Translation
i
n
ļ S
es 3D Translation is a process of
moving an object from one position to another in a three-dimensional
plane
Consider a point object o has to be mored from one
position to another in 3D plane, Let. Initial Co-ordinates of obiect
o
f (rcoid Yold Zold)
: New co-ordinates of
obiecto o
__ (Xnew, Ynew, Zoewel Translation or Shift
Vector
(Tre, Ty Tz) LEIL -2
SIC
ation
MATRIX :
Xnew
l 'Yoew I Znow I
o o Tx lolo Tylx lool Tzl
xold
Yold Zold
$|| Tx = 1Iyz L
1202
A'ELI
Loo 01
O
O
1
2
Lo 1 2
looo I
o'-lo 0:11. -
lo 10 lx
a process of objects.
12. Scaling ! 0 0
T In Computer graphics, Scaling is I modifying or
altering the Size of Let Initial Co-ordinates o
(Xold, told, Zold) t hg Scaling fuctor:
Xanis = 5x Zans- Sz taxis -
-
DATE
a
I Xnew = Xold x Sze Yoew = Cold & Sy z
pew = Zold X Sz
IS F 7
1
object is object is Uniform
increases decreased o
SiF = 1
Matrix.
LA's | 2 o ol lo
o 3 olx 3 Lo 0 3 0 1 1 3. lo o o id ,
DATE
[3
Ip- 12 o o o|
Lo 3 oo__x
o o3 의 Loool
3
c' - | 2. 。
。
。|
이
To o 3 0 I loo or
p = 12 ooo
lo 3 0 0 1 x IoT To o 3 0 | |
[이이이 -
,
CGA Lecture -20
15-03-
21
I Rotation i bus
30. Rotation is a process | object with
respect to an angle
of
!
rotating an io a 3D - Plane.
11 O'Rotation with
respect
to
X-Axis. vti
Matrix.
xnew) 1 Ynew | Znew
=
[ ro o ol o coso -sino o x o sino coso o
xold.
Yold zold
o Rotation with
respect
to t-AXIS
Matrix.
I Knew l l coso
Ynew 1 = 1 | Znew 1-sin o L : L 0
o sin o ol I o olx o coso ol. 0 0 1
yold | Yold Zold 1
Matrix
Xnew l cos Ynew | = | sin o Znewil! O
o - sin o
cos 0 :0.
ool Xold 0 0 .x tald
Ok l Zold
DATE
0
0
-1
ololo
1
0
0
0
1-31
Axi to +1X3 +0 Loto -1x3 to
o + 2x1 toto O to toti
2
II Shearing
22
. Bei
30 Shearing is an ideal techinque | shape of
an existing object.in a
plane
_ . Shearing lo xo Aris
to change the three-dimensional
jShearing in
Z - AXIS
Xnew.
Ynew Z neve
lao Shiz ol xold! = o t shy o x- Yold
10 o
0 zeld
0 0 2 O olx 3 Ölo
=>
3
-
#
i
to xz plane
POIS
i XY planet ario
| X new l Oo OL
Ynew l = lo i o.olx | Znew I loo ol
Xold I rold Zold
lli &z
Plane
Xnews
Knew Znew
Xold Yold Zold
L00 Lei
-
ji xz Plane
Finde
r
1 x new
l | Ynew l
= | Znew
o 0 -1
loo
o 0 Lil told 0 0 x
Yold
o
zold
Il
Diagram,
1
o
.
.XY-Plane
il
i
Y Z - Plane
KA
ii. x z - Plane
AL
DATE
|| xx
Plane:
TA' -11 0 0
0 1 0
0 0
B =
1 1
0
0
0 1
#1--
16 HNP a
0
lo 0 -1 Looo
ali o
o
o 2
le O -1 0 1 Too e il
DATE
CGA Lecture -21
Widow Terms
TO VIEW PORT TRANSFORMATION - der to
understand
Viewport : An Window is
Viewed
area on a mapped. It
display device to which a defines where
it is to be
Window
- Window
Window
-
World
Coordinates
Device
Coordinatore
| Sequence of
transformation
1. Perform a scaling transformation using a fixed point position of
CXw min, Yin min) that scoles the Window
area to the size of the Viewport. || 2. Translate the scaled Window
area to the position Hef the Viewport.
DATE
min
mo
I sy =
y v max -y min
ha x
min
yw may - yw min
I PROJECTION
I i)
Parallel
Orthographic projection oblique projection
Axonometric projection na Dimetric projection
Trimetric projection
Prespective
A Konishing-Reint Lone point prespective
two-polnt-prespective