Changing colors of groups of polygons

New Message Reply Date view Thread view Subject view Author view

Jan (bohrer++at++netcom.com)
Fri, 19 Aug 1994 11:16:58 -0700 (PDT)


Hi -

I'm working on dynamically changing colors of groups of polygons on
a real time model and having some problems. I wrote some test code
that sets several different polygon groups to different colors while
not changing the rest of the model. When I execute the program, the
polygons are basically all the same color scheme and and some of the
colors change intermitantly (they flash to white and then back to
whatever color was there before). Each polygon group is supposed to
be a different color but they all seem to come back with the same
color scheme. Each polygon group is identified with a Geode at load
time through a callback function.

I have tried the pfGSetAttr with different attribute bindings (PFGS_OVERALL,
PFGS_PER_PRIM, and PFGS_PER_VERTEX). With the OVERALL flag set the
entire model take on one color and then just flashes back and forth. By
PER_PRIM it appears as if individual polygons within the Geode take on
different colors, and with PER_VERTEX, I get a psychodelic model that
also flashes. I am including a fragment of code where I am actually
attempting to change the color.

I would appreciate any suggestions for help with this problem.

TIA,
Jan

please note that facet is a pointer to a structure which contains
the facet (polygon group) id number and the GeoSet pointer. This
facet number is used to feed color change data to the polygons in
real-time from another process.
Also, the color setting occurs in the postframe processing at
approximately 20 times per second.

**************************** Code Fragment Included *************************
   if (facet->facet_id == 9)
   {
     red = 1.0;
     green = 0.0;
     blue = 0.0;
     pfSetVec4(color, red, green, blue, alpha);
     pfGSetAttr(facet->facet_geoset, PFGS_COLOR4, PFGS_PER_PRIM, color, NULL);
   }
   pfDCSRot(model, h, p, r);

    

-- 

___ ___....-----'---`-----....___ ========================================= Jan Bohrer ___`---..._______...---'___ Klutz Extraordinaire (___) _|_|_|_ (___) Can We Go Skiing Now? \\____.-'_.---._`-.____// ~~~~`.__`---'__.'~~~~ `~~~' He's Dead Jim...


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:29 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.