Paul Martz wrote on Thursday, April 23, 2009 9:59 AM:

> Hi all -- I'd like to see how members of the community are handling
this
> fairly common OSG problem. 
> 
> Imagine that your app needs to modify the scene graph based on the
viewpoint
> location, view frustum, distance to the viewpoint, etc. This
information is
> not guaranteed to be available, accurate, or up-to-date until the
_end_ of
> the update phase, right? Typically this info is only available from
the
> CullVisitor. But it's too late to modify the scene graph during cull
-- it's
> not thread safe. So, how does your app handle this situation?     
> 
> OSG itself needs to handle this situation in a few places.
AutoTransform,
> Billboard, LOD, and screen-oriented text, just to name a few. I
believe OSG
> handles this with a 1-frame latency with these classes (obtains the
values
> during cull but updates the scene graph during update of the next
frame), but
> haven't looked at the code in a long time.    
> 
> Another way to do this would be to query the viewpoint location / view
> frustum during update and modify the scene graph based on those
values, even
> though those values could still change before the start of cull-draw.

> 
> But I'm interested in hearing other ideas on how to handle this issue.
Thanks
> in advance for any feedback. 

I used a custom cull visitor (which I needed for other reasons, too) to
capture the viewpoint data and do the necessary scenegraph
modifications. At the time, I also needed more than the float precision
given by getEyepoint(), and I was trying to minimize the effects on code
that used my library; otherwise, I think I would have gone with a
modified update visitor that tracked the current eyepoint(s).

-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to