Hi, this might be a stupid question but... how do you get the dimensions (max width/length) of an imported model. (using Java3d)

Essentially, what I'm trying to do is draw a movable, resizable, and rotatable ellipse and keep it confined within a certain rectangular space - no parts of the ellipse must be outside of that space. That space has the same dimensions (width, length) as an imported model, but I don't know how to get that width/length...

The method that I've thought up of keeping that ellipse in the space, involves me knowing how much of that ellipse is outside of the rectangular space - so knowing whether or not it's completely inside the space alone after a transformation is not enough and hence the need for the width/length.

So can anyone provide me some info about finding the dimensions? Thanks

If you do a getBounds() on a Shape3D it wil lreturn an axis aligned bounding box for the geoemtry contained in the Shape3D.

BUT it gets compelx if your model is made of multiple Shape3DS. Usually a mdoel made of Multiple Shape3Ds has transforms that connect the shapes to allow for independant positionign and rotation. If you do getBounds() on a Transform that has a hape3D beneath it (what you get is a bouding SPHERE which is the area that could potentially be occupied by the shape3D in all possible rotational positions of the Transform.

AND it gets even mreo complex in that if you getBounds on a node with multiple transform children, what you get is the merged super-sphere of the sub bounding spheres.

Short answer is that, if your looking for the bounds of a complex object at one aprticualr state (eg rest state as loaded) you are going to have to doa getBOunds() on each shape3D and manually transform the results with the localToVWorld for each arm of the tree and then combine them yourself.

Have fun. I looked at this a few times and decided it was more work then I wanted to bother with.