Hi Sherman,
On 1/28/07, sherman wilcox <[EMAIL PROTECTED]> wrote:
I have an OSG app that can display city names @ a given lat/lon on an
ellipsoid model of the earth created with osgdem. I want to extend this a
bit in two ways. First, I want to control when a given city pops up into
view. Second I want to fade the text in when that threshold has been
reached.
First question: How do I trigger text to show or hide?
A LOD node above each of the text fields would be the most straight
forward way to achieve the display of the texture when in range.
I've considered using
the camera altitude above the earth as the reference point and fade a given
city name in when the camera reaches this altitude. Sound reasonable?
You could write a cull callback to do the altitude testing and decide
whether to cull or not. To cull a subgraph in a cull callback you
simply don't bother to call traverse on that subgraph. NodeCallback
are effectively traversal callbacks that allow you to override
traversal as way as do operations you want. osg::The
ClusterCullIingCallback is an example of a callback that implements
culling as a node callback.
Second question: How do I fade the text in? Do I use a node callback?
In the CVS version of the OSG there is the osgText::FadeText. This
provide two things - the ability to decide in the text is occluded by
other text in the scene, and therefore force it to hide, and also does
timed fades in and out. See the osgfadetext example.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/