Hi Robert,

What I understood from your mail, is if I want to have one color for a
standard mode and one color for a selected mode, I have to put 2 colors in
the colorArray - the standard one being set by default thanks to one call to
setColorIndices and BIND_OVERALL. And when I want to change the color I need
to change the indice previously set by setColorIndices to the one
corresponding to the new color. I don't manage to change this indice, I can
reach the colorIndices array with
<geode>->getDrawable(0)->asGeometry()->getColorIndices(), but how to access
the records in the array?
I am sorry to ask for a question which even seems stupid to me, but there we
are, I am stuck...

Thanks,

Antoine.


-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Robert Osfield
Envoyé : mercredi 8 novembre 2006 11:47
À : osg users
Objet : Re: [osg-users] Secondary arrays

Hi Antoine,

I'd recommend just using the vertex attribute arrays in osg::Geometry
to setup multiple sets of vertex data.

I'd also strongly recommend against using independent index arrays for
vertex attribute array as this forces the osg::Geometry rendering code
to drop down to OpenGLslows paths for dispatching the data, as OpenGL
itself doesn't support independent indexing of vertex arrays.

Robert.

On 11/8/06, Antoine Rennuit <[EMAIL PROTECTED]> wrote:
> Hello,
>
>
> It seems possible to have two sets of colors for geometries with
> setColorArray and setSecondaryColorArray and swap between them when
needed.
> I would like to use this feature to have a normal color for the wireframe
of
> the mesh I display and another color when selected, but I don't understand
> how to swap between both color arrays (I assume it has to do with
> AttributeTypes but how?). And if I use secondary colors, must I also
define
> secondary color bindings, color indices.
>
> Moreover, if I wanted to have a third color (or more) to hightlight other
> modes, anybody knows how I could change the color of my mesh during
runtime?
>
>
> Thanks,
>
>
> Antoine.
>
> PS ; sorry if you received this mail twice, seems I have a pb with my
> mails...
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to