next up previous
Next: Porocilo Up: Laboratorijske vaje pri predmetu Previous: Lower/Upper dekompozicija

Graficni prikaz enacbe tex2html_wrap_inline1308

Za graficen prikaz rezultatov v programu uporabite graficni jezik PHIGS. V ta namen uporabite homogene matrike in homogene transformacije.

Omogocati mora tudi ogled sistema s poljubnega zornega kota (rotacija, translacija in skaliranje v homogenih koordinatah).

Osnovni program, ki demonstrira uporabo jezika PHIGS je:

      program primer PHIGS
      include 'phigsdef.f'
    
      real  x(4)    /-150.0, 350.0, 250.0, -150.0/
      real  y(4)    /-150.0, 300.0, 250.0, -150.0/
      integer wkid, ViewIndex, connId , Trikotnik
      integer*4 fdopen, ErrorReturn

      real ViewMappingMatrix(3,3)
      real WindowLimits(4)/-200.0,400.0,-200.0,400.0/
      real ViewportLimits(4) / 0.2, 0.8, 0.2, 0.8/
      real ClipLimits(4)     / 0.0, 1.0, 0.0, 1.0/
      real Identity(3,3) /1.0, 0.0, 0.0, 
     *                    0.0, 1.0, 0.0, 
     *                    0.0, 0.0, 1.0/
      parameter (wkid = 1)
      parameter (ViewIndex = 1)
      parameter (connId = 1)

c     Odpre PHIGS ( Phigs OPen PHigs )
      call popph(fdopen(fnum(7), 'w'//char(0)), 0) 
      
c     Odpre delovno postajo (Phigs OPen WorKstation)
      call popwk(wkid, ConnId, WK171024)
c     Izracuna matriko pogleda in nastavi pogled
      call pevmm(WindowLimits, ViewportLimits, 
     *          ErrorReturn, ViewMappingMatrix)
      call psvwr(wkid, ViewIndex, Identity, 
     *         ViewMappingMatrix, ClipLimits, PCLIP)
c     Nastavitev zaslonskih koordinat
c     ( Phigs Set WorKstation Viewport )
      call pswkv(wkid, 0.0, 0.15, 0.0, 0.15)
c     Nastavitev uporabniskega koordinatnega sistema
c     ( Phigs Set WorKstation Window )
      call pswkw(wkid, 0.1, 1.0, 0.1, 1.0)

c     Odpre strukturo in izbere pogled
c     ( PhigsOPenSTructure in PhigSetViewIndex)
      call popst(Trikotnik)
      call psvwi(ViewIndex)
c     Dolocitev barve crte
c     ( Phigs Set PolyLine Color Index )
c     Indeksi: 1 = bela, 2 = rdeca, 3 = rumena,
c     4 = zelena, 5 = svetlo modra, 6 = modra,
c     7 = violicna, 8 = crna (ozadje)
      call psplci(2)
c     Izris trikotnika ( Phigs PolyLine )
      call ppl(4, x, y)
c     Dolocitev barve teksta
c     ( Phigs Set TeXt Color Index )
      call pstxci(5)
c     Dolocitev visine teksta
c     ( Phigs Set CHaracter Height )
      call pschh (10.0)
c     Izris teksta ( Phigs TeXt )
      call ptx( 100.0, 80.0, 'PHIGS skeleton')
      call pclst
      call ppost(wkid, Trikotnik, 1.)
      call puwk(wkid, PPERFO) 
      pause
c     Zapre delovno postajo in PHIGS
c     ( PhigsCLoseWorKstation, PhigsCLosePHigs )
      call pclwk(wkid)
      call pclph()
      end


Leon Kos
Thu Nov 20 12:56:40 CET 1997