Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!sgi!reuel@khaki.asd.sgi.com From: reuel@khaki.asd.sgi.com (Reuel Nash) Newsgroups: comp.sys.sgi Subject: Re: lighted, multi-colored polys Summary: see lmcolor man page Message-ID: <110382@sgi.sgi.com> Date: 14 Jun 91 16:44:31 GMT References: <1991Jun14.145543.23235@eagle.lerc.nasa.gov> Sender: guest@sgi.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 50 In article <1991Jun14.145543.23235@eagle.lerc.nasa.gov>, xxdon@monet.lerc.nasa.gov (Don Sosoka) writes: > I want to draw smooth (GOURAUD) shaded lighted polygons starting with > different colors at each vertex. You're real close with the second loop. You need to call lmcolor to tell the graphics system what to do with the C3I calls. In "C" it would be: lmcolor(LMC_AD); > call SHADEM (GOURAU) > call BGNPOL > do 10 i = 1,N > icv(1) = IRED(i) > icv(2) = IGREEN(i) > icv(3) = IBLUE(i) > call C3I (icv) > vn(1) = XN(i) > vn(2) = YN(i) > vn(3) = ZN(i) > call N3F (vn) > v(1) = X(i) > v(2) = Y(i) > v(3) = Z(i) > call V3F (v) > 10 continue > call ENDPOL > BTW, this can go LOTS faster if you can arrange to not copy the color, normal, and vertex data, but use it where it is. I don't know how to do this in FORTRAN, but in "C" it would be: float v[MAXN][3], c[MAXN][3], nm[MAXN][3]; . . . bgnpolygon(); for(i = 0; i < MAXN; i++) { c3f(c[i]); n3f(n[i]); v3f(v[i]); } endpolygon(); Reuel Nash Email: reuel@sgi.sgi.com "Question Skepticism" Voicemail: x8749 Mail stop:SR-254 Work Phone:(713)266-1333 Home Phone:(713)589-6258 USMail: Silicon Graphics, 5858 Westheimer Suite 100, Houston, TX 77057