Forgot to add:

You also need the center of rotation, but I have assumed that this center point 
is already being stored as part of the data for the object from which the 
bounds are computed. If this is a standalone bounding box (for example, 
encapsulating a series of objects without a 'parent' object), then you would 
also require an additional 3D vector for the center point.

--
Matthew W. Fuesz
Software Engineer Asc.
Lockheed Martin STS
1210 Massillon Road
Akron, OH 44315
[EMAIL PROTECTED]
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fuesz, Matthew
Sent: Thursday, October 02, 2008 12:33 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Bounding Parallelepiped

For the case of a non-world-aligned bounding box - but still one which is 
parallel-sided (i.e., a rectangular volume) - you actually do not need all 
eight corners.

You only need the two opposite corners (as osg::BoundingBox uses) plus a 
rotation. Thus, you require either 5 3D vectors (2 corners + 3x3 rotation 
matrix) or 2 3D vectors and 1 4D vector (2 corners + rotation quaternion).

For a completely arbitrary bounding volume (where no two sides are guaranteed 
to be the same size), however, all of the corners would be necessary.

--
Matthew W. Fuesz
Software Engineer Asc.
Lockheed Martin STS
1210 Massillon Road
Akron, OH 44315
[EMAIL PROTECTED]
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tomlinson, Gordon
Sent: Thursday, October 02, 2008 12:26 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Bounding Parallelepiped

How OSG uses is fine for how it is used

But we were not talking about HOW OSG uses but how a someone would like a 
bounding box  that is not necessary axially aligned and to have a box were all 
six sides can be of difference size thus no real correlation between corners 
you need the 8 corners provide by opposite sides you cannot derive these if 
there all different



Gordon

__________________________________________________________
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__________________________________________________________
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

"Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival" 
- Master Tambo Tetsura

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Melis
Sent: Thursday, October 02, 2008 12:19 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Bounding Parallelepiped

Tomlinson, Gordon wrote:
> I disagree  :)
>
> You need 8 vec3's to do that, you need the 4 corners of any 2 opposite 
> sides of the bounding box in order to have every side a different size
>
> The osg::Bounding box only supplies 2 vec3's which effectively gives you 2 
> corner points and you cannot get the 8 corner points from 2, apart from a 
> parallel rectangle ...
>   
But using 8 corner points is reduntant, as OSG uses _axis-aligned_ bounding 
boxes. Even in case you were using aligned bboxes you would only need 4 vec3's 
to represent a bounding box under any orientation (one vec3 for one of the 
corners + 3 * a vec3 for each sizes axis starting at the corner (and even the 
3rd axis could be deduced from the other 2, except for its length)).

Paul
>
>
> Gordon
>
> __________________________________________________________
> Gordon Tomlinson
>
> Product Manager 3D
> Email  : gtomlinson @ overwatch.textron.com
> __________________________________________________________
> (C): (+1) 571-265-2612
> (W): (+1) 703-437-7651
>
> "Self defence is not a function of learning tricks 
> but is a function of how quickly and intensely one 
> can arouse one's instinct for survival" 
> - Master Tambo Tetsura
>
>  
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien 
> Guay
> Sent: Thursday, October 02, 2008 10:52 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Bounding Parallelepiped
>
> Hi Gordon,
>
>   
>> Unfortunately, OSG does not directly support what you want as osg'S 
>> bounding box, is as you have seen is a axially aligned min/max LL/UR
>>     
>
> That is not true. OSG's bounding box supports separate xmin/xmax, ymin/ymax, 
> zmin/zmax values, so it can represent boxes that have different sizes on all 
> axes.
>
> However, as Robert explained, OSG uses BoundingBox on Drawables, but 
> BoundingSpheres on nodes. So if you just take the root node's bounding sphere 
> and put that into a bounding box, of course you will get a bounding *cube*.
>
> ComputeBoundsVisitor is what you need. It will compute a minimal axis-aligned 
> bounding box for all *drawables*, not using the bounding spheres.
>
> #include <osg/ComputeBoundsVisitor>
>
> osg::ComputeBoundsVisitor cbbv;
> node->accept(cbbv);
> osg::BoundingBox bb = cbbv->getBoundingBox();
>
> It doesn't get much simpler than that.
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    [EMAIL PROTECTED]
>                                 http://www.cm-labs.com/
>                          http://whitestar02.webhop.org/ 
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to