+ All Categories
Home > Documents > gip 1,2,3,4,5 units

gip 1,2,3,4,5 units

Date post: 04-Jun-2018
Category:
Upload: ko-vartthan
View: 234 times
Download: 0 times
Share this document with a friend

of 100

Transcript
  • 8/13/2019 gip 1,2,3,4,5 units

    1/100

    UNIT I

    INTRODUCTION TO GRAPHICS

    DEFINITION

    Graphics are visual presentations on some surface such as wall, canvas,

    computer screen or paper.

    Eg: Photographs, rawings, line art, graphs, iagrams, s!m"ols, maps, geometric esigns

    # engineering rawings.

    Graphics can "e functional, artistic, realistic or imaginar!.

    $I%TO&'

    The earliest graphics (nown to anthropologists stu!ing of prehistoric perios are cave

    painting # mar(ings on "oulers, "one, antlers uring the upper Paleolithic perio from

    )*,***+*,*** -.

    &ecors from Eg!pt preate graphics # Pap!rus was use "! the Eg!ptians as a materialfor planning the "uiling of P!ramis.

    Gree(s pla!e a ma/or role in geometr!. Gree(s use graphics to represent mathematical

    memories.

    Eg: ircle Theorem, P!thagorean Theorem.

    In 01*, one first computer 2 riven ispla! was attache to 3IT4s 5hirlwin I

    computer generate simple pictures.

    In 067, Ivan %utherlan invente %(etch pa , an innovative program that influence

    alternative forms of interaction with computers.

    In the mi 06*4s large computer graphics research pro/ects were "egun at 3IT, General

    3otors, -ell 8a"s # 8oc(hee 9ircraft.

  • 8/13/2019 gip 1,2,3,4,5 units

    2/100

    In 06, &a! Tracing was invente "! 9ppel.

    During the late 0;*4s personal computers were capa"le of rawing "asic # compleGraphical =ser

    Interface?.

    @D graphics "ecame more popular in the 00*4s in Gaming, 3ultimeia an 9nimation.

    i? Graphics is one of the fire (e! elements of 3ultimeia Technolog!.

    ii? Aua(e 2 one of the first full! @D game.

    iii? 001, the first full! animate film B TO' %TO&' B was release in inemas

    worlwie.

    =%E% OF G&9P$I%

    Graphics are often use to point reaers an viewers to particular information.

    The practical areas where graphics are applie are given "elow :

    i? -usiness

    ii? 9vertising

    iii? Political News

    iv? Eucation

    v? Film # 9nimation

    vi? Graphics Eucation

    PICE8

    DEFINITION :

    9 pior?

    9 pior? information element is not reall! a ot, nor a suare.

    Piots per inch? >or? ppi >pi

  • 8/13/2019 gip 1,2,3,4,5 units

    3/100

    $I%TO&'

    The term Pi

  • 8/13/2019 gip 1,2,3,4,5 units

    4/100

    Eg: 716 colours 7, "pp

    76 611@6 colours 6 "pp > highcolour or thousans?

    77) 6,;;;,76 colours 7) "pp > truecolour or millions ?

    7) ) "pp > for all practical purposes # in flat"e scanners ?

    716 colours

    %tore in the computers vieo memor!.

    E

  • 8/13/2019 gip 1,2,3,4,5 units

    5/100

  • 8/13/2019 gip 1,2,3,4,5 units

    6/100

    The phosphor then emit a small spot of light at each position contacte "! the electron

    "eam.

    -ecause the light emitte "! the phosphor faes ver! rapil! some metho is neee for

    maintaining the screen picture.

    One wa! is to reraw the picture repeatel! "! uic(l! irecting the electron "eam "ac(

    over the same points.

    This t!pe of ispla! is calle a refresh &T.

    5O&LING

    The primar! component of an electron gun are heate metal cathoe an a control gri.

    $eat is supplie to the cathoe "! irecting a current through a coil of wire calle the

    filament insie the c!linrical cathoe structure.

    This causes electrons to "e "oile off

    In the vaccum insie the &T envelope the free negativel! charge electrons are then

    accelerate towar the phosphor coating "! a high positive voltage.

    The accelerating voltage can "e generate with a Mvel! charge metal coating on the

    insie of the &T near the phosphor screen.

    E8ET&O%T9TI DEF8ETION

  • 8/13/2019 gip 1,2,3,4,5 units

    7/100

    Deflection of the electron "eam can "e controlle either with electric fiels or with

    magnetic fiels.

    athoe ra! tu"es constructe with magnetic eflection coils mounte on the outsie of

    the &T envelope.

    Two pairs of coils are use.

    One pair is mounte on the top # "ottom of the nec(.

    Other pair is mounte on the opposite sies of the nec(.

    The magnetic fiels prouce "! each pair is of coils results in transverse eflection force

    that is perpenicular "oth to the irection of the magnetic fiel # to the irection of travel

    of the electron "eam.

    &9%TE& %9N D%IP89'%

    The most common t!pe of graphics monitor emplo!ing a &T is the &aster scan ispla!.

    5O&LING P&INIP8E

    In a raster scan s!stem the electron "eam is swept across the screen one row at a time

    from top to "ottom.

    5hen the electron "eam moves across each row the "eam intensit! is turne on an off

    to create a pattern of illuminate spots.

    Picture efinition is store in memor! area calle &efresh "uffer >or? Frame "uffer.

  • 8/13/2019 gip 1,2,3,4,5 units

    8/100

    The frame "uffer hols the set of intensit! values for all the screen points.

    The store intensit! values are then retrieve from the refresh "uffer an painte on the

    screen one row at a time.

    One row is also referre to as %can 8ine.

    Each screen point is referre to as Pior? Pel.

    -IT PE& PICE8

    Intensit! range for pior? off.

    Onl! one "it per pi

  • 8/13/2019 gip 1,2,3,4,5 units

    9/100

    &EF&E%$ING

    &efreshing of &aster scan ispla!s is carrie out as the rate of 6* to * frames per secon.

    &efresh rates are escri"e in units of c!cles per secon or $ert.

    c!cle 2 frame

    9t the en of each scan line the electron "eam returns to the left sie of the screen to

    "egin ispla!ing the ne

  • 8/13/2019 gip 1,2,3,4,5 units

    10/100

    9 refresh "uffer is use to store picture efinition. The line rawing commans are store

    in the refresh "uffer.

    To ispla! a specifie picture the s!stem processes the set of rawing commans.

    &anom scan ispla!s are esigne to raw all the components lines of a picture @* to 6*

    times each secon.

    &anom scan s!stem are esigne for line rawing applications an cannot ispla!

    realistic shae scenes.

    &anom scan ispla!s prouce smooth line rawings "ecause the &T "eam irectl!

    follows the line path.

    O8O& &T 3ONITO&%

    9 &T monitor ispla!s color pictures "! using a com"ination of phosphors that emit

    ifferent colore light.

    Two "asic techniues are use for proucing color ispla! with a &T namel!

    i? -eam penetration metho.

    ii? %haow mas( metho.

    -E93 PENET&9TION 3ET$OD

    This metho is use with ranom scan monitors .

    $ere two la!ers of phosphor namel! re # green are coate onto the insie of the &T

    screen.

    The ispla!e color epens on how far the electron "eam penetrates into the phosphor

    la!ers.

    9 slow "eam of electrons penetrates through the screen # ecom"inations of re an green lights?

  • 8/13/2019 gip 1,2,3,4,5 units

    11/100

    The spee of the electrons # hence the screen color at an! point is

    controlle "! the "eam acceleration voltage.

    %$9DO5 39%L 3ET$OD%

    This metho is commonl! use in &aster scan s!stems.

    9 shaow mas( &T has three phosphor color ots at each pi

  • 8/13/2019 gip 1,2,3,4,5 units

    12/100

    9nother configuration for the electron guns is an in+line arrangement where the @

    electron "eams are aligne to a single scan line.

    -! var!ing the intensit! of levels of the three electron "eams various color variations are

    o"taine.

    The color got epens on the amount of re, green an "lue phosphors.

    9 white area inicates that all the three electron "eams are with the same

    intensit!.

    O8O& O3-IN9TION%

    'ellow 2 green # re "eams

    3agenta + "lue # re "eams

    !an 2 "lue # green "eams

    3ore sophisticate s!stems can set intermeiate intensit! levels for the electron "eams.

    DI&ET KIE5 %TO&9GE T=-E%

    9n alternative metho for maintaining a screen image is to store the picture information

    insie the &T instea of refreshing the screen.

    Two electron gns are use in DK%T

    DK%T stores the picture information as a change istri"ution /ust "ehin the phosphor

    coate screen.

    The primar! electron gun stores the picture pattern.

    The floo gun maintains the picture ispla!.

    9DK9NT9GE%

    i? No refreshing is neee.

    ii? Ker! comple< pictures can "e ispla!e at ver! high resolutions without

    flic(er.

  • 8/13/2019 gip 1,2,3,4,5 units

    13/100

    DI%9DK9NT9GE%

    i? %electe parts of a picture cannot "e erase.

    ii? The! orinaril! o not ispla! color.

    F89T P9NE8 DI%P89'

    INT&OD=TION

    The term refers to a class of vieo evices that have reuce volume, weight # power

    reuirements.

    9 significant feature of that panel ispla!s is that the! are thinner than &T4s.

    Flat panel ispla!s are availa"le as poc(et notepas.

    =ses of flat panel ispla!s are

    TK monitors

    alculators

    Poc(et vieo games

    8aptop computers

    9rmrest viewing of movies on airplanes.

    9vertisement "oar in elevators

    9TEGO&IE%

    There are two ma/or categories of flat panel ispla!s

    i? Emissive ispla!s

    ii? Non emissive ispla!s

  • 8/13/2019 gip 1,2,3,4,5 units

    14/100

    i? Emissive ispla!s

    onvert electrical energ! into light.

    E

  • 8/13/2019 gip 1,2,3,4,5 units

    15/100

    5hen a high voltage is applie to a pair of crossing electroes the phosphor "ecomes a

    conuctor in the area of intersection of the electroes.

    The manganese atoms a"sor" the electrical energ! as a spot of light.

    Electroluminescent ispla!s reuire more power than plasma panels.

    Goo color # gra! scale ispla!s are har to achieve.

    8IG$T E3ITTING DIODE > 8ED ?

    9 matri< of ioes is arrange to form the pi

  • 8/13/2019 gip 1,2,3,4,5 units

    16/100

    Polarie light passing through the material is twiste so that it will pass through the

    opposite polarier.

    The light is then reflecte "ac( to the viewer.

    This t!pe of flat panel evice is referre to as a passive matri< 8D.

    9nother metho for constructing 8D4s is to place te transistor at each pi

  • 8/13/2019 gip 1,2,3,4,5 units

    17/100

    The two views of a scene are generate from a viewing irection corresponing to each

    e!e > left # right ?.

    %imultaneous viewing of each view merges into a single image.

    The screen is viewe with glasses > speciall! esigne ?

    %tereoscopic viewing is also a component in virtual+realit! s!stems where users can step

    into a scene # interact with the environment.

    9 heaset containing an optical s!stem to generate the stereoscopic views is commonl!

    use in con/unction with interactive ip evices to locate # manipulate o"/ects in the

    scene.

    9 sensing s!stem in the heaset (eeps trac( of the viewers position so that the front #

    "ac( of o"/ects can "e seen as the viewer wal(s through.

    INP=T DEKIE%

    Karious evices are availa"le for ata input on graphics wor(stations.

    3ost s!stems have a (e!"oar # one or more aitional evices speciall! esigne for

    interactive input.

    The various input evices that are iscusse in this section are

    i? (e!"oars

    ii? mouse

    iii? trac("all # space"all

    iv? /o!stic(s

    v? ata glove

    vi? igitiers

    vii? image scanners

    viii? touch panels

    i

  • 8/13/2019 gip 1,2,3,4,5 units

    18/100

    The (e!"oar is an efficient evice for inputting such nongraphic ata as picture la"els

    associate with a graphic ispla!.

    9lphanumeric (e!"oar

    Le!"oars are provie with features to facilitate entr! of screen co+orinates , menu

    selections or graphics functions.

    The common features on general purpose (e!"oars are

    i? cursor+control (e!s

    ii? function (e!s

    i? cursor control (e!s:

    can "e use to select ispla!e o"/ects or co+orinate

    positions "! positioning the screen cursor.

    ii? functional (e!s:

    allow users to enter freuentl! use operations in a single

    (e!stro(e. 9itionall! a numeric (e!pa is often inclue

    on the (e!"oar for fast entr! of numeric ata.

    3O=%E

    9 mouse is a small han hel evice use to position the screen cursor.5heels or rollers on the "ottom of the mouse can "e use to recor the amount #

    irection of movement.

    9nother metho for etecting mouse movements is with an optical sensor.

    One,two or three "uttons are usuall! inclue on the top of the mouse for signaling the

    e

  • 8/13/2019 gip 1,2,3,4,5 units

    19/100

    5ith the +mouse , one can pic( up an o"/ect , rotate it an move it in an! irection or the

    navigation of one4s viewing position # orination through a @D scene.

    9pplication of +mouse are

    virtual realit!

    9D

    9nimation

    T&9L-988 9ND %P9E-988

    T&9L-988

    Trac("all is a "all that can "e rotate with thr fingers or palm of the han to prouce

    screen cursor movements.

    Potentiometers attache to the "all measure the amount # irection of rotation.

    The! are often mounte on (e!"oar or +mouse.

    %P9E-988

    9 space"all provies sie egrees of freeom.

    9 space"all oes not actuall! move. %train gauges measure the amount of pressure

    applie to the space"all.

    9pplications where space"alls are use are

    i? @D positioning

    ii? Kirtual realit! s!stems

    iii? 3oeling

    iv? 9nimationv? 9D

    O'%TIL%

  • 8/13/2019 gip 1,2,3,4,5 units

    20/100

    9 /o!stic( consists of a small vertical lever calle the stic(

    The stic( is mounte on a "ase which steers the screen aroun.

    There are 7 t!pes of /o!stic(

    i? mova"le stic( /o!stic(

    ii? non+mova"le stic( /o!stic(

    3OK9-8E %TIL O'%TIL

    The stic( is actuall! place in the center position.

    %creen cursor movement is achieve "! moving the stic( in an! irection from the center.

    Potentiometers also mounte at the "ase of the /o!stic( # the! measure the amount of

    movement.

    Potentiometers also return the stic( to the center position when release.

    In another t!pe of mova"le /o!stic( the stic( is use to activate switches that cause the

    screen cursor to move at a constant rate in the selecte irection.

    NON 3OK9-8E %TIL O'%TI(

    These /o!stic(s are also calle isometric /o!stic(s.

    The! have a non mova"le stic( # pressure applie on the /o!stic( is measure "! strain

    gauges # converte to the movement of the cursor in the specifie irection.

    D9T9 G8OKE

    Data glove can "e use to grasp a virtual o"/ect

    The glove has a series of sensors that etect han # finger movements.

    Electromagnetic coupling "etween transmitting antennas # receiving antennas is use ot

    provie information a"out the position # orientation of the screen.

    Input from the glove can "e use to position or manipulate o"/ects in a virtual scene.

    9 7D pro/ection of the scene can "e viewe using vieo monitor.

  • 8/13/2019 gip 1,2,3,4,5 units

    21/100

    9 @D pro/ection can "e viewe with a heaset.

    DIGITIE&%

    9 igitier is a common evice for rawing , painting or interactivel! selecting co+

    orinating positions on an o"/ect.

    Digitiers are use to input co+orinate values in either a 7D or @D space.

    9 igitier is use to scan over a rawing or o"/ect # to input a set of iscrete co+

    orinate positions.

    Graphics ta"let is an e

  • 8/13/2019 gip 1,2,3,4,5 units

    22/100

    OPTI98 TO=$ P9NE8%

    These panels emplo! a line of infrare light emitting ioes > 8ED4s? along one vertical

    ege # along one horiontal ege of the frame.

    The opposite vertical ege # horiontal ege contain light etectors.

    5hen the panel is touche these light etectors recor which "eams are interrupte.

    The 7 crose "eams that are interrupte ientif! the horiontal # vertical co+ornates of

    the screen position selecte.

    Positions can "e selecte with an accurac! of a"out Q inch.

    The 8ED4s operate at infrare freuencies so that the light is not visi"le to a user.

    E8ET&I98 TO=$ P9NE8

    These plates are constructe with 7 transparent plates separate "! a small istance.

    One plate is coate with a conucting material # the other with resistive material.

    Touching the outer plate forces it into contact with the inner plate.

    This contact creates a voltage rop across the resistive plate that is converte into co+

    orinate values of the selecte screen position.

    9O=%TI98 TO=$ P9NE8

    $ere high freuenc! soun waves are generate "! the horiontal # vertical irections

    across a glass plate.

    Touching the screen causes part of each wave to "e reflecte from the fingers to the

    emitters.

    The screen position is calculate from a measurement of the time interval "etween the

    transmission of each wave # its reflection to the emitter.

    8IG$T PEN

  • 8/13/2019 gip 1,2,3,4,5 units

    23/100

    8ight pens are pencil+shape evices use to select screen positions "! etecting the light

    coming fro points on the &T screen.

    8ight pens are sensitive to short "urst of light emitte from the phosphor coating of the

    &T.

    Other light sources are not usuall! etecte "! a light pen.

    9n activate light pen pointe at a spot on the screen as the electron "eam lights up that

    spot generates an electric pulse that causes the co+orinate position of the electron "eam

    to "e recore.

    The recore light pen co+orinates can "e use to position an o"/ect or to select a

    processing option.

    DI%9DK9NT9GE%

    i? %creen image o"scure "! han # light pen

    ii? Prolonge use causes arm fatigue

    iii? 8ight pen reuire special implementation for some applications.

    iv? %ometimes light pens give false reaings ue to "ac(groun lighting in room.

    KOIE %'%TE3%

    %peech recogniers are use in some graphics wor(stations as input evices to accept

    voice commans.

    The voice s!stem input can "e use to initiate graphics operations or to enter ata.

    These s!stems operate "! matching an input against a preefine ictionar! of wors an

    pharses.

    DITION9&'

    9 ictionar! is set up for a particular operator

    The operator spea( the comman wors to "e use into the s!stem

  • 8/13/2019 gip 1,2,3,4,5 units

    24/100

    Each wor is spo(en several times # the s!stem anal!es the wor # esta"lishes a

    freuenc! pattern for that wor in the ictionar!.

    8ater when a voice comman is given the s!stem searches the ictionar! for a freuenc!

    pattern match

    Koice input is t!picall! spo(en into a microphone mounte on a heaset.

    The microphone is esigne to minimie input of other "ac(groun souns.

    $9&D+OP' DEKIE%

    $ar cop! output for images can "e o"taine in several formats

    =sers can put pictures on paper "! irecting graphics output to a printer or plotter.

    The ualit! of pictures o"taine from a evice epens on the ot sie # ot per inch or

    lines per inch.

    %mooth characters can "e prouce in printe te

  • 8/13/2019 gip 1,2,3,4,5 units

    25/100

    Dot matri< printers have a ot matri< print hea containing a rectangular arra! of

    protruing pins

    The no. of pins epens on the ualit! of the printer

    Iniviual characters or graphic patterns are o"taine "! retracting certain pins so that the

    remaining pins form the pattern to "e printe

    NON I3P9T DEKIE%

    Non impact plotters an printers use laser techniues , in( /et spra!s , pi?

    INL ET P&INTE&

    These printers prouce output "! suirting in( in horiontal rows across a roll of paper

    wrappe on a rum.

    The electricall! charge in( stream is eflecte "! an electric fiel to prouce ot matriP$IG%?

  • 8/13/2019 gip 1,2,3,4,5 units

    31/100

    P$IG% is an e

  • 8/13/2019 gip 1,2,3,4,5 units

    32/100

    UNIT II

    DISPLAY PRIMITIVES AND ATTRIBUTES

    LINE DRAWING ALGORITHM

    8ine rawing is our first aventure into the area of scan conversion. The nee for scan

    conversion, or rasteriation, techniues is a irect result of scanning nature of raster

    ispla!s

    The goal of an! line rawing algorithm is to construct the "est possi"le appro

  • 8/13/2019 gip 1,2,3,4,5 units

    33/100

    The common conventions that pi! U !*? >

  • 8/13/2019 gip 1,2,3,4,5 units

    34/100

    In the following pseuocoe sample plot(x,y)plots a point an abs returns a"solute

    value:

    function line>

  • 8/13/2019 gip 1,2,3,4,5 units

    35/100

    %o, wor(ing in the first positive octant of the plane, line rawing "ecomes a matter of

    eciing "etween two possi"ilities at each step.

    5e can raw a iagram of the situation which the plotting program fins itself in having

    plotte >

  • 8/13/2019 gip 1,2,3,4,5 units

    36/100

    The new value of error can aopt one of two possi"le values, epening on what new

    point is plotte. If >

  • 8/13/2019 gip 1,2,3,4,5 units

    37/100

    This gives an integer+onl! test for eciing which point to plot.

    The upate rules for the error on each step ma! also "e cast into form. onsier the

    floating+point versions of the upate rules:

    3ultipl!ing through "! !iels:

    which is in form.

    =sing this new YYerrorVV value, , with the new test an upate euations gives

    -resenhamVs integer+onl! line rawing algorithm:

  • 8/13/2019 gip 1,2,3,4,5 units

    38/100

    Integer onl! + hence efficient >fast?.

    3ultiplication "! 7 can "e implemente "! left+shift.

    This version limite to slopes in the first octant, .

    98GO&IT$3 FO& GENE&9TING I&8E

    3an! incremental methos e

  • 8/13/2019 gip 1,2,3,4,5 units

    39/100

    5e can set eight s!mmetric pipi?. 5e can use

    s!mmetr! to improve the eu? an cos>u?.

    are generating a circle from the origin with raius *. This woul impl! the following

    ta"le of values:

  • 8/13/2019 gip 1,2,3,4,5 units

    40/100

    u Crcos>u? 'rsin>u?

    * * *

    . 0.01 .000

    .7 0. .00

    .@ 0.11 7.06

    .) 0.7 @.0

    .1 .; ).;0

    .6 .71 1.61

    .; ;.61 6.))

    . 6.0; ;.; >Note: pi) .;1)?

    ....

    .1;* * * >Note: pi7 .1;*?

    7? &otation 3etho + this metho consists of using the point >u?+'sin>u?

    'rot Csin>u? M 'cos>u?

    To use the rotation metho, we assign >C*,'*? eual to >r,*?. 5e can then use the

    following euations to generate successive points:

    CnMCncos>u?+'nsin>u?

    'nM Cnsin>u? M 'ncos>u?

    E88IP%E GENE&9TING 98GO&IT$3

  • 8/13/2019 gip 1,2,3,4,5 units

    41/100

    7a is the length of the ma/or a7+7!pM7?

    In region 7, choices are % an %E

    Initial conition: init "7>>!+?7+"7?

    For a move to %, new olMDeltas with Deltas a7>+7!pM@?

    For a move to %E, new olMDelta%E with

    Delta%E "7>7+7!pM@?

    %top in region 7 when the ! value is ero.

  • 8/13/2019 gip 1,2,3,4,5 units

    42/100

    9&E9 FI88ED 9TT&I-=TE%

    It is an area fille with the foregroun color, "ut it epens on the current interior st!le.

    The %O8ID st!le epens onl! on the foregroun color. The $9T$ an %TIPP8E st!le

    epen on the foregroun color, "ac(groun color an on the "ac( opacit! attri"ute. The

    hatch lines rawn with this st!le o not epen on the other line attri"utes. The

    P9TTE&N st!le epens onl! on glo"al canvas attri"utes.

    The fille area inclues the line at the ege of the area. %o if !ou raw a fille rectangle,

    sector or pol!gon on top of a non fille one using the same coorinates, no st!le an

    pi

  • 8/13/2019 gip 1,2,3,4,5 units

    43/100

    Note that when a Filling 9ttri"ute is moifie, the active filling st!le is now that of the

    moifie attri"ute >hatch, stipple or pattern?. Notice that this is not true for the clipping

    area. 5hen the clipping area is moifie, the clipping is onl! affecte if it is active.

    Fills the arc of an ellipse aligne with the a

  • 8/13/2019 gip 1,2,3,4,5 units

    44/100

    8ine color is set using the routine plcol*.The argument is ignore for evices which can

    onl! plot in one color, although some terminals support line erasure "! plotting in color

    ero.

    8ine with is set usingplwi. This option is not supporte "! all evices.

    8ine st!le is set using the routine plst!lorpllst!. 9 "ro(en line is specifie in terms of a

    repeate pattern consisting of mar(s >pen own? an spaces >pen up?. The arguments to

    this routine are the num"er of elements in the line, followe "! two pointers to integer

    arra!s specif!ing the mar( an space lengths in micrometers. Thus a line consisting of

    long an short ashes of lengths ) mm an 7 mm, separate "! spaces of length .1 mm

    is specifie "!:

    mar(]*^ )***J

    mar(]^ 7***J

    space]*^ 1**J

    space]^ 1**J

    plst!l>7, mar(, space?J

    To return to a continuous line, /ust call plst!lwith first argument set to ero. 'ou can use

    pllst!to choose "etween ifferent preefine st!les.

    8ines an line segments

    In mathematics, lines are infinite 2 that is, the! have no ens. It is not often, in the real

    worl, that we eal with such lines. 5hen people use the wor VlineV to tal( a"out the

    lines of a tennis court, for e

  • 8/13/2019 gip 1,2,3,4,5 units

    45/100

    UNIT III

    TWO DIMENSIONAL TRANS%ORMATIONS AND VIEWING

    TRANS%ORMATION TYPES

    9 two imensional transformation is an! operation on a point in space >

  • 8/13/2019 gip 1,2,3,4,5 units

    46/100

    This is accomplishe "! aing a translation factor T< to the C coorinate an T! to the

    ' coorinate of each verte

  • 8/13/2019 gip 1,2,3,4,5 units

    47/100

    If an o"/ect that is scale is not positione at the origin, the scale figure will also "e

    translate. This change in position can "e compensate for "! scaling a"out an ar"itrar!

    point, usuall! a corner or the center of the o"/ect.

    Rotation

    &otation is a transformation that causes a point p to "e move relative to a central point,

    without changing the istance of p from that point. This transformation is accomplishe

    "! appl!ing the rotation euation to each verte< of the o"/ect. 9 rotation is specifie "!

    proviing an angle, -, inicating how man! egrees of rotation are esire. This angle

    ma! "e either positive or negative. 9 positive angle inicates a counter+cloc(wise

    rotation a"out the origin.

    The transformation euations for rotation are:

    CVCcos-+'sin-

    'V C sin- M ' cos-

    These euations can "e easil! erive from the figure a"ove, in which a rotation "! -

    transforms P>C,'? into P7>CV,'V?. -ecause the rotation is a"out the origin, the istance

    from the origin to P an P7 la"ele r in the figure, are eual.

    -! simple trigonometr!, we fin that

    Crcos9

    ' r sin9

  • 8/13/2019 gip 1,2,3,4,5 units

    48/100

    an

    sin>9M-?'Vr

    cos>9 M -? CVr

    %u"stitution using the ou"le angle formula

    sin>9M-?sin9cos-Mcos9sin-

    cos>9M-? cos9 cos- + sin9 sin-

    5e see that

    CVr>Cr?cos-+>'r?sin-

    'Vr >'r? cos- M >Cr? sin-

    an then

    CVCcos-+'sin-

    'V ' cos- M C sin-

    Thus,

    CVCcos-+'sin-

    'V C sin- M ' cos-

    39T&IC &EP&E%ENT9TION

    It is more reasona"le to fin a consistent wa! to hanle all three transformations. This can

    "e one "! eC,',5?, instea of >C,'?. Triples of coorinates t!picall!

    represent points in @+space, "ut here it is use to represent points in 7+space. =suall! 5 is

    fi

  • 8/13/2019 gip 1,2,3,4,5 units

    49/100

    Translation

    The matri< for translation is:

    an the euations for the translation transformation "ecome

    Scale

    The matri< for scaling is:

    an the euations for the scaling transformation relative to the origin "ecome

    Rotation

    The matri< for rotation is:

  • 8/13/2019 gip 1,2,3,4,5 units

    50/100

    an the euations for the rotation transformation a"out the origin "ecome

    CONCATENATION

    We use matrix composition to produce any series of transformations that are desired.

    The transformation seuence is then defined !y multiplying the transformation

    matrices together. The order of the multiplication seuence is important.Remem!er matrix multiplication is not commutati"e.

    Rotation or Scaling a!out an ar!itrary point

    The scaling an rotation transformations are efine a"out the origin. The user might

    wish to rotate or scale a"out an ar"itrar! point. This can "e one using a com"ination of

    transformations we alrea! (now a"out.

    To scale a"out P >+

  • 8/13/2019 gip 1,2,3,4,5 units

    51/100

    To rotate a"out P >+_?

    @.Translate the o"/ect "! >T

  • 8/13/2019 gip 1,2,3,4,5 units

    52/100

  • 8/13/2019 gip 1,2,3,4,5 units

    53/100

    9 shear parallel to the < a

    is not ifficult to see that "etween a point >

  • 8/13/2019 gip 1,2,3,4,5 units

    54/100

    Therefore, if a line has an euation 9< M -! M *, after plugging the formulae for 9cosa + -sina?9sina M -cosa?!V M *

    Translations an rotations can "e com"ine into a single euation li(e the following:

    The a"ove means that rotates the point >

  • 8/13/2019 gip 1,2,3,4,5 units

    55/100

    8et & "e a transformation matri< sening

  • 8/13/2019 gip 1,2,3,4,5 units

    56/100

    5ith this set of euations, letting a "e 0* egree rotates >,*,*? to >*,,*? an >*,,*? to >+

    ,*,*?. Therefore, the < : ! : : w?. Theplane at infinit! is usuall! ientifie with the set of points

    with w *. 9wa! from this plane we can use >

  • 8/13/2019 gip 1,2,3,4,5 units

    57/100

    If we tr! to intersect the two planes efine "! euations < w an < 7w then we

    clearl! will erive first w * an then < *. That tells us that the intersection is

    containe in the plane at infinit!, an consists of all points with coorinates >* : ! : : *?.

    It is a line, an in fact the line /oining >* : : * : *? an >* : * : : *?. The line is given "!

    the euation

    >*:!::*? > U `?>*::*:*? M `>*:*::*?

    where is a scaling factor. The scaling factor can "e a/uste to normalie the

    coorinates >* : ! : : *?, there"! eliminating one of the two egrees of freeom. The

    result is a set of points with onl! one egree of freeom, as is e

  • 8/13/2019 gip 1,2,3,4,5 units

    58/100

    'wma< + 'wmin 'vma< + 'vmin

    5e can rewrite a"ove as

    Cv ]>Cvma< + Cvmin?>Cwma< + Cwmin?^ >Cw + Cwmin? M Cvmin %< >Cw + Cwmin? M Cvmin %< Cw M 'vma< + 'vmin? >'wma< + 'wmin?^ >'w + 'wmin? M 'vmin

    %! >'w + 'wmin? M 'vmin %! 'w M !

    Note that %

  • 8/13/2019 gip 1,2,3,4,5 units

    59/100

    Isotropic an Non+Isotroptic Transformations

    8et the real worl co+orinate "e represente "! >C, '? an its euivalent co+orinate in

    ispla! space "e >

  • 8/13/2019 gip 1,2,3,4,5 units

    60/100

    It is esira"le to restrict the effect of graphics primitives to a su"region of the canvas, to

    protect other portions of the canvas. 9ll primitives are clippe to the "ounaries of this

    clipping rectangleJ that is, primitives l!ing outsie the clip rectangle are not rawn.

    The efault clipping rectangle is the full canvas > the screen ?, an it is o"vious that we

    cannot see an! graphics primitives outsie the screen.

    9 simple eC,'? to "e insie the clipping rectangle:

    Cmin [ C [ Cma%G?

    %5EEP &EP&E%NT9TION

    %pecif!ing a 7D shape an a sweep that moves the shape through a region of space.

    5e perform a sweep "! moving the shape along a path. 9t intervals along this path, we

    replicate the shape an raw a set of connectiong line in the irection of the sweep to

    o"tain the wireframe reprensentation.

  • 8/13/2019 gip 1,2,3,4,5 units

    74/100

    E

  • 8/13/2019 gip 1,2,3,4,5 units

    75/100

  • 8/13/2019 gip 1,2,3,4,5 units

    76/100

    KI%=98I9TION

    The use of graphical methos to ai in anal!sis, often of atasets so large or complean pieces of o"/ects? that are not visi"le

    in the image

    Ne

  • 8/13/2019 gip 1,2,3,4,5 units

    84/100

    * * 2*

    * * *

    P&OETION%

    9fter the worl coorinate escriptions of the o"/ects in a scene are converte to viewing

    coorinates , we can pro/ect the @D o"/ect onto the 7D view plane.

    There are 7 t!pes of pro/ection methos

    . parallel pro/ection metho

    7. perspective pro/ection metho

    . P9&988E8 P&OETION 3ET$OD

    Parallel pro/ections catagorie one of two ma/or su"classes of planar geometric

    pro/ections. Pro/ections within this su"class have two characteristics in common. The

    first characteristic concerns the placement of the center of pro/ection >P&P? which

    represents the camera or viewing position. In a parallel pro/ection, the camera is locate

    at an infinite istance from the viewplane . -! placing the camera at an infinite istance

    from the viewplane, pro/ectors to the viewplane "ecome parallel >the secon

    characteristic of a parallel pro/ection? in result forming a parallelepipe view volume.

    Onl! o"/ects within the view volume are pro/ecte to the viewplane. Figure shows the

    pro/ection of line 9- to the viewplane. In this case, the measurement of line 9- is

    maintaine in the pro/ecte line 9V-V. 5hile the measurements of an o"/ect are not

    preserve in all parallel pro/ections, the parallel nature of pro/ectors maintains the

    proportion of an o"/ect along a ma/or a

  • 8/13/2019 gip 1,2,3,4,5 units

    85/100

    There are two ifferent t!pes of parallel pro/ections:If the irection of pro/ection is

    perpenicular to the pro/ection plane then it is an orthographic pro/ection. If the irection

    of pro/ection is not perpenicular to the pro/ection plane then it is an o"liue pro/ection.

    8oo( at the parallel pro/ection of a point >Note the left hane coorinate

    s!stem?. The pro/ection plane is at *.

  • 8/13/2019 gip 1,2,3,4,5 units

    86/100

    Orthographic pro/ections that show more than sie of an o"/ect are calle a

  • 8/13/2019 gip 1,2,3,4,5 units

    87/100

    The pro/ectors are not perpenicular to the pro/ection plane "ut are parallel from the

    o"/ect to the pro/ection plane The pro/ectors are efine "! two angles 9 an where:

    9 angle of line >

  • 8/13/2019 gip 1,2,3,4,5 units

    88/100

    -? tan9 7, 9 6@.)*, 8 7

    8ines which are perpenicular to the pro/ection planeare pro/ecte at 7 length . This is

    a a"inet pro/ection.

    7. PE&%PETIKE P&OETION

    =se for:

    o avertising

    o presentation rawings for architecture, inustrial esign, engineering

    o fine art

    Pros:

    o gives a realistic view an feeling for three imensional form of o"/ect

    ons:

    o oes not preserve shape of o"/ect or scale >e

  • 8/13/2019 gip 1,2,3,4,5 units

    89/100

    o parallel lines not parallel to the pro/ection plane converge

    o sie of the o"/ect is iminishe with istance

    o foreshortening is not uniform.

    Perspective Pro/ections

    8i(e parallel pro/ections, perspective pro/ections efine a ma/or su"class of planar

    geometric pro/ections. Divisons within perspective pro/ections are consistent in that the

    center of pro/ection >P&P? is place at a finite istance from the viewplane. -ecause of

    this finite istance "etween the camera an the viewplane, pro/ectors are no longer

    parallel. -! placing the camera near the viewplane, as shown for the perspective

    pro/ection in Figure @, pro/ectors from the P&P to the eges of the pro/ection winow,

    locate on the u+, v+plane, efine a p!ramial view volume. 9s shown in Figure the

    pro/ectors from the center of pro/ection to line 9- form a much shorter line 9V-V in the

    viewplane. The reuction in length of the pro/ecte line is attri"ute to the ecreasing

    istance "etween the two pro/ectors as the viewing surface "ecomes nearer to the center

    of pro/ection.

    In comparison to parallel pro/ections, perspective pro/ections often provie a more

    natural an realistic view of a three+imensional o"/ect. -! comparing the viewplane of a

    perspective pro/ection with the view seen from the lens of a camera, the unerl!ing

    principals of a perspective pro/ection can "e easil! unerstoo. 8i(e the view from a

    camera, lines in a perspective pro/ection not parallel to the viewplane converge to a

  • 8/13/2019 gip 1,2,3,4,5 units

    90/100

    istant point >calle a vanishing point? in the "ac(groun. 5hen the e!e or camera

    position is close to the o"/ect, perspective foreshortening occurs with istant o"/ects

    appearing smaller in the viewplane than closer o"/ects of the same sie.

    Perspective pro/ections are t!picall! separate into three classes: one+point, two+point,

    an three+point pro/ections. Each class iffers in the orientation of the viewplane an the

    num"er of vanishing points the unit cu"e has.

    In a one+point perspective, lines of a three+imensional o"/ect along a ma/or a

  • 8/13/2019 gip 1,2,3,4,5 units

    91/100

    >n

  • 8/13/2019 gip 1,2,3,4,5 units

    92/100

  • 8/13/2019 gip 1,2,3,4,5 units

    93/100

  • 8/13/2019 gip 1,2,3,4,5 units

    94/100

    5e can also animate o"/ects along two+imensional motion paths using the color+ta"le

    transformlions. $ere we preefine the o"/ect at successive positions along the

    motion path, an set the successive "loc(s of piin arra! P.&? of current critical point.

    P.9ET 2 active ege ta"le of pol!gon P. Note that each pol!gon has its own 9ET.

    9n! other ata relevant to the application, such as the pol!gon4s @+imensional ata,

    lighting information, etc. The scanline epth "uffer is a +imensional arra! % whose sie

    is eual to the num"er of pi

  • 8/13/2019 gip 1,2,3,4,5 units

    95/100

    will "e referre to as P.DET&, etc. In aition, P.F I88 is moifie so that it reners a

    pii,$? onl! if its epth is less than the current value of %]i^, an the value of %]i^ is

    upate. The %+"uffer algorithm is specifie "elow. The scanline generation of the image

    is o"taine "! an outer loop on the scanlines an an inner loop on the pol!gons which

    calls on P.PO8INE for ever! pol!gon P. PO8INE reners a single scanline of a single

    pol!gon an the %+"uffer uses it in a ovetail fashion on all the pol!gons. There e

  • 8/13/2019 gip 1,2,3,4,5 units

    96/100

    Figure . &a! trace image

    A)*an$a"es #+ ra, $racin"

    &a! tracingVs popularit! stems from its "asis in a realistic simulation of lighting over

    other renering methos >such as scanline renering or ra! casting?. Effects such as

    reflections an shaows, which are ifficult to simulate using other algorithms, are a

    natural result of the ra! tracing algorithm. &elativel! simple to implement !et !ieling

    impressive visual results, ra! tracing often represents a first fora! into graphics

    programming.

    Disa)*an$a"es #+ ra, $racin"

    9 serious isavantage of ra! tracing is performance. %canline algorithms an other

    algorithms use ata coherence to share computations "etween pi

  • 8/13/2019 gip 1,2,3,4,5 units

    97/100

  • 8/13/2019 gip 1,2,3,4,5 units

    98/100

    Tracing ra!s from the light source to the e!e. 8ots of ra!s are waste "ecause the! never

    reach the e!e.

    Figure ). 5e trace a new ra! from each ra!+o"/ect intersection irectl! towars the light

    source

    In the figure we see two ra!s, a an ", which intersect the purple sphere. To etermine

    the color of a, we follow the new ra! aV irectl! towars the light source. The color of a

    will then epen on several factors, iscusse in olor an %haing"elow. 9s !ou can

    see, " will "e shaowe "ecause the ra! "V towars the light source is "loc(e "! the

    sphere itself. &a! a woul have also "een shaowe if anot

    http://www.cs.unc.edu/~rademach/xroads-RT/RTarticle.html#color%23colorhttp://www.cs.unc.edu/~rademach/xroads-RT/RTarticle.html#color%23color
  • 8/13/2019 gip 1,2,3,4,5 units

    99/100

    3O&P$ING

    3orphing is aspecial effectinmotion picturesan animationsthat changes >or morphs?

    one imageinto another through a seamless transition. 3ost often it is use to epict one

    person turning into another through some magical or technological means or as part of a

    fantas! or surreal seuence. Traitionall! such a epiction woul "e achieve through

    cross+faing techniues on film. %ince the earl! 00*s, this has "een replace "!

    computer software to create more realistic transitions. 3orphing was use in the film &un

    -en -unn! run to have the humans an the cartoon animals communicating in the same

    picture.

    Early Morphing Techniques

    In earl! feature films a morph woul "e achieve "! cross+faing from the motion picture

    of one actor or o"/ect to another. -ecause of the limitations of this techniue the actors or

    o"/ects woul have to sta! virtuall! motionless in front of a "ac(groun that i not

    change or move in the frame "etween the "efore an after shots.

    http://en.wikipedia.org/wiki/Special_effecthttp://en.wikipedia.org/wiki/Special_effecthttp://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Animationhttp://en.wikipedia.org/wiki/Imagehttp://en.wikipedia.org/wiki/Imagehttp://en.wikipedia.org/wiki/Special_effecthttp://en.wikipedia.org/wiki/Filmhttp://en.wikipedia.org/wiki/Animationhttp://en.wikipedia.org/wiki/Image
  • 8/13/2019 gip 1,2,3,4,5 units

    100/100

    Later Morphing Techniques

    8ater more sophisticate cross+faing techniues were emplo!e that fae ifferent

    parts of one image to the other grauall! instea of faing the entire image at once. This

    st!le of morphing was perhaps most famousl! emplo!e in the vieo former *cc

    mem"ers Levin Gole! an 8ol reme >performing as Gole! # reme? prouce in

    01for their song r!. It consiste of a series of "lac( an white close+up shots of faces

    of man! ifferent people that grauall! fae from one to the ne


Recommended