Hi Gianni,


Hi Nick,
the triangle shown in white has just being added to highlight the selection. We 
can discard it for a while. For that reason I completly removed the selection 
highlight in my example. Please see attached code.
If you run the example and select a triangle pushing CTRL+LEFTMOUSE you will 
see a couple of messages on the console, something like:

"moving from primitive 1 to 0
... BUT why triangle does not change color?"

That's the point!

In my example I have 4 primitive sets:
index 0 = red
index 1 = green
index 2 = blue
index 3 = pink
So basically you are raping the primitive sets to color the primitive?
That is certainly a complicated way in case you simply have a bunch of triangles which you want to re-color during selection. I'd advice to use an additional vertex-attribute (per vertex) holding your "color-index" and evaluate it in the vertex-shader and modify this based on the intersected indices.

just my 2 cents
Cheers
Sebastian

Picking a green triangle it is moved from the original primitive set (1 i.e. 
green) to the primitive set with index = 0 (i.e. red). But why the triangle 
moved from green to red is still green? I would expect it to be red.

Regards,
Gianni

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68692#68692





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to