Hi Dominik,

On Wed, 2004-08-04 at 17:16, Dominik Rau wrote:
> Hi.
> I've got a VRML file with some (primitive) spheres that are needed for 
> obstacle avoidance in my project. How can I get the center and the 
> radius of these spheres in world coordinates? I thought about extending 
> an empty SphereVolume by a DynamicVolume that I get from every Node with 
> a GeometryCore, but that seems to be a bit complicated. Is there a 
> better way?

If you know that it's a sphere you can get center and radius from the
Node relatively easily (warning: untested code):

DynamicVolume world_vol;
node->getWorldVolume(world_vol);

Pnt3f  center = world_vol->getCenter();
Real32 radius = world_vol->getMax()[0] - center[0];


Your solution would give you bigger spheres, as the extend has to be
conservative.

Hope it helps

        Dirk




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to