Skip to main content

? Get the Size of our object (loaded from file .obj)

5 replies [Last post]
mydreams
Offline
Joined: 2006-02-16

I've loaded an .obj file (a file created by 3DSMax)as in this code:

ObjectFile objFile = new ObjectFile(ObjectFile.RESIZE, (float)(180.0 * Math.PI / 180.0));
Scene scnPlane = null;
try {
scnPlane = objFile.load(objMap);
}
catch (Exception e) {
System.err.println(e);
System.exit(1);
}
tgTranslatePlane.addChild(scnPlane.getSceneGroup());

and I want to get the size of this object, but I can't find a method to do this,
it's nice to have your help plz!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mydreams
Offline
Joined: 2006-02-16

I solved my problem

otelo
Offline
Joined: 2005-09-14

Node.getBounds() ?

mydreams
Offline
Joined: 2006-02-16

I've tried it, but I don't know what fields of javax.media.j3d.Bounds are?
I saw the methods of that but I stil don't know which method to give me the exactly size (ex: 128, 256)is.
:(

messengers
Offline
Joined: 2004-04-18

[code]
Bounds bounds = node.getBounds();
BoundingBox bBox = new BoundingBox(bounds);
Point3D upper = new Point3D();
Point3D lower = new Point3D();
bBox.getUpper(upper);//returns the point at the upper corner of the bBox
bBox.getLower(lower);//returns the point at the lower corner of the bBox
[/code]
regards

mydreams
Offline
Joined: 2006-02-16

thank you so much! :)