Hi Chris, Thanks the example, got it right after my previous post...
I've just tested out the new osgpick.cpp against my revised IntersectionVisitor.cpp and it works fine so I'll check this fixed in into svn/trunk. Could you test at your end. Robert. On Thu, Nov 6, 2008 at 1:28 PM, Chris Denham <[EMAIL PROTECTED]> wrote: > Hi Robert, > I have attached the osgpick example that shows the problem when running > (osgpick --relative-camera-scene) > When I run this, I seem to get no intersections for the cube. > > It is also worth noting that even with the camera->setViewMatrix(..) line > commented out, the results are still a bit supspect even with the change I > submitted to IntersectionVisitor that includes the model transform. I say > this because it sometimes only reports one intersection for the cube, when I > think it should be returning two. > > Just to summarise: My objective was to make the logic in > IntersectionVisitor::apply(Camera) equivalent to the code in > CullVistor::apply(Camera). > > Happy to calrify further if necessary. > > Cheers. > > Chris. > > > > ----- Original Message ----- From: "Robert Osfield" > <[EMAIL PROTECTED]> > To: "Chris Denham" <[EMAIL PROTECTED]> > Cc: "OpenSceneGraph Submissions" <[email protected]> > Sent: Thursday, November 06, 2008 1:04 PM > Subject: Re: [osg-users] Problem with computeIntersections for nodes below > post render camera > > >> Hi Chris, >> >> I am just undertaking another purge on pending submissions and I'm >> looking at your fix presently. In our post you mention >> >> "Though, still not working properly when child camera view matrix is >> changed." >> >> Do you have an example that illustrates this point? Could you explain >> more thoroughly as I'll have a bash at resolving this while I'm >> looking at this code. >> >> Robert. >> >> On Fri, Oct 31, 2008 at 11:57 AM, Chris Denham <[EMAIL PROTECTED]> >> wrote: >>> >>> I've attached an improved IntersectionVisitor that takes into account the >>> model transform above the relative camera. >>> Though, still not working properly when child camera view matrix is >>> changed. >>> :-( >>> Chris. >>> >>> ----- Original Message ----- From: "Chris Denham" <[EMAIL PROTECTED]> >>> To: "Robert Osfield" <[EMAIL PROTECTED]>; "OpenSceneGraph >>> Submissions" <[email protected]> >>> Sent: Friday, October 31, 2008 10:46 AM >>> Subject: Re: [osg-users] Problem with computeIntersections for nodes >>> below >>> post render camera >>> >>> >>>> Oh rats! I've just discovered that my submission to fix this problem may >>>> be >>>> incorrect or incomplete. >>>> It seems that my change does not work for non-identy transforms on or >>>> above >>>> the relative camera. >>>> e.g if I use camera->setViewMatrix or add the camera to a transform >>>> node. >>>> I have attached a new version of osgpick to show the problem. >>>> >>>> I think the root of the problem is that my attempt to transfer the logic >>>> of >>>> CullVisitor::apply(Camera) into IntersectionVisitor::apply(Camera) is >>>> incomplete. i.e. I used getViewMatrix in place of getModelViewMatrix. >>>> arggggg. >>>> And.... IntersectionVisitor::apply(Camera) still assumes an identity >>>> model >>>> matrix. >>>> >>>> I'm not really sure how to fix this because >>>> (CullStack::getModelViewMatrix >>>> / pushModelViewMatrix / popModelViewMatrix) are not available in >>>> IntersectionVisitor, and I don't really understand enough of what is >>>> going >>>> on to migrate that logic properly. >>>> >>>> I'm wondering if my submission should be reverted until this has been >>>> resolved in a better way? >>>> >>>> Any thoughts on a better solution to the problem? It also occurred to me >>>> that yet another can of worms may be opened if the relative camera has a >>>> different viewport from the main camera... urgg...so... should >>>> IntersectionVistor be traversing child cameras at all in that case? >>>> >>>> Chris. >>>> >>>> >>>> ----- Original Message ----- From: "Chris Denham" <[EMAIL PROTECTED]> >>>> To: "Robert Osfield" <[EMAIL PROTECTED]>; "OpenSceneGraph >>>> Submissions" <[email protected]> >>>> Sent: Monday, October 27, 2008 5:58 PM >>>> Subject: Re: [osg-users] Problem with computeIntersections for nodes >>>> below >>>> post render camera >>>> >>>> >>>>> Here's the modified osgpick example again with a command line option to >>>>> load >>>>> the test scene. >>>>> e.g. osgpick --relative-camera-scene >>>>> Chris. >>>>> >>>>> ----- Original Message ----- From: "Chris Denham" >>>>> <[EMAIL PROTECTED]> >>>>> To: "Robert Osfield" <[EMAIL PROTECTED]> >>>>> Cc: "OpenSceneGraph Submissions" >>>>> <[email protected]> >>>>> Sent: Monday, October 27, 2008 5:18 PM >>>>> Subject: Re: [osg-users] Problem with computeIntersections for nodes >>>>> below >>>>> post render camera >>>>> >>>>> >>>>>> Thanks Robert, >>>>>> I hadn't anticipated you checking also checking in the modified >>>>>> osgpick >>>>>> example. >>>>>> This may not be quite what you might intend, since the default scene >>>>>> used >>>>>> to be "fountain.osg", but now has my rather disconcerting scene. >>>>>> Perhaps >>>>>> my test scene would be better to be the default if the default >>>>>> fountain.osg is not found. >>>>>> I'll submit the osgpick.cpp file again if you think that is better. >>>>>> Chris. >>>>>> >>>>> >>>> >>> > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
