home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11325 < prev    next >
Encoding:
Text File  |  1992-07-24  |  1.5 KB  |  66 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!news.larc.nasa.gov!hal.larc.nasa.gov!alan
  3. From: alan@hal.larc.nasa.gov (alan dare)
  4. Subject: Visual distortion problem
  5. Message-ID: <BrwDx2.48y@news.larc.nasa.gov>
  6. Originator: alan@hal.larc.nasa.gov
  7. Sender: news@news.larc.nasa.gov (USENET Network News)
  8. Organization: NASA Langley Research Center, Hampton, VA  USA
  9. Date: Fri, 24 Jul 1992 14:36:37 GMT
  10. Lines: 54
  11.  
  12.  
  13. This program creates a visual distortion. When the monitor updates at a rate
  14. twice as fast than the rate the program displays the graphic, one perceives
  15. two lines. When the rates of the monitor and program agree, one perceives a 
  16. single line. Question: is this a problem with the hardware or the  visual
  17. system?
  18.  
  19. *-------------------CUT HERE------------------------------*
  20. #include <gl.h>
  21. main ()
  22.  
  23. {
  24.  
  25.     static float    line[2][2] = {
  26.         {0.0,15.0},
  27.         {0.0,-15.0}
  28.     };
  29.  
  30.     float    i;
  31.  
  32.     prefposition(0, 1279, 0, 1023);
  33.     noborder();
  34.     winopen("SHOW");
  35.     RGBmode();
  36.     doublebuffer();
  37.     gconfig();
  38.     swapinterval(2);    /* Creates 30 Hz update rate */    
  39.  
  40.     while ( TRUE ) {
  41.         if (i > 20.0)
  42.             i = -20.0;
  43.         else
  44.             i+=0.2;
  45.  
  46.         cpack(0x00);
  47.         clear();
  48.         ortho2(-20.0,20.0,-20.0,20.0);
  49.         pushmatrix();
  50.         cpack(0xFFFFFF);
  51.         translate(i,0.0,0.0);
  52.         bgnline();
  53.         v2f(line[0]);
  54.         v2f(line[1]);
  55.         endline();
  56.         popmatrix();
  57.         swapbuffers();
  58.     }
  59. }
  60. *-------------------CUT HERE------------------------------*
  61. -- 
  62.  
  63. *********************************************************************
  64. Alan Dare                     |  Internet : alan@hal.larc.nasa.gov
  65. NASA Langley Research Center  | 
  66.