0% found this document useful (0 votes)
76 views44 pages

Unit 3

This is the third unit of computer graphics

Uploaded by

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

Unit 3

This is the third unit of computer graphics

Uploaded by

Gayu Gayu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 44
UNIT yF: [eromeree OBJECTS AND TRANSFORMATION ~ 1)| = — ij Sgllabus » Scalars, pontse, and vectors ¥ Three dimensional petrnidives ¥ Cootdmate Systeme and Frames # Modeling 0. Colosed cube t Appine amen 4 Rotation, Transdaton, and oad ~ b dour, 4 Mirroum set % prrrutives prvm whith we Can cbtain (build) more sophisticated objecige are - 1 SCalars ols points three basie 3 Vectors elements. SCALARS, POINTS, AND VECTORS. Pepin tdeons.... + P_pont 6 a undamental ge0med rie ober. A pont 16 0 Jocadyon 1 space. Onl vty A ine i possess It Ioeation . It hat nether Shape nor 9 a : + Léolars. ane. quannnes Which have magnitude ‘They obs ‘operations oF ordinary arithmese tence addrtion, multiplication, sublraction , Avision , they obe assocrativity and commu tative vules. Scalaas olone have NO promelrie Properhes + P testa. allows us fy wore with crrectons. have beth magnitude and direchon, , qireted line segment it & VeChpr since it has both a eae Clengn) direction Corlentation ) y at “ AZ wy wry \" pee nveetor Ze 4 eo every Lx in vorse vectois Vechr can Cer oe ee mane Jun vedbe C a Stalar. but oppacn ” 4 ivthon) f abe (U8 head tp “7 tail anipm) ~ ge Some More ex: a _ Oe | tdentreal vecgoar Came mag & drveep) p ! porns - pornot Subtratdon pilas Z vep-§ = ee F < oF Pe VAR (4 16 equilolent tp point vechs addition, +4) Euchdean space is an extention Of 9 vethnr space that dds a measure op sye and distance and «ows us tv dejme Such things ne the lergfo gy atime £4 oF + Ap space 16 an extension of the woctre spore pat yneludes additional type 4 objet : the point operations mn Aline space - + Yeotpre Vector Addrhon ~ Scolar Veet>r Mult plicotwn ~ Pont-verpr addrtyon - Scolar: Scalar operations note! For any print, sip =p 0? = @ (xem veeps ) LA ~~ or + Sur of point and oO vecir — we (fubhrachon 4 two points) leads ty the notjon a a lime tn an apie space . a Pe) POehtxa es Lr that passes through fo 9 Po tae an te dieckion 4 re ie space —Appne sus p= Brov —C) dtesestbes al) the points prem on the line Jom § in the arrethen of Vi WRT - We RB The rth are o> Pe B+ a(k-§) TKR (GIB « o/P oF RF % B Where Arta, FI | Cpt us Called Ajpine Suan By poInIs Poa tag Aprme Sum Of polods Pry Pa were Py th - Pe ot) Pp PMP, FT Ry Py whee A, FO, - k, = |, 5O feha..n then rt If Called the + Det prrduct of y gy ts waitien ae uy 4 uveo, u andv are said Wy be LEsnogena) - the square 7 magnitade y o Wer i gen 4y the dot porduet . fon 2 uM cocine _ angle bw two vethrc IS Vee 4 . unify . _t_ ease 14) coc@ - lultose = vy i the a 4 the oifrmgeral Parjechon bf u dn v uot yugy ar puo vectors, then the theed Vechr Came tb both u fv Can be computed ag pk HM Called the Crass prrduck % “gy NEURV , Uy [emp] = tuxv} ace (a) ly} 7 planes a 4 plane rn an apine space cake defined us a direeg extension 4 the parametric line three ponhs that ave eruton the same line defornunes a unique ae , Suppose Pik are such points (mn an apne spon, Vine a fat Joins P and § 1s thé! cet of polats of the form - Stay = xp Hid R y pees) P 8 Suppose phat uc take an arbitrary print oy this he a) yorn Ps ‘point wR. and eer a fine se anna second peeee as « descorpe pasos Alor p, can Pp 7 fot Ine sé 7p) = pS +t pOR HIER DIMEN ONAL PRIMIT) ves + three features choracferipe 2) aijects that ; wef hrth evading grophies hlw & s/w described) 4 thar ace and Can be thoght y (. Dyects are at being hallow. Graphic locate a. objects can be spor red Popugh a set 4 yerHes 7 2D Ae Can use ipeline arthrfe chure fe pareess phese onde a elb primitives hy rode) 3D olyets 5 G 2 vertices at high ‘Yahes and creer mages y¥ ouject during rasteripation 2. Objects are oe eilber Compseel of or Can be ON aunts ,] flats convex Pelygens 7 MDINATE Syst Ems DMD FpAm Yin o 3D veetr Space , We Can FONTSent BY Wertyy Ww umguély in Terms of ang 3 linearly Independenp Vectore VI, Wo, Vz ae ~ Ya 4 wee wy tals Wr OVr 4 My + XV p The Sealars X es x, Ome Collet Componenss Wow Compor 4 Wet d vy the basis Vv, Va, vy We con Wrike the repiicentahon of we Went th bis basis as the column matix - a _ al Py os | y= Z,, z : | ve “| Since ychms pave =, | d Is 1s veh — and for bas 1 (a Rote ave cosrect Vs | 7D > pred locator) we (#1 as est wy vz frames 4 # Codd nak suctem js Not Supp cent te vopresent Posts. # b we WeTk nm an appine space, Wwe can add a vegte pt (the origin ) yb the basis vectpas ty por a from . A print p Com be dopresented 17 feomn of basis Vetors ag ~ Proto + py t BVa * Bs Ve fo ae i > vy Tre hb). fad ‘a te: 6 frome 1 deter mined wl fo, Wiva v3) ~ Within Phic pram, every worn tan be writen as ~ We arty ParVg FY RE, a ise point Can he woiten as pe Pot Bit Bava t Bes. ch ange of Lond nate 4 lomsider tat Tr swe ,v, JT and Lun, dy 4; ] ave five bases, Each basisy tn the Second set tan be vepresented in ferrns % the past baste veewy and Wee versa - Hence there exitig Y scalar Components ty} on - a = We = Vary + Vy Ve + Vi Ve ee Ae Ue = y ef Ne \ a ny Vy Yo V2 + Vas vy \oo-7” ap © Vey Ve * Yg Va Vis Ye a 7 yy fhe 2x2 mata YS FMS potation § Scaling + me | Me he Yee] d rete seal basic ca 7 Se J, %, Yes | fine @ Shalars ee [hr Yas Vy J fo Bevelon 5 A fu ] vr | = a j 4%} = MM | ve | i } f { b U3 Lay £ v3] Lo Translation 4 or us My a basic & the matrix M containg ‘the Jobormation tb go Jwm a doprsentahon of a Wehr IM One phasis ir Hs aepTetentatiin mm the second basis, the inverse x mM qe Phe matte deprecentation 4 the charge JOP XI Wa Ue WAY Ve F Consider the tether Ww thot has the meprecentah ord ofr jog, a | wert d M1, ¥o,V3 } te Wer %)¥) $% Vy HOY 5 ue Ve a 5 vr = aty where aster! & Ve |yo x3 ve Pecume that b is the % Prosentotron ¥ WWTE {Ur 4s, Yay 'e we Bay, Fh Hat Bey ou hen, expmssiog second bases im terms af jist basis w= bh y © 67. Mv = atTy acmtp. (47 = 6M ) Te matrix, Ts (m7) takes us from 4 heb, # rou the Almple matrix van - Examples Suppose We have a meadrit vector ‘Ww’ whose sepresentohin l:] along the basrs veebrs Vi, vo, ve z Thus, rs a Ro We Vi + avy + B¥2 suppose chat we mate a new basis jem the yoctyrs Vis Wo V3 Ups Ve Uae Vit Vy Ups vet Wt Vg Ren the matrix,M 78 of ; o | L t {to I | The abpve poatele To do the oppusite Te (m7) 7 converts the basis V1, Ya,Vs TP Ur, Ye Ne se mata is ~ (n the new yee fhe Sees of wien b= Ta foro ffi] [o 4 2 | = -) PPL sy ) mthe Homo genepus Coordinates + thmbgenenus Copadinater a vord potential Conf usson between a vethr and pont Yy using a oD mpwsentaror ‘ad both points and Vorpre In 3D 1. In the jrame specy ied (te BS hb) y any point P can be writen aniguely as - [fe ee a y note a |. alles a O-Pso0 [veer Lr | aca J thus, P is represented ty the Column reapsix ~ or Pela ae ! ple In the Same prone , any webs W tar be written ac: 51 ¢ 822 + S3¥p [er sr tame # == vy or w~[S1 S2 $s ojT | ve Vs Po Phys, W ors pe presented by the rofumn mayax ~ ' / we PE] [2 6 a and (rte, 4e Ba) are tu frames , then we can expwss the base veotic and eee prey second prome mn forms 4 the prs ace tee Yuvi + Wa va + Vis Ve te eer + ty et a vy Gs Psy) + dey Vo + Ver ve 80= Vy) Vi OY, va + Yaa %e +P th masrix jer - fer a a VW Va Vis , re Me lafe Mm] 2 i Va Vag Yaz = Y> by etn (een Ps ° Ya) Vpa Ys 1 M 1g Called the mmatria aepmelentahion 6) the Ne chan “y aa mes — a We con also use $1 to compute the changes phe wepresentatens cairechy . Suppoce a $b fe ef eae co ardinate wep retonta hors either of two points eae) tho Vectors tp the two pre Then - a al “4 VP 71 Bla | a ATM |v | 2 at] % ui Ye] = al) e *° Po | Pe Th — |. On Fe Byer Ay where MT los) dra ase Cay Ba) Cee ez Cry oo eT Assume -be too pam with basi vodbrs ean the jerewng Telations ~ Wey, 425 Vv, b¥e Wy > Vv, FV, # Ve the Chcmee prime des Dor Change. so - bo =f. Phe mateit m hommepencous forme tg = O° al ' Oo Ppp j t ' 000 1] Ms -/2- Suppise thot in acktetiin th changing “the pogis wore, ue aloo Want to mow the se crence Pint ty Hat Port that has the repretenteton (23,1) In the ee sys tea : then, Qo = MW FAV, HEVe HP, MeT!l o @ 2] Pre of | rao] © U 22 ia) T Sm lt “lL 0 9 : eo tty Oo °° 178 ooo} at Note that Hee pa poner (1,84) In the a Poppe [eae Thin the petat pi In the new [ame jg Prtoo 4) ! © oD Trt) [pte ° Oe es 3 ~ ° Oo Dy , ) Cy fhe emir ” New cyeltem , dfowowr, A voor (1,28) whch 16 repens] a=)! ) ; a In original cystem is 3 Prangjormed py tn the new Sytem , ~16- » f cube a Simple 2D object. We tant by Ascumrng thot the Werdrerg 7] the tube are avails bie righ an amey Of verere . For ¢x-~ tfloat — verte LeIZ27 XP -10, “10, ~). ob a PIPPI Y 7-0, ho,- Ry, Y-10, 1-0, 104 4-10, 71-0, Lob a MOS ONO, JO fe {re bo, voy y . oul COD Ube Heese aces as ~ lai C §t-Potyson 9 Vertex 4yv Crentes loz): [Vertex 34 y Cverhes 237); Mertens y Cventices Ted); qMoreagy C verte Ti 7); fers my the other ae Con be. SRT fhe ob theo Jive fates are ~ (23,79) 2 4,272) Or b0) G5 67) , (8h G4) fate s Pots fr Poy the a A vertex [ist dada stouchire con be used ty gepresent or cube as Shown — y= G Vortex Poyger Faces re poe), eae o ° 3 aS re [i rs Ag Vertex les iG _ | 21 te | ye presentation | Lip [ee | 5 a tube . | BP 2 ) fame as verbeoes Same at biJore Gyphat colors a vod quod Cint a, mtb, abe , mtd 9 v gl Bq (bt gunss ) ; IGolovy (eoloascay ) ; ql Merexyy a veorces Lay) fiGoler By Ceoloascsy y+ 7 Werke By Cveotceerby ): qloler Pv ( eefoustes )s gl Menten Yr C verprcece oq); JGlor'f» Coslerse a); Jt hy Cve vere raz): gléndeo; 2 Vord coloacube ¢ 5 ? quad C OF, 21% quad C $3,726); eee Gi 42): quod Cri, oo pd Case 2; Came Pn 8,4); + A Seans{ormatiun oa pingen thot takec a point @roctrr ) and maps Phat point int anddhey point (ov veetr) ime Can pleture such a fumctin by hoaning at #9 hofons oF 4 wing down the [urcioner jaa 8=7(P) for poinks ve Rid fer Vechrt 7 ronomin [ aN ¥ tf we use Homogeneous eovadinake then we Can aepasent both “vector and points as Yd Column / mate a ~ ge ple) ve y(4) ¥ Using homogeneous coordinates, a lear Prensformetion PransLorms — the re prsentation 4 a given pork sn another Wprcentaton a CO oF ¥ectms ) Ve GH where CME Se Adby fears). F Sa1d that we Pramstorma ten tee J 12 jae y jrcden Ge ae 4 Xu ig ] 12 values oF a | } tA pomt a6 ro pdten kd In oypine Space os Te] re | A wer ps represented of ~ ar tlenee 4 primk hoe 1h ce degrees 0) ° froedem ole We & D Where ag a Wotor hot wy y 2 ROTHTIDN, AND SCALING. —Leanslatien | t Banslation If an operation that displaces poinks b 4 ee clstance In’ a pre Aivect on Oger jig) Ca) Ob ject In higmes position = CAD Bhyech rane lated Te Peery a teanslaten , we need only tr epee a Auspla coment vechy d points are fm , because the Feansforrred ] Pepe 4] for al) prin te p90 the heed . Tonsladin has three deghess frecdem becouse ue can py Zé even ponents y Vsplacrenens vec hy naaae peing 2! = peor O49) ye pcessin (CO4 ¢) cabeedieg » we ie P ca $ coco ~ psn $510 8 S178 « = X00 ~ yl = pesed.sine + peind cos 5 HOF YOO tones x plop 7? LSrp - (i) ly] > (oe Z ty Retertion abut a frxect port + note. Rotation 4 Taanslaten are Hoowm as Tie, 2 “trans, by. ong.Since 7? combinahen + awiations & dranslahms can alter the shape or Voluene ¥ an awed. at aA /y 5 nen riged body a >= Va Taonsormanan , Sahn C08 4 deg pees | forodemdy + kaling 12. an Affine Den rgd Poly Transpo retin ty whieh wh Can make ao object big gee os Samaller. ¥ Fig shows both unipbim 5 Den ungorm sealng, 1 ot fearing have apiked prot = + B speigy scaling , We. Shoal | 7 Prcipy the Yrred porny , _, AMC Hm we With tp scale , ——* ; $ 4 Stale facts («J . ° Geo) =) eaects oe Ug ger yh. <1) thpece oy tg Unt form & ~ Value py EE fc tinferrs scaling, OS Gees on y te “H9D UN METRIC OBJECTS AND TRANSFORMATIONS ~ 2 sytlobus Ty anstormertyont in homogeneous Co ordinates a Concatenation 4 Transformations + open ge Trargformation rnatriees 4 [nterpaces to three drmensromal applreatiins . ¥ Quatermions iw Hong Eneout ¢ 0 oR b/nATEs| [eA NSFORMATION oy Within a frame, each afpine Tranbyporration is represented by a EXG matrix the em Xi 1p hae Ory ae] 21 Oe, _ %3) oF u 32 Oly we, sO ob 6 i # tore wo escuss & types 4 ayine eae eases - - frantlation ~ Rotation - Sealing - Shear, ¥ Translation chs places points to meu posthons aepyned 4y Aecplocement vector. ¥ Up we move the pant p 1 pi by duplaving ty a ditonee d, thon [eee +4] ¥ Homogeneous coordinate forms of PP Ls tare [x x! Ox / [! eee y’ ds ty a 2 oe Lid ' ° ot hece equations tan pe written component by component as- -2 ¥ Homever, we can alto gr Hhit Pesuult Usdin the MART mult ipl Conon - ' pls Tp hete = t ee T it Called dv0nslotien matrix Ce “y We Sometimes wirihe th OK © 0 1 w, 7 Cr itly, Ge) Cc oO o t we can obtun the wnverce oo transiatiem matrix a follows - - 7 ° oO why . (oF 1 "Centy te) = TCat ty nde) 2 0 OM , O Of wey ee | Ps ¥ For both sealing and votalion, there Ua fined pane that ss unchanged by fhe Hronsformat en . One let the pod point to be odigin here). a A scahn Atrix with a fel port of the 091910 allows jer independent Caling (increase or decrease Size Ga primitive) alorg the Coordinate axes #2 three equations Aas ate Pk if fel 2! eB, Z + ese mree egns Can be combined in Pornogencous aes abe Pie Sp where 5 =S(fx by Be) fe . 2 2 - ee eee ¥ We tan obtam the myorse af ttohng matrix by oppy 9 t Here ne fake the pieced point as orygin 4+ Lotatrn enables the Progtammer ty rotate leg point wnt the thoee deghece of [recdorn | about the # Suppose we Dotate a paime PCO 4,2) Wee 2 avis fo get the new pomrk pg ey Then the equatron per rotation about 2 axts _ an argke 8 Is given by — l= x cose -y sine _ x one ofeue eee or, 19 matrix form ~ where [cose “sine ° oO Ry = Re) =] sine cose oO ° ° e nr) [ 3} 8 } t I ml, egn or Potato Wl, eqn fer Votahen of, Qhouk X&~anig ie yar oon eur ! eo ° j cose o Sine om hx= Re (OV=| p cose -smo Oo Ry By Orr ° 10 ° a -s/n0 Shear € Consider a cube Centered ar origin 2 aligned WIth Ihe axe and viewed fram t¥e zaxic Cryer pig) Ye we pull the top of the object (tube) Yo the vght and we ay that we Shear the object m bottom to the (at , the % -chrection. hater Neher gy mor x value are changed by the shear 1 Sx be: Shear, Lee +h, each + using simple Trigonometry on below Jig , we af ea. Shear 1 Charatherised by a Single angle 0. the equahens yer this SHEA? are 7 4p Gyo — Xe e+ y COE 1 ¢ = 1 - Ze yey > ' x wee » leading to shearing matrix Ie: compos ton 7 Arred ede 1 cote 0 0 4 Une) ee 0 0 Oo f Lo aoy FWwe can obtain inverse by Shearing in opppsife direchon [CONCATENATION oF TRBNSFORMATIONS| —aae ee peglience of # OM U Nothing but multrpleation yf baste Hongo s trong in order to puduce ae Pontformation, fOb et!) we canny out three conseguttive cu leessive Hrancjorme tak 6n a pint p, ee a new pone 9 | then, [42 ee Ap] PB EC can be arhitrayy - AXY Mmaprpees , ardev ic ymportont. Here ne carry our A, followed by & and followed ye ? * [ge CCE IID} [PJ [FJ [1 wy tHe, ne qervlop matrlons {7 . a - Rotation ghout 0 fleet point _ General Fetatun. ~ Instance Traniotmatien . ~ Rotation about an Ar bitraty axle 4 Gnsider a cube with wh center at P and is Sider align ed with arts, # Assume thak the Cube 1S to be Trtated about pax (as shown) Potalton o coe ohout He center, about ms Center Py + TF Can be done ge yovews a Step! Move the cube to the origin by oppy iy beaste fransformayion of translate Py) athepn: Rotate wert (or whour) 2 arte "y derived 099% 8 by appiying Fx (8) Steps. More the Bhyect botk Auch that ike center fs again at Py 4 apyiny Remeee translation as TOR) ¢ Coneaten ating he above franspoamations, we jr [re yy RO THI] vi we rruityig ouk the magtticet, be pra thar COL -SimB 9 Kpr Ap los + prime me] fine Ceo 9 yyy Xpeore - yy cing o ° J ° oO ° Oo , # We now show that arbitrary rotation about the engin can be composed Gia auccesstye votahons about the three axis, # we can bbtain the qesired mateix 8 pins ey) a Yotation about X-CUS and then About i Mut And then about 2~ dale, However, the order y muttipltation cloer nek matter. Thavigore , the [ere sotation mate M would be — M = (00 * By fp) 7 &(P)| - ay felecting appropriate values o a, p, and ¥, We Can achieve. ary desired eTtentaten . hi [igh retetn ebour > Lj x Be arig. a LAs 4 ¥ hp: Rodatun abou po ovis q os beg: Potation abour =7 2 | ae anny “ t a= | lx consider a 4 eee compared | 4 many simple check cx Shown , a Ee scene dX oO a simple ohects . : go @ L0* Zr | + there ave two ways to create tho above Scene Vea 1b Dipine each of these objects. through Us vertex, Using 4! a fin alternative 6 40 define €0¢h Of the object tapes ante at a Conve nent flee, place LS orlentahion, : Fath occurence O) an object In the slene th Qn Insta that owects pirtetype, and we Cao sh tain the desire sire , me ortentahon , and location by on'ying ypire ee called Instance Transpormedion. fo the Prrvelype 6 +t Instance PransJorm ation Lt applred } 2 d In the order chown in the ip 6s O- ¥ In case of Instance Hrantzormatun, meres Hr first wey abe Staled Wy the clesired size, Then they azo [ips instance Crant}/or mate onented suitably uling 1Ptakon matelx and then th js yronslated ty the desired locahon, objects are origina ty ayined m 4} ypeiy Own frames t ol tr bh herr $ 2 we a + Therefore, instance Transporation matrix t¢ | tee jom- [aaron esl Rotation about _an Dubibrary # Consider a pont p, at the center x the ube a te vector about which the cube (8 to be wtated 4an be tpecyied 7 providing the pomes fr and f» The vector olegied by fr and f isu, (aaa + 0t Wotate the cube about the vector u Wy an angh 6, he Sheps to be Peyormed arc a follans - Step ls fanslate the Jirect print Pe tothe origin by performing Teh) Rotate the cube About the X As le 4 Heporrieg Ry (+8) steps fotate vhe cube about the you by peprrrieg a oy) eps fotote the cube apeuh the g-aa"s by angle © (enown)d perperrrng (On) trp Parporen averse —evinden about matic je Roly) Hep hs Feorm rence Yintien about y ane ie Ry(- Oy) ep 6 o Pajom inverse tation abou £ adit fe Py (4x) ep de a Mverse Translate of the fired pont fr aoa T(h), ¥ therefore , the contalnated matrix js n= TO) ME 8) -m)) tf) fy(op) Reco TER) | en Four pirst and fost ae eee fe the pranslation TEP) and TC Pod. tn between we perforr relation , Re ky COn) Ry by) RelO) ky (by ) Ra Ge) , ne sequence 4 votatrons Mo shown below , + we replace “ui with a Unik length verter we Lf oe pa © Is os we have : a ce since Vis aunty lengin ved + we draw o@ line segment [rom origin to (ax ,%y, 2) Bis line seg, had unit length & the ddlentatran 4 ve Next we draw perpendteutars prim the Point (ex, cy, a) to the lo otdinate axes 48 Shown . fre three dttection angles Px, By, pr are the angler blw the sine °q Cor va and the Anes. _ arty te) the dtrechon cisine are given y cor g, = Oy Cos py e “y Cord = Oy only two va tre directyan angles ase (no epen denne becauee , yur now Cale Ox 4 oy wsirg thece anghs € Hon 4. e ¢ Consider the t shown, Uf we FB asteme (00k at the vs pryection of the Ine 10g (before votahen) . ! 7 on the plane HO, we will tee a tine rg of _ d On thit plane , Ge tne that we £86 on the was) yp Yotaiton , the shadow of we a: [rom origin he Carry te) Note thot length Gf shadow tr lees than lerg in y fine 9. we can tay tbat the fine ceg has been Joreshortened Yo d= Very tag we FPP Mevar Mead to compute By. rather 6 we need to compute ently — jt oo O © Ax (Bx) =] 6», 2/d -¥y!d 0 2 AY/4 Xe/d oo°6 . tation 4 vote Hen. ¥ UF ps similar to the whove [s 0 ke 0 wy \./ o ! @ WOT a 4g [oo 3 ! = 13. OPEN €L + Hove we t2e the tropleméntatiin of an hemogenevys ~Gaordinafe Hansormatien patkage and oy that patraget tnderpace to the user, y we use giMatrinMods th select phe rratzix to which dhe opevarions apply . in openge. » the 70 Frandsf ormatien matrix and has ny (2 degrees y fredin | del-viees matrix oy tan apie Curyent Bantainaua) roatain, BE ites the matein that is a plied to ay vertex that fe defined Subsequent to rts et ym a part 4 the pipletine . thus, tf Pp 1s a vertex specwied tn the application | ten the piptline prduces Cp. veneer JOT r “4 ew a i TM a i Heer ee! Y CTO uh an XY matere , mitaltly gb to ident matrin. tf Can be FOMMHalied a6 Needed Ukin, "eh! q mee Se ; Fue denok CTM by ¢ . EFM Can be altered by a sed o functions Previded 4 Praph ies Patkage i 7 fhe punerons that alter © are % two forme t, hoce that toad tt with some mafaix a, ose that modryy i 4 Prem uldiph cation or past multypltcad on "y a matizx, open uses ony jeu multiplication , 4 fhe three Prantyetmatine supported in moth systems Are - Ranslahon - Sealing with jovea potrr ¥ the engin 4 fymbolicay, 4 wt Can Witte Prete operarions in pest multylicatten form at ~ ceerT cecs caer and in toad form as - Cer c We can load a matrix With the Junesien qitead Matrix (Potater. toe madre) } > or Cet A matrix fo the tdentty mabe os — qitoodtdenn O: i > We con alter the selected Mabix with Pi MuteMa eri C Pinter to-materx) : > Rotatin, Wantlaben , and tealirg are pryvededt thou" theve ponents gleotatey Cangle , V1, Vy, ve); gl arslateg (Ax, dy dy)» ji Sater (sx pte) sy rise Rotatzom abour a fined peimt in open gt. + For a Ys? rotation about the line ee the Prigin and the point (18,2) With @ Jira 4 4r5e) Li Pave IMattixMode C Gt Maonslyis Ww) S JLoad dent gp Cansiaty C40, 5.0, 60); p Rotates C4HSO, 160 80, PO); gl Translate C740, 0,80): orders oy [rans 2 1 Tetouan Rule in opens 1s this! trey" "transyormaen peeyred Last tt the tne applied f! w me sequence of operations we cpecired aboye was C3go0) thttalaxn] ~= 2605 2 GlatPostRe des play (I5 re i ny chor ey 1» Ont MOLE , wnt mousey ) 5 votd mmyhg C ¢ plegee 9 N beg ss'' J exh Oo! y Seading L FLD. Meatziees . 4 Sometimes tf the prgrammer wants te pew orm 4@ uth certain fransjormatin and then Mhurn by the some Stale as bepore, then be Con puth the rar go7m ah oy, matin on to Stack with glfushMatrx Ly byjive mulyplionen 4 yocover tp later with g! Pop Mataix OO ~17- € 4 gifusnmatris oo: 7! Ganciatey ¢ oF 7 Porareg a jitotey - 2); A draw ehfette here a/ yi repm ax); We ton Ibad « YXY homegenesus co ordinak Paty sy as Phe Chovent matrix as 2 gl bead Mataray Cogartay): a. We can also multiply on the 04 br ef UWarent mabri y a user dined matin ar ~ gimulsinadaiag Comp array) ; iS) _ for eee, myarryy - Gyloar mlyIlyy : aegloar my rrray LET » [ot (F703 152; ips) [nt roi de 22 Jeng ee | = mcistja; INTSRFALSS To THREE DIMENSIONAL APPLICATIONS ¥ Glut provides (° Smoother and more CUTE) (nteyores fo 2b applications by allowing the user te use aay board along with mouse 40 prvide sateraction | + Suppose that the wser Wants th use one mouse button per oreenteng an object , one pr peng closes fe or [artner ir pe objet , and one Jor franslating Hhe object Ee qt or hight . y tue Can use the motron — the call back activated and where the mouse can be used to rotation, translation, and to move cal back te athteve all these returns whith button has hen pre mouse is located, This locatren x contro) the direction o i in oF move out, A_vistual fratk Bolt ¢ P virtual Mack bat) Can be treated using a mouste and the display device ( ¢gimanitor ) y Ady 4 virtual detce th creates a Jutthoniess track bel) wheeh’ once started to rotate will tmtnue to motte om unt stopped by the uler, Thus it supports continuous ootarrons 4 ob] ects but wey SHI adja we changes tn the speed and prientation uf the dota Hin, YW Can be achieved by mapping We posriton o we rooese frackball to that oH a mese, + cunsider the Hxack bal) af shown, p 4 We assume that the Hack bay ae has @ Fadiys of I Unit. we cap mop a piven on hs Savate to the plone geo an oringenel Pryection aS Bhewy helo) Wd hy doing hip! Treee ban [tame wig 4 The position Gye) Oh the surface oj the bait tt mapped fo (4, 0,2) on the plane . & the motion 2} the drach ball that moves [rm one Pont pr 70 AMother point fr Can be Computed be Computing the _ Bo wrt pr and pa Ae pepe VA [Ree In} | we a tracking the rouse at i h rate, then changes 17 paitien that we ae wilt be small, Hence rather than using Inverse drgametrre June. te Jind © B, He Ule the approximation sng 4 O # GLUT ako provides jer skepett % Suppose that We are rren twp Ben tanee y the comera and We want tr meve _— 7 one atlentatin to another, then the ieee ace code wi) be ~ pers | e plRotoke Cdetta.thete , dr, ape AD): | | Prom objet 0); | peo | prblem. code Caleulatrp of Irtalitr rates requires evaluation y siaet ard tesines of t7E0 angks. felon ax pitt) 1 4 Soete—e t Lo, 40 overcome this, we compute the Fotation matrix onee and reuse IF thovigh Code such ag the [ollowing = Suylonr me D5 gihoteky C4x, dy, Az, deltnthete J ; gl het leary C gle mePEUeisv MATRIX, mds I" (10; Pemax} Foe) | glmarematriag Cm): | i alrqweobjech CLs | 4 | “we could oles use zmedl angk apprer)mebens “ng3@ yO rs very small , cose &F f 7 Do aYbitrasy axs Totation matria with an angle Y obey pours p atong aru, and @ alang x anit Car be achieved ae S Re RP) Fy (J) Rx 8) {COSY Simp oo cup 6 fing ° oo ° snp COsP oo 4 #/ 0 / 0 © #} Oo C1se Sind 0 2 oO too “sing 6 cosd e Orme Cosp 2 0 oO vy 6 6 ® ‘I ° 6 ay [er fray angles y pop, and 6, ne gt oe QUATSENTONS on + Suaternions are 4 extension ] comp lex numbers that provide an alternative method [er eee and a dototions . +t there are two methods g fevferming Tototons pose nuit yplreatrin 4 OTM with Totalran rvasrin ~ perperring To tat ons using quater nians. vantag using cecend rnedhoed Ws that it Tequines wy tr FHe computal ons hae tations when Compared tp rotation matrices , + Specitying stat 3D spate ywe mvolve th specyging the derection 4 Tota tion which +s a vecfore quantity . specipying The amount of StaHon which ia scalar (eee) a Since & quaternion hat both scalay and vochor repretentante it Can bo uced tp speyy rehaton yey. V4 ge P mm space car be represented m the quakernion representation as > (0,P) cosider a quaternion jn the polar [om - re (cos 2 cm & rv) ‘Vhas unit Merath mverge quaternicn is a ars a ap ow pont 7? after rptation can be obtamed ting the _ pivduct ple spre! ¥ this veewr/tant quarter nien hog the for O,P') Where ' = cost p in? i Lp e sin [email protected]¥ F510 8 cos 0 (vx) ~ @ sm bly B(mp)ey + Phove Tetulp vepresented by iD IS the pecs Mtation a point e hy 6 Ca about the vector v & I we cepa Court the number gy operations re guired to perform pit task sing mater rruitgh cation wont the number o operations Feguirer using quaternions , it can be reolsed that uti quaternions pe sults mm joer Com pata tons

You might also like