Hi Tim,

A switch should be perfectly efficient for what you are doing.  The
alternative would be to switch the labels off via their Geode's
NodeMask.  If you wanted to do without an update callback you
potentially could use a cull callback that looked at the current time
(from the NodeVisitor's FrameStamp) and decides whether to traverse
the subgraph or not.

Robert.

On Mon, Apr 26, 2010 at 10:57 PM, tim paige
<[email protected]> wrote:
> Hi, Tim
>
> Tim here again...
> Just letting you know what I came up with...
> Since I couldn't figure out how to talk to an individual drawable text node 
> attached as one of many to a geode, and I couldn't add a switch to the geode 
> and add a bunch of text objects to the switch, I went to what I consider to 
> be an inefficient way just to get things done. I hope someone will tell me 
> eventually how it should be done, but nonetheless....
>
> I used an osg::Switch, and then, for each of my text labels, I added a new 
> geode with an individual drawable text node that was set up with positional 
> information and a name so that it could be found later (LABEL_1 etc...). I 
> then assigned a callback to the switch node so the labels could be updated 
> according to the beat of a clock to accomplish the blinking requirement as 
> well. So the switch now has 24 geode/text children which I can now turn on 
> and off at will using switch->setchildValue(index, value). The individual 
> label is found by name by looking through the set of label names and setting 
> the value appropriately.
> The callback at this time keeps track of frame count and so a divisible frame 
> rate (60hz) gives me various blink speeds.
>
> I would still love to know how this would be done more efficiently or 
> elegantly... so...
>
> Thank you!
>
> Cheers,
> tim
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=27291#27291
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to