home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12635 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.8 KB  |  66 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!kithrup!stanford.edu!ames!pacbell.com!well!moon!pixar!efo
  3. From: efo@pixar.com (efo)
  4. Subject: Re: GL - pixel size for points on PI TG/25?
  5. Message-ID: <1992Aug19.213308.18844@pixar.com>
  6. Sender: news@pixar.com (Usenet Newsmaster)
  7. Nntp-Posting-Host: toybear.pixar.com
  8. Organization: Pixar - Pt. Richmond, CA USA
  9. References: <36946@sdcc12.ucsd.edu>
  10. Date: Wed, 19 Aug 1992 21:33:08 GMT
  11. Lines: 53
  12.  
  13. In article <36946@sdcc12.ucsd.edu> demers@cs.ucsd.edu (David DeMers) writes:
  14. >I have some data files containing (x,y,z) points & have written a
  15. >program to display the data.  However, I just
  16. >get one-pixel points which look like dust...  
  17.  
  18. On the 4D25, you could try drawing the points as little characters
  19. you've defined yourself. (Of course, you're limited to integer point
  20. coordinates this way). It would look something like this:
  21.  
  22. #define DOTFONTNUM    16
  23. #define DOTFONTHT    12
  24. #define NDOTSIZES    5
  25.  
  26. static Fontchar DotFontChars[] = {
  27.  { 0 },
  28.  { 0, 1, 1, -1, -1, 12},
  29.  { 0, 3, 3, -2, -2, 12},
  30.  { 0, 5, 5, -3, -3, 12 },
  31.  { 0, 7, 7, -4, -4, 12 },
  32.  { 0, 9, 9, -5, -5, 12 },
  33.  { 0, 11, 11, -6, -6, 12 }
  34. };
  35. static short DotFontRaster[] = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 
  36.                  0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
  37.                  0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
  38.                  0xffff };
  39. static fmfonthandle FontH;
  40. SetUpDots() {
  41.  
  42.     defrasterfont(DOTFONTNUM, DOTFONTHT, NDOTSIZES+1, DotFontChars, sizeof DotFontRaster, DotFontRaster);
  43.  
  44. }
  45.  
  46. DrawSeveralDots(int DotSize, int ndots, float pp[][3]) {
  47.     if (DotSize == 0) {
  48.         bgnpoint();
  49.         while(ndots-- > 0) {
  50.             v3f(pp++);
  51.         }
  52.         endpoint();
  53.     } else {
  54.         static char sizebuf[2];
  55.         int oldfont = getfont();
  56.         font(DOTFONTNUM);
  57.         sizebuf[0] = DotSize;
  58.         while (ndots-- > 0) {
  59.             cmov(pp[0][0], pp[0][1], pp[0][2]);
  60.             pp++;
  61.             charstr(sizebuf);
  62.         }
  63.         font(oldfont);
  64.     }
  65. }
  66.