Re: Changing colors of models

New Message Reply Date view Thread view Subject view Author view

Mario Veraart (rioj7++at++fel.tno.nl)
Tue, 9 Feb 1999 19:37:38 +0100 (MET)


>
> We our doing a port of our application from OpenGVS to Performer. We need
> to import MultiGen models of aircraft in our Performer application. The
> users like to color code these models dynamically. That is the users choose
> the color of the aircraft from the application code. The aircraft models
> have 3 LODs the highest level having texture, the 2 lower levels are
> untextured models. The untextured models need to change color the textured
> models should not. In the current OpenGVS application we put the comment
> #ignore_color in the LOD bead, (LOD attribute dialog box under comments or
> attribute extensions) in MultiGen and use a glColor call in a draw callback
> on the model in OpenGVS to change the color to what the user has selected.
> In Performer, when I use a glColor call in a draw callback on that
> aircraft model the color will not change. So I was wondering if you know
> the appropriate way to change the color of the aircraft dynamically?
> Any help you can provide is greatly appreciated.
> Thanks.
> Tammy C. Martin

To change the color dynamicly of some geometry you have to change the
values of the color attribute in the pfGeoSets that describe the
model. You cn do it directly, writing in the color attribute array
because they are shared between APP/CULL/DRAW. But better yet use a
pfFlux buffer to change the color in a frame synchronous and safe way.
If all the model is off one color, the color attribute has probaly the
PFGS_OVERALL binding so you only have to change one color value
(pfVec4) for every plane that needs repainted.

Mario


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Feb 09 1999 - 10:40:28 PST

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