[osg-users] Update node color on demand

Diego Mancilla dmancillac at gmail.com
Sat Nov 24 07:05:55 PST 2018


Hello,

I'm trying to change a node color on demand from my application. The idea is that the user, once the initial rendering took place can change the color of a node by pressing a key (or something similar). I know already hoy to change the color using a NodeVisitor (previous to the rendering). 


Code:
ColorVisitor newColor;
newColor.setColor(r, g, b);
_lines->accept(newColor);



Where _lines is a Node reference pointer and ColorVisitor is a subclass of NodeVisitor (http://forum.openscenegraph.org/viewtopic.php?p=75209#75209).

I tried to create a callback and attach it to the node but the callback get called every time and I cant pass to it the selected color on runtime.

Can anyone give some pointer about this issue?

Thank you!

Cheers,
[/url]

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







More information about the osg-users mailing list