Ciecsea)
Module 1
Comprles cyapht, ond Cperl
Besies of Compiles Graphics
Whok if Cornpuler Grocphics 1
* Computes psophics is an ont Arassios
pickuses ' trode, chonts ke a eepulese
usth —the help of Prcqoornmniry. :
* Corepues gysaphites ‘mage ig rode up 4
numbes of, pixels. picks is. the Sirallesk
addsessalle qrsaphical unit wepeeserted 8
Computes ‘Seen | C
3 Gsoghe and cheney
Doka Plotting with donate “elect , “commerly
used to Suromestge —Pinandol , shalidical ,
| trothemelical, seidhtilte,, engneesing , and
econorric data Yos weseasch sepasts | tronagenk
| Summasie¢s » Consumes ichoomokion bullebing
and. thes types a publications :
9 Computer-aided lesign :
aA Mofos , use computes gpsapies Xs th
{ dlesicn Psocesses «, pet Nculasly Rows erdineentng
and onchiteck ol ae i .
=> cP, | Computes - aided design ci cap,
kers deol i ond deign methods ose”
pow ~soukinay “bech An mobiles , atscuolts,
Computess :
Scanned with CamScannerQe |
My /
OVishual - Reathy Easienmen!
Airienalfons fn vielual - vealty envisonment, Oe
Ofer used bo Lvatn _heauy- equipment
Opesaloss oo -to analirye -Kne ellectivenese
of Vasious cabin corbiqueations, and arte
| Placements
a) Dela Visualizalione
> ~Nese ase many JL esen| landg d,
dala sets and eblecive’ visualization
D Galledion of “Aka Gan contain
Seqlen Values | Yeckoss lighes ove
-tensoss
© Education ond “Fexining ;
—> Computes enesated models of physfcal
Biooncial, polttical, Socfal, econonte ed
othes suplems ase Men used as eduction,
oi E E
EQ+ Colos- coded . Magzam ‘tn opesation q 4
o nucleas weackts', atscsat pauol °
2) Compiles ost -
> Freaphtes arse ° used tq : Fine Ast, Gominerit
fro oppications: and) Ivathemalcal fist”
We oactisk uses & | Combination of aD
medeling packages, beacuse’ _mopein in
“pooq sani and CAD Sofie : 4
> pa plotbess Gseale Automalye ftol
Scanned with CamScannerG) Enrestctnnnest
SGwaphtes ase Commonly used in makin
mootion pickuses , music videos J television
ne objets aan be Comlined . wilh
Hue _acktons
Wwe 0
Eq Avtar Movie
hy Doge Processing:
> moge Processing applies Lednntques dey.
modihy os inespsel existing pictures «
(qrotoqsapls, WV Scans). ; !
3% apply Tmoge processing methely, the
‘imoge roust be “didikicied Pasd .
Duseds ip yor PEL. coreCeoneties ois
(Compited rsa termoquophy)) CS C peskion emission ©
Sud» tome gag)
2) Greaphical Uses TTobeshaces
> is Common now, Pow 1 applications
Sol\worse to “pyboa provide gvophical Use
anherhoe, (Gvz)
aA rmajos Component of Gur AZ a
usindow _rnanoges: allows “a uses so. dep:
roultiple , sseckangulan Seseen oseas called:
Scanned with CamScanners
Video Dieplay. Desies t Restor Save _od
Rasles_Stan displays ; groghies exlwore
Video _Dioplay ‘Devices «
— he pamnarsy oukpul deze na Ssophtcg
Syetern fs a Video monilos |
— Histosteally , the opesa\ion & moet Videg
monitess was based on the shandard
Cothotesoy tube Cer) destqn, but” Several
othes -Lechnclogies exit |
) Randorn = Scan: vi \ ¥ wie S Je se
ee EY Cit ed
Line Asausing and kool! reaistng |
in a pee | yl
* Neckos guelem” Consisls of dtep\ SOCESSH}
Coanbeties) 'dteplay bubles memos CRT.
-> When opescled Gs’ a wondom- can ds
rik, a chet has the dedwon bear *
disecked only be Aho rece ports of he
Scseen whese a Xctuse — f.
Sat. Ucar) a
> pickuses ose genesdhed as’ Wine’ dso
wth “the ~leckson ~ beam Lsacing oot ae
Component’ Krmes one alles Ae, “Liye,
> Sos this sseagon, “sand -Sang %
ese olso selewsed bo ae thee
Vector ceseyy
Scanned with CamScanner<)
AE) =Ke Component kines of a Picuse can
be deowon and ~sebseshed by a sondom-
Sco system % any Specitjed Osders 4
> A pen fplottes opesces th a Sierilon
way and i an examfe ho pardon san
bod copy device 3 ntiiot 5 aS ;
mae Relnesh. sate oy a! -~wandom- gcan’: sytem
depends on the oes ob) a b
lepends on =k nurrloes | _ lines ¢
cieplayed on that system :
“i) Racker Sean» Plegays
>the dleckson bear B Swept acwoss. the
Scseen one “wou Gt a Ame fren top 4,
Yolo: fi a :
> Pe Hh moves. acsoss each p08, thé’ beam
fotensity ig tuned on ond off 45 cceal
a patkesn d, illuminated spols: ;"
> Wis Scanning, process 5 Called adlseshing
each Compete Sconn' ni 4 & sSaseen To
fosmally “auited a some a
> Picuse delinition te ckésed tn mmemosyy
ewea colled tho —Rsame bulber :
Scanned with CamScannerCass='¥n Case of Voc and wile ¢
300) black & wie: a pathe “Reahe by ally
the’ Values called a Lkmop
> eac\ aren a tat lst
data — isd clesming one Ci) amd
off (0) of the . » Weretty of sieeaxct
~ Opse-3 + bp ‘Cose a colo! lems :
>on coos syste, ug “beam bel
Skosing the “Values of -the prod.
Gi\ed 0 peter:
—>eod er tw the ps ie
1 Prermop oxtupie a
TRS ae bo” ~epresert aK ioe
Baste Adberktons a
Raskes + A kor
ie meng ony * ell
D pixel + one dot. ele
ement oy Bre 4 Jer:
dlelfnad as, rated as
Soseen on soi O70) ‘on
Scanned with CamScanner> Scan Kine » A -wow of pixels
2) Fesdlulion: +e of picel Peaitions Ahok can
be pkted
5) Acped Bako. 4+ of hosigortel potnk to
Neslicol pairs
*) Bikeaap: @ -Tsame baller wth mule
bik pes pixel { |
> Picenap: a some butfes “usilh rodltiple
als pes pixel
*) Hoateatel wekenerecluiS) the leg dh
scseen, alkers “sehxeshing each Sean \ine 4
19) Nedical wekwace's cleckson Ibearn’ sebuxns by
the +e lak COBNSs of the Seseen es begin
Abe nesk Sesame!’ : = ae
Rebsch cles ave desctleed ty unils
pes seconds), A Masts (2). Sab
wy cles
“Wpes 4 w Jesh eI '
)=nteslaced Cnashy fos ru fos seduced
Pickestn \ -'Notionol Television . System
Bhise we exch fame ig Ae ia
two posses vs
Y-Rock pass) + odd ~ Pelds ld ~ numbesed: Scan lin
) Secor) passe “even? eld # even~ runloesed Sean
ines -
Scanned with CamScanner[ yy Non -rkesloced : 4
Conoy fox — morttes)
> seljsedh sole + eq Goa os moe
Difference lelween Rastes scan System arte
Parser Scan System
_s.vo] Radon Scan || Rases Stan
While the sessloliy
yp [Ake vsesclution of
Ff wostes scan
WONATM. Scan fg Highes
Hthan vsaskes scan lowes hom “sandy,
Co
a | ts costes an Justtle the cast of
: ssasles' Stn | . foaskes sean %s leggy,
, Mon ssandom Scan,
3. |Any altesotion fs easy |foly “ollesalion 's
th ferry wy .
hee dah gees
4 Eneswoeaving te not | Tintex searing “Is
c eye
used +
s |4t ts Salable fos | 4, ig dake
applications Bequising |Pos- ceealin
a}. PANG99 ch esuings ~ealichtc one
Feame Bales: | 7
A Leome bulhe
emo be Brought
Compules Mmemosy oid ea 2 Ge
Nmenstonak cxssouy wth "cack &}) ols
\ocakion Gsvespondy a Wwessall
9 x bre piu
(> Bt planes ts he number A ats
Cossesponding by each pool :
Scanned with CamScanner_—_ 3 — ets ee
>A typical sare bubher ssesolukion sigh
be
640 X 48D XB
laso x 1024 XS
(aso X loay Yay
Graphics Sehhoowe
4 these ase -bwo besood clossili cotoms Sox
cormpates - asap nies Sotusase
: Spectal - ‘puspase packager : Special - puspese
packages ase designed Ros Nem psoysaroMess
ar genesche Picluses,, .guaphs, choxts eke
. Genesal Pscqsamnuning podeagas . 4h provicee
a Woscuy 08 gparhics DPanckions “—Hhok avin be
used th & swogsamming lanquage Such as
C, Cat, Mn 1
ey Gl (Ersophtes Vibwaouy)) ( “Tou. aD omd Faun
2D , : )
Coosdincte ‘Reprccentaltons «
> genessle a pickuse si a psoq~ammi
pockage we Sst veal to ane ee gale
descsiptions a, the okjeds hak arse Le
i to
sp known 08 -ordinates.
4 Co-ortinale lus Dos a pictuse org
qven tn! Some othes Selpsence Psame, tray
a ‘ en fo Geeston Coorlieals
Severs Khesent Cashed
teomes ose used tn ‘he. wee 4
Corskoucking ond Asplayng +
Scanned with CamScannerSar Fig, beily Wusteals the — sequane 4"
Cbence -Lvane|cometions foo om ling
Coosdinds by devia Coondinales hey Q
Aisplay
viewing 4
PEAT a™
Coos
fF deo
NEO ay
= VY
| Modeling ve No
Coosdinodes >
: J) ete
ay |
Zz w i
fe Rae ae Prana
[a i >< Device
j i . Coordin,
- Coe Soc Fam) ee SSN
Cave Yue BS Gre dpe HPS Gene 2a)
> Gre Yee)
Crooghtes Poncltong +
* oukput printlives / pict chasaces shot Si
sksaiqht ines, Cursved \ines, polygons eS
X Adkailoubes « oek poopesties of outpul
primitives such “as cAos Spectl teary (i ;
styles, ty pollesns , ele. : oe ii th
x Gieometsic stsanshicmalions : Chex
position , osierkaion 4 ze “t
Scanned with CamScannerAA Viewing -bsansformnabions + Sdeck a View
he scene, -Lype oy posjection +o le Used,
lookon ON Video months whese —the view
je od be isp .
4 Tope Fandions 2 Conse)’ and ‘process Nhe
deta flow som §nrewackive devices,
4 Gxreol Opesctions + house _ Keeping Aosks
such Alearsing a Seseen dieplay cowo
Guages towne
¥ Development a she OpenGl. RPxr
+ OpenGl fiscwkectuse | a
> OCperGl \ aga ‘Ade Fhochine
4 Sundions 7” uw
>In \98n , Geaphteal Kernel Suyslem (XS)
woos odopted os cthe : Pot, gpaphtcs i
Aomdasd by the. ctrkemaltonal . ‘shan doads .
Osqorfeation (xsoy* .
>-he gop hic’ toortstotions, oom aitcon
Groaghies, Ine Gea), Came with a ce dq.
ssoutines led os 8 GL Geopltes \shiseny)
Trisoduclion +p: Open P|
Whet ts" Open@lY
~>Is a CGonss- language , Csoss=plakfonn -
Arr bos sendexing ab’ dire ab veclos
qpsaphies
Scanned with CamScanner> Devdopmert dowted by sear (sition
Giwaghtes FNS ak 1991. Celevelopess qeeurs
name was ARB Creo, Mies , Notte aj
= Conskanke 4 daka ype names begin
with SQL". ; :
OpenGl Libssoostes :
st Open _Cose
=> OpenGl3Q on Windows »
—> GL on” most untee| Liew Syslens
_ & OpenGil_okth Ukrsony Gi) ‘
—poorides Pandivoaly T OpenGl cose but
OnkdS houtng to sewsile code
~ ay Links wth usindos: syplemn
= GLX fos X sindow gyslem.
SB WEL Pos Window | =
3 DEL fos Madntosh ” a
% GLU Copenat ‘ulalty ’ Wesco) . r he
> Poovides Rencttonaltly Common -bo alt
Window igys\eme
Sohn 6 :
Peodes “Hes =
>in oa gsayhics sogwans , We - will ‘Rood
ie gndude the inte Ble bs the
OperGal cose Nowony fst
in WIndows , | Si
“ke include z windows + hs
Scanned with CamScannerakincdude 2 GL [alsh =
ont e sseplaced by GLUT eae Le :
ak include EGIL four b>
5 pre OS X_ susierg ,
By include 2 GLUT [avs h>
Opera Fanclion Format
~~ Jundion nary be Daz
tg dimension Can
vectZeah Ce, 4 zz
fe
ar ™ cq ase oak
(pdores * Mose: te
ras, Chsuctuse $i :
¥ [mote] | EAS oO
ral he” cattkack Punckrens
—Dopens one os mose windows uth the
wequised “‘psopesties: :
—eness event loop
* ais he aloe vadahles
WS5 Viewing
—> pibules
*
— perl Fandion ’
=> Sch virlow Tunction.
Scanned with CamScanner“pees
Ser) el ero
Vy
(BL LINES} alles Aci ahsiess Hine f pin
d Vexkices eee os In Vic
ne / Seqeants). vy
No Ao
‘ x Na. wih eect is
. : Us
N qu) a a
So”
~ b ele, sConvene polygon:
= STE 49 J
aay ees = S
detain
BoB pl as al Coates
hy oH, Inlexpoaled Qs, be a
iT : :
(acai STA - ie to teats Qa a
re cticn oh Cometded Th
Sedeg Gonnecled thre Seamer)
Scanned with CamScannerScanned with CamScanner~ pitetbuls : these» awe, the post a, ithe *
Opengl state 4 Aelesmine te appearan,
objeds
¥ colos (pais, nes L¥ygons)
x Kye & width Cpsinls Noes)
x stippe polleon: Cnes , poyqen),
SF paygen mock
> Aspley as Ayied
> Aispley edqes
= ctisplay Vesticos
Line croousing Algosilhmn . x
=A reat ght - Kine Segment th a. Scone
ctekined . by Co-owdtinale positions, Pos tho |
end pois “dy the’ Seqment |
. 3 Programmes ‘epedles, ee yy Values of 2nd
ples “Ee
—> reed alg oxen a Riguce out which
irkesmediale picels ase_on line oth =
> Ackual compuled pelesinedile — {¥ne
voles may be Pleats
ee Rounding may be ‘sequised ;
=> sloped nes end up hewtng Foggtes
> Vertical , hostgontal Kines ,- Do _fogges ”
dope Y= me ere eae
4
. ‘Ye
xo sand
-
Scanned with CamScanner7 |
Diatal dihlesential final (ps): Cline "|
= Bes mae Seok algostthn)
-sthe ppl fe © scan- convession line
alagsithm based on Catealating Sy &
5p re 9 sampled ok — unrt ankenvols
qn ne Coosdinde and the Cossespon ding
integes eluge neased the line path co
deaesmine
—> DOA algositaen has Ahsee | cases So
Qse=\= at M21, o Incsement fo anit
inesvals . ; ;
Tey Xphi = Med | :
they = Chea - Ye) [Creer ~x#)
Me Yat Ye : a
eee
Gse-2s 4h mst, oY fnasement fount
Inlesvals
Veen Geay = 4 tl
then, m = (Het) Ge) [Gey |e)
(Spay =x) =)
~—S
Cased s 4h ms), both x amd
Yesement unt inkesvalg 4
tery anal = Xe +) and Yeu =Yy 4)
The pon olacetthm
a % Leckes method
Ros Blcalatng pire position then ore
Scanned with CamScannerYhok ckisedly jmplemede. =
Opsel: cole fas DOA allen
Arinclude esktiohs
. inline tn\ dun) Coone\ {oad a) foebusen
( ink (o +0- ;
void DDA Line Cank Xo y In Yo, av an
ink Yend)
th dx = xeny Xo, dye Yond Yo, Steps,
lock some, gee eg fi
Th Corsa). fabs (43) ek
ps = folbs (dee) - =
e\se ert : t
Sleps = fobs Gy):
ine = Hlok Car) | Most (clep.)«
Jie e = #loak (4g) / flood (cep) ;
set peal Geaind (x), eound(y)) 2
ee (Age sleps s ket)
ee Pen Gp i !
Nt Ua cs "1
phil Ceound 6 ' sound(y)).
4 i itisd (ave
Deowbeds .
4 DDA wo the Singles \ine chsaustng algo
> Nek voy ebfident | ed SP
—> Roind opesdion Ig | expetgua |
Scanned with CamScanner
iK Opkion algostthm ly pt
wat pon Srey oe
Peter: Example
DAY DEA algest hin to dsow, Mine us,
end meine Core) bo Cais)
by m= YoY Woe Ss
My-ej . ay ee
| plot | Mplet |: Ge.g)
b o> pom
\ i. ©.)
biel aid
2 2 Gy
ib
| 4)
the wa “8 .% @.s) |
oft Nee
Scanned with CamScannerBseserbom's line - chsouving alaostthmn oN
x Accursate 4 elgcrent
i Uses only fncsementoh inte dlatlebion
> he method te deseshked fos o Uy
Segment with a positive slope. less Po
ome -
—-te methocl generale to k
Sine aes Considesing “Wes
oe * oe ockans ¢ Quadsanh
- . a
Bresenham's Live alasetthm fos Irn) 2
| TER Se eR Ra circ < Gnd
_ dose he aCe endpcink = GoM)
Q tes Geo ye) into the Psome | bublec
+h am the Ptssk point. _.
> calalale, collate ge
& cktoin the Bh lat fe SA te
Po= ROYy= Be ane
4 PE each XL, alon “le
qi the Wine -ohashy
k=o, peskoom the -Paosiny. “ha: a0
4h Pe 20, “the Neck point plat ig
2 Gal Te) f°
Pet = Petagy -
Olheswise, the Nest
Cars Gert) and
Pei = Pet 2dy- dbx ;
5 Repesk skeP 4° te Hines
Scanned with CamScanner
point bo pol tyPseude cote :
rinclude z lat -h>
ye Include & moth ths
/x Bsesenkam line - Asawsing procedure fer
\m)\ 2190
Votd UneBwes(int xo, tnt Yo, thaend ,
tek end)
tw dx = fabs (ath) — x6), Ay =Habs(yend 4),
Wh oy, Pie akadlys dee
int -Lwody = ax dy ' ~LuacDy Minustbxc =
ak y -dx) s
be > end) f 4 x) ;
?
Stead | Y= Gend mend =Xo .
else { ie iN)
m= Koj Y= de, or |
selPtxel Ge y\s 0
while Gee x end) {
OR
heeo)
Pa = hoody 5
else f i
Yat
_ Px = hwo Dy MtnusDac 5 |
4
SalPioak (x, D>
Scanned with CamScanner+ Doaw lhe tine with end poink ba,
‘ (30, \2)
ly Bx (end point) Xo=20, 4, =lo
Ox = %-%) = a-20 =10 Bane = 2,
Ay = y,-y, = \B-lo 23
Uby = ger = (8) = 1C
dy - QAK Z \ger0 = y | Repect
P : Mx -1
O° = Ady \o-\
[Pe eT enone
=4
= Kegel dedsion
poniarndhe Pa =650
. . a BS)
Caen Yer)
Car, ii)
(2, 3)"
(23,1) °°
Fu 18)
om Wy)
niger
(a3, ie
Cas, iS
Cag ; 3)
C30" os
- Oo
got nurw®
a
Scanned with CamScannerL2-|
vol dfeiy a3] 24
Cisde. geneso¥ion ‘uit nid - fl pat»
nd ant ciscle “aM Again
~ ca Wevecal
dscle
points om Oo
Origin by
Orso a crsdle -
To. apply the entdpa cnckned,
a ciwdle sundion as |
sedted J2 ae God) ey pip
h £G.¥)=0 then % is on. the cisde
\ 2.4) 20 "then tts v oubt te Lhe Grace
he 2&, Ja, {en hts inst he
Sate
{nesermeny ig
cy ey
Ea om, Sues
only one Odork's Cary 7
Ghealaion Cx.)
needed
ceed
EsA
29 [Bo
genesales a 4
Xie
we, Aine
Cisce
Scanned with CamScannerhe and Ockent ig good_asc to ceato |
4 AL walle defined Puncion tr thy
domain “als
— Single - Valted |
— No Veskteal Longer » \clope|s |
E Lente alsell, to the » rridpoint Opprsrag,
~omly need Grader E a se. :
x Tmplat Porsrowtotion FGa y= Saye
~ fos Gay) on the Ciscle, F649) a
TFG) so. 5 Gay) ods
-i GY2o Sé, 3) Onside.
oe decision ee ee 7 pe ip
then d= €()s 0 5 € Pg
= a de HM) 2056.
Midpant etedeAlgoeilhiras)
\ pel sadus oe ond cticle Conlen
Gros) 4 abtoin tho ftsst point on
Aye crscaresena, OF a!) -atscle . Geblesed
of Kho; Ostqin a8 i : .
2 Colculele he weal Wena 5
clection pasar ty Walle «oh, Ah
oS Se my
3 pL each Xe position , starting od
c=0, peshonn ho ~Fatloraing est
au Py 20, the nec prin along che
Scanned with CamScannerAscle Coresed on (0, 0) tg Gye) Ye) ¢
ctheawise, Who nest potnl long the
ascle iy Gyai 1 Yy -1) ¢
Pevi= Py takel — 2441
pattie A Mee ge
akt\ = AxX~e2 amd.
Bea y = Qe
y+ Dekesrmine Symmebey pants inv the others
Seven ockanhy. .
5. Mave each calculoded pesl postion &.¥
one the — ctsculos path cenlesed on
Cee, Ye) asne Pot ho coosdinat: Uolus:;
MSxtXe | YE¥4tYe “<4
e: Repeat sleps 3 Ansough S uni xzq.
wanexe ,
oid deo pixel (GLint cx, GLint cy)
Q\Colowat (o-s 10+S,0 9) +
alBegin (@- POINTS);
QWestex at (exe, cy) 7
Q\End
Void plotpiiceleCeiuint®, Giick ky Glrat y)
dou pixel (x +h, yrs
dsow preel Gath, yx),
tea — pixcel (exh , ~q4k);
dsow—pteel rth yyy;
Scanned with CamScanner- aeaw_-pice\ Cyr + sea 1
choos pielC-qrh > ccak) 7
cbsaww _ pricat ( yeh axa):
% saw pixal Cy+xh , Sn ye
Noid ctsde~ dso Celie xe) @Uok Ye,
5 GLint >)
Glink A= ls, =o, ay: :
wlrle(y >) : ,
pldipixels(acos ye jog 4);
Loo UCd20) dts 2H xyes.
else.
i a |
dy =25 Ge-y) 45;
% 7
ke:
plot pixels Ge ener y) .
5
ee
-
Scanned with CamScanner