home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!kithrup!stanford.edu!ames!pacbell.com!well!moon!pixar!efo
- From: efo@pixar.com (efo)
- Subject: Re: GL - pixel size for points on PI TG/25?
- Message-ID: <1992Aug19.213308.18844@pixar.com>
- Sender: news@pixar.com (Usenet Newsmaster)
- Nntp-Posting-Host: toybear.pixar.com
- Organization: Pixar - Pt. Richmond, CA USA
- References: <36946@sdcc12.ucsd.edu>
- Date: Wed, 19 Aug 1992 21:33:08 GMT
- Lines: 53
-
- In article <36946@sdcc12.ucsd.edu> demers@cs.ucsd.edu (David DeMers) writes:
- >I have some data files containing (x,y,z) points & have written a
- >program to display the data. However, I just
- >get one-pixel points which look like dust...
-
- On the 4D25, you could try drawing the points as little characters
- you've defined yourself. (Of course, you're limited to integer point
- coordinates this way). It would look something like this:
-
- #define DOTFONTNUM 16
- #define DOTFONTHT 12
- #define NDOTSIZES 5
-
- static Fontchar DotFontChars[] = {
- { 0 },
- { 0, 1, 1, -1, -1, 12},
- { 0, 3, 3, -2, -2, 12},
- { 0, 5, 5, -3, -3, 12 },
- { 0, 7, 7, -4, -4, 12 },
- { 0, 9, 9, -5, -5, 12 },
- { 0, 11, 11, -6, -6, 12 }
- };
- static short DotFontRaster[] = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
- 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
- 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
- 0xffff };
- static fmfonthandle FontH;
- SetUpDots() {
-
- defrasterfont(DOTFONTNUM, DOTFONTHT, NDOTSIZES+1, DotFontChars, sizeof DotFontRaster, DotFontRaster);
-
- }
-
- DrawSeveralDots(int DotSize, int ndots, float pp[][3]) {
- if (DotSize == 0) {
- bgnpoint();
- while(ndots-- > 0) {
- v3f(pp++);
- }
- endpoint();
- } else {
- static char sizebuf[2];
- int oldfont = getfont();
- font(DOTFONTNUM);
- sizebuf[0] = DotSize;
- while (ndots-- > 0) {
- cmov(pp[0][0], pp[0][1], pp[0][2]);
- pp++;
- charstr(sizebuf);
- }
- font(oldfont);
- }
- }
-