Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!math.fu-berlin.de!ira.uka.de!rusmv1!mira.tat.physik.uni-tuebingen.de!hofmann From: hofmann@mira.tat.physik.uni-tuebingen.de (Bernhard Hofmann) Newsgroups: comp.sys.sgi Subject: polymode(PYM_HOLLOW) Message-ID: Date: 29 Apr 91 15:55:01 GMT Sender: news@rusmv1.rus.uni-stuttgart.de (USENET News System) Organization: Comp.Center (RUS) U of Stuttgart, FRG Lines: 149 I'm having trouble with polymode(PYM_HOLLOW) on our VGX with alpha bitplanes. The following program doesn't quite do what I think it should do. I think it should draw, when in polymode(PYM_HOLLOW), only the red corner and the outlines of the cube. What happens on our machine is that after switching to PYM_HOLLOW the red and the green corners appear with all three lines leading to them as well as all other lines of the outline, except the righthand one. All lines that are drawn appear either thicker or thinner when switching from polymode(OYM_LINE) to polymode(PYM_HOLLOW). When you run the below program, press l or L to see the Cube drawn with polymode(PYM_LINE) or h or H to see it drawn with polymode(PYM_HOLLOW). This is only a sample program demonstrating the effect and therefore not very carefully written. ****************************************************************************** #include #include #include short *s3(short x, short y, short z); float corners[8][3] = { {-0.5,-0.5,-0.5}, {-0.5,-0.5,0.5}, {-0.5,0.5,0.5}, {-0.5,0.5,-0.5}, {0.5,-0.5,-0.5}, {0.5,-0.5,0.5}, {0.5,0.5,0.5}, {0.5,0.5,-0.5} }; short *s3(short x, short y, short z) { static short w[3]; w[0]=x; w[1]=y; w[2]=z; return w; } main() { short value; foreground(); keepaspect(1,1); winopen("Cube"); zbuffer(TRUE); zclear(); doublebuffer(); mmode(MVIEWING); ortho(-1.1,1.1,-1.1,1.1,-1.1,1.1); RGBmode(); stensize(8); /* for polymode(PYM_HOLLOW) */ lookat(0,0,0,1,1.1,1.2,0); gconfig(); sclear(0); qdevice(KEYBD); qdevice(ESCKEY); makeobj(1); zclear(); c3s(s3(0,0,0)); clear(); c3s(s3(255,80,0)); bgnpolygon(); c3s(s3(255,0,0)); v3f(corners[0]); c3s(s3(255,80,0)); v3f(corners[1]); v3f(corners[2]); v3f(corners[3]); endpolygon(); bgnpolygon(); v3f(corners[4]); v3f(corners[5]); c3s(s3(0,255,0)); v3f(corners[6]); c3s(s3(255,80,0)); v3f(corners[7]); endpolygon(); bgnpolygon(); c3s(s3(255,0,0)); v3f(corners[0]); c3s(s3(255,80,0)); v3f(corners[1]); v3f(corners[5]); v3f(corners[4]); endpolygon(); bgnpolygon(); c3s(s3(255,0,0)); v3f(corners[0]); c3s(s3(255,80,0)); v3f(corners[3]); v3f(corners[7]); v3f(corners[4]); endpolygon(); bgnpolygon(); v3f(corners[2]); v3f(corners[1]); v3f(corners[5]); c3s(s3(0,255,0)); v3f(corners[6]); c3s(s3(255,80,0)); endpolygon(); bgnpolygon(); v3f(corners[2]); v3f(corners[3]); v3f(corners[7]); c3s(s3(0,255,0)); v3f(corners[6]); endpolygon(); closeobj(); while(qread(&value) != ESCKEY) { switch (value) { case 'h': case 'H': polymode(PYM_HOLLOW); stencil(TRUE,1,SF_EQUAL,1,ST_KEEP,ST_KEEP,ST_KEEP); sclear(0); gconfig(); callobj(1); swapbuffers(); break; case 'l': case 'L': polymode(PYM_LINE); stencil(FALSE,1,SF_EQUAL,1,ST_KEEP,ST_KEEP,ST_KEEP); gconfig(); callobj(1); swapbuffers(); break; } } gexit(); } ****************************************************************************** Thank you very much for any hints. Bernhard Hofmann hofmann@mira.tat.physik.uni-tuebingen.de