Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-23 Thread Simon Hammett
Which way would be better, what i have now or what you just suggested? My rule of thumb is; unless you have a compelling reason (ie efficiency), you should always prefer your own solutions. That way if you have to bug fix it or improve it in 1,2,3 years time you might remember what you did.

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Paul Griffiths gaffe...@gmail.com: Hi, I wish to compute an axis aligned bounding box of a given size whos position is centered to a node. This node cound be scaled, translated or rotated. it must be axis aligned. I need to know this to test if a picked part of a node picked with

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Paul Griffiths
Simon Hammett wrote: LineSegmentIntersector::Intersection has a member: matrix which is the accumulated local to world coordinates matrix. If you transform the nodes BoundingSphere center by that, you can then construct an aabb around that at whatever size you want. Sorry, i should of

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Paul Griffiths
Im clipping an osg::group with an osg::ClipNode so parts of it is invisible on screen but when i click on the invisible parts the picker is still picking the object . i dont want it like that, i want the invisible parts to be invisible to the mouse as well. so i wish to create an aabb around

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Paul Griffiths gaffe...@gmail.com: Im clipping an osg::group with an osg::ClipNode so parts of it is invisible on screen but when i click on the invisible parts the picker is still picking the object . i dont want it like that, i want the invisible parts to be invisible to the

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Simon Hammett s.d.hamm...@googlemail.com: 2009/5/22 Paul Griffiths gaffe...@gmail.com: Im clipping an osg::group with an osg::ClipNode so parts of it is invisible on screen but when i click on the invisible parts the picker is still picking the object . i dont want it like that, i

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Paul Griffiths
Ive came up with this but it returns outside true every time regardless: Code: bool outside = false; if (obj-getParentWidget() obj-getParentWidget()-getUsingClipBoundingBox()) { osg::ref_ptrosg::ClipNode clipNode = obj-getParentWidget()-getClipNode(); if (clipNode) { for

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Paul Griffiths gaffe...@gmail.com: Ive came up with this but it returns outside true every time regardless: Code: bool outside = false; if (obj-getParentWidget() obj-getParentWidget()-getUsingClipBoundingBox()) {    osg::ref_ptrosg::ClipNode clipNode =

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Paul Griffiths
Simon Hammett wrote: Okies, if memory serves me correctly, the clip planes aren't in world coordinates, I think they are in eye coordinates. So that would be take the local intersection coordinate and transform it using computeLocalToEye (in osg/Transform) and test that point. If that

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Paul Griffiths gaffe...@gmail.com: Simon Hammett wrote: Okies, if memory serves me correctly, the clip planes aren't in world coordinates, I think they are in eye coordinates. So that would be take the local intersection coordinate and transform it using computeLocalToEye (in

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Simon Hammett
2009/5/22 Simon Hammett s.d.hamm...@googlemail.com: 2009/5/22 Paul Griffiths gaffe...@gmail.com: Simon Hammett wrote: Okies, if memory serves me correctly, the clip planes aren't in world coordinates, I think they are in eye coordinates. Right I've had time to play with ClipNode, and what

Re: [osg-users] Compute axis aligned bounding box of a given size

2009-05-22 Thread Paul Griffiths
Simon Hammett wrote: Right I've had time to play with ClipNode, and what I said above is rubbish. You just need the matrix which transforms from the parent to the intersection node. Given you are writing a tool kit, I suspect you can quickly and easily work out that transform from

[osg-users] Compute axis aligned bounding box of a given size

2009-05-21 Thread Paul Griffiths
Hi, I wish to compute an axis aligned bounding box of a given size whos position is centered to a node. This node cound be scaled, translated or rotated. it must be axis aligned. I need to know this to test if a picked part of a node picked with the mouse is inside the bounds a bounding box