Hi Ulrich and Sergey,

the problem I need to solve is this: for an arbitrary scene loadable through 
osg, detect which points in an array of points are visible (points are normally 
on model surface, but not necesserily part of the original model).

Your solutions sound very complex. Currently I'm using the following approach 
(simplified):

For each point x:

1.)check against the View + Projection Matrix to find out if point x is in 
frustum,
2.)use osgUtil::LineSegmentIntersector::Intersection to find first intersection 
between eyepoint and point -> if intersection is more than delta away from x 
and nearer to eyepoint -> x not visible

This process works quiet good, but I always need to issue a viewer->frame() for 
each change of camera position before the calculation, or it produces wrong 
information (visibility is not correct) . It looks like culling must be 
performed to get this approach to work.

As I need to test many views and many points, I am currently trying to remove 
the frame() call and do just the culling, but until now I only have partial 
success with it. I have overwritten the Renderer.cull() method to not increase 
the _drawQueue but the multithreaded viewer calls draw and it waits blocked in 
Renderer::ThreadSafeQueue::takeFront() forever. Strangly using 
setThreadingModel(osgViewer::Viewer::SingleThreaded) produces completly 
different results (also wrong visibility) but does not block.

Is there an easier way to only do the culling without drawing or even don't 
cull at all?

Thank you!

Cheers,
Oliver

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to