Justin Couch wrote:

Ralf Bednarz wrote:

i need to change the bounding object of a vrml file i loaded in my
scene.
originally it is a BoundingSphere, but i need a BoundingBox that fits
as good as possible.


That, unfortunately is a function of the way Java3D works. Even if you
provide a bound _box_ shape, when you query it back, you always get a
sphere.


Well, not always. If you would like to have a custom bounds, you should
call the method setBoundAutoCompute(false) BEFORE you set the bounds,
then it will return and use your custom bounds. If you do not do this
call, it will as Justin said always return and use a autogenerated Sphere.

But beware the node above will again return a autogenerated sphere even
though your node with the custom bounds is the only child. Also notice
that if you set setBoundAutoCompute(false) then getBounds will return
null, and this will make Java3D throw an exception like the one below,
and stop rendering, so always supply a bounds if auto is set to false:

java.lang.NullPointerException
       at
javax.media.j3d.GroupRetained.computeCombineBounds(GroupRetained.java:2403)
       at
javax.media.j3d.SwitchRetained.computeCombineBounds(SwitchRetained.java:623)
       at javax.media.j3d.GroupRetained.getBounds(GroupRetained.java:2423)
       at javax.media.j3d.Node.getBounds(Node.java:180)


Regards Nikolai

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to