[osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Gianluca Natale
Hi All,
I'm having problem computing the global bounding sphere of my model.
I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode
(BoundingSphere Geode::computeBound()) is
computed as the bounding sphere of the bounding box that includes all its
drawables !?!

 

Why that?

Shouldn't it be the global bounding sphere of the drawables, merging the
single bounding spheres
of all the drawables?

 

So, a drawable that represents a sphere should have as bounding sphere
itself,
but this is not true with the computation OSG performs. It is larger than
strictly required.

 

Thanks,
Gianluca Natale

 

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


Re: [osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Simon Hammett
Calculating the perfect bounding sphere is an expensive operation.
You need to calc the convex hull which is O(n log n).
osg uses a fast approximation which is generally good enough.

2009/8/11 Gianluca Natale gianluca.nat...@adstorino.it:
 Hi All,
 I’m having problem computing the global bounding sphere of my model.
 I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode
 (BoundingSphere Geode::computeBound()) is
 computed as the bounding sphere of the bounding box that includes all its
 drawables !?!



 Why that?

 Shouldn’t it be the global bounding sphere of the drawables, merging the
 single bounding spheres
 of all the drawables?



 So, a drawable that represents a sphere should have as bounding sphere
 itself,
 but this is not true with the computation OSG performs. It is larger than
 strictly required.



 Thanks,
 Gianluca Natale



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





-- 
http://www.ssTk.co.uk
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Gianluca Natale
I cannot completely agree.

I mean that I know that the real perfect bounding sphere is computationally
expensive,
but in many cases (solid objects) it should be computed just once (since
BoundingSphere node::getBound() checks
if the bounding sphere has been already computed), when the object is
created.
The global bounding sphere might affect the fitting operation a lot. In case
of objects like spheres or discs,
the bounding sphere computed by OSG might be much greater than strictly
required.




-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Simon
Hammett
Sent: martedì 11 agosto 2009 12.00
To: OpenSceneGraph Users
Subject: Re: [osg-users] about the bounding sphere of a geode computed by
OSG

Calculating the perfect bounding sphere is an expensive operation.
You need to calc the convex hull which is O(n log n).
osg uses a fast approximation which is generally good enough.

2009/8/11 Gianluca Natale gianluca.nat...@adstorino.it:
 Hi All,
 I’m having problem computing the global bounding sphere of my model.
 I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode
 (BoundingSphere Geode::computeBound()) is
 computed as the bounding sphere of the bounding box that includes all its
 drawables !?!



 Why that?

 Shouldn’t it be the global bounding sphere of the drawables, merging the
 single bounding spheres
 of all the drawables?



 So, a drawable that represents a sphere should have as bounding sphere
 itself,
 but this is not true with the computation OSG performs. It is larger than
 strictly required.



 Thanks,
 Gianluca Natale



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





-- 
http://www.ssTk.co.uk
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.49/2295 - Release Date: 08/10/09
18:19:00

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


Re: [osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Tomlinson, Gordon
Like ALL scene graphs out there the OSG uses an approximation ( for
Scenegraph performance reasons) to produce a bounding sphere that is
ensured to encompass all its children but not necessarily tightly, and
this is fine for 99% of bounding sphere usage in a scene graph
 
If you want a tight and much more accurate bound sphere and or bounding
box then you will need to calculate this your self
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__

 



From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
Gianluca Natale
Sent: Tuesday, August 11, 2009 4:32 AM
To: Osg Users
Subject: [osg-users] about the bounding sphere of a geode computed by
OSG



Hi All,
I'm having problem computing the global bounding sphere of my model.
I debugged OSG (2.8.0) and discovered that the bounding sphere of a
geode
(BoundingSphere Geode::computeBound()) is
computed as the bounding sphere of the bounding box that includes all
its drawables !?!

 

Why that?

Shouldn't it be the global bounding sphere of the drawables, merging the
single bounding spheres
of all the drawables?

 

So, a drawable that represents a sphere should have as bounding sphere
itself,
but this is not true with the computation OSG performs. It is larger
than strictly required.

 

Thanks,
Gianluca Natale

 

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


Re: [osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Tomlinson, Gordon
This is how it is in OSG  and all other Scene graphs I have ever worked with 
and I have work with most

Without meaning to sound rude, I would say 

Get used to it in OSG as it not likely to change in how's its done 


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Gianluca Natale
Sent: Tuesday, August 11, 2009 6:36 AM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] about the bounding sphere of a geode computed by OSG

I cannot completely agree.

I mean that I know that the real perfect bounding sphere is computationally 
expensive, but in many cases (solid objects) it should be computed just once 
(since BoundingSphere node::getBound() checks if the bounding sphere has been 
already computed), when the object is created.
The global bounding sphere might affect the fitting operation a lot. In case of 
objects like spheres or discs, the bounding sphere computed by OSG might be 
much greater than strictly required.




-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Simon Hammett
Sent: martedì 11 agosto 2009 12.00
To: OpenSceneGraph Users
Subject: Re: [osg-users] about the bounding sphere of a geode computed by OSG

Calculating the perfect bounding sphere is an expensive operation.
You need to calc the convex hull which is O(n log n).
osg uses a fast approximation which is generally good enough.

2009/8/11 Gianluca Natale gianluca.nat...@adstorino.it:
 Hi All,
 I'm having problem computing the global bounding sphere of my model.
 I debugged OSG (2.8.0) and discovered that the bounding sphere of a 
 geode (BoundingSphere Geode::computeBound()) is computed as the 
 bounding sphere of the bounding box that includes all its drawables 
 !?!



 Why that?

 Shouldn't it be the global bounding sphere of the drawables, merging 
 the single bounding spheres of all the drawables?



 So, a drawable that represents a sphere should have as bounding sphere 
 itself, but this is not true with the computation OSG performs. It is 
 larger than strictly required.



 Thanks,
 Gianluca Natale



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





--
http://www.ssTk.co.uk
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.49/2295 - Release Date: 08/10/09 
18:19:00

___
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


Re: [osg-users] about the bounding sphere of a geode computed by OSG

2009-08-11 Thread Paul Martz

Gianluca Natale wrote:

I cannot completely agree.

I mean that I know that the real perfect bounding sphere is computationally
expensive,
but in many cases (solid objects) it should be computed just once
But in many other cases (dynamic geometry) it must be computed each 
frame. So it really does need to be very fast.


If you need a very tight bounding sphere, you could write your own 
NodeVisitor to create it. But changing OSG to compute and use tight 
bounding spheres throughout would be a formidable redesign that could 
take 2-4 engineering months to completely code and test, and while it 
might improve culling in some cases, it would also harm performance in 
other cases, so the net result would probably be a wash.

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