Hi Daniel, I saw this problem about six months ago, and looked into, and the cause the the way the intersections codes indirectly uses the current event state to help decide which cameras are currently active. At the time when I saw the problem I looked into the issue, but didn't come away with a solution.
It does sound like a bit of odd coupling - compute intersections really shouldn't be effected by event state, but there a couple of decisions that the compute methods make that require knowledge of which cameras are relevant to the view to enable the reprojection of the screen coords into the final world coords of the scene. I recall that decoupling required some extra information to be passed into the computeIntersections method, effectively this convenience method tries too hard to be convenient by trying to make too many decisions for you. I will need to revist this issue to see if new methods are required/or whether the internals can be refactored to avoid this issue. The other way to handle this situation is to use your own intersection codes rather than these convenience methods. It pretty straight forward to roll your own from the osgUtil::IntersectionVisitor/LineSegmentIntersector/PolytopeIntersector classes - have a look at the osgpick example to see how, also have a look a the View::computeIntersections method to see what it does - it just uses these same classes to do it's work. Robert. On Thu, Feb 12, 2009 at 4:24 PM, Daniel Barber <[email protected]> wrote: > I'm having a problem using the computeIntersections method of the View class > in osgViewer namespace. I'm trying to perform picking, but not using a mouse > click or event on the window. > > Here is the issue: if I don't click inside the window of the OSG application > at some point in time, then the computeIntersections method returns no > intersections and fails. If I do click anywhere inside the window of my > application, then any time after, computeIntersections works fine. I know in > most applications people are using the mouse events for picking, but in my > application this is not an option. > > I tried stepping through the source code, but I am not seeing anything > different between the the case where I did and didn't click on the window > when trying to use computeIntersections. I searched the forums and on > google, but haven't found anyone else with this issue. > > Any ideas or assistance is appreciated. > > Daniel > > ------------------ > Read this topic online here: > http://osgforum.tevs.eu/viewtopic.php?p=6682#6682 > > > > > > _______________________________________________ > 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

