Java 3d Object size

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Java 3d Object size

Denis
Hello.

I need to know object relative size of objects in my 3d Scene.

My actions is:
 1. Loadin model for *.obj file
       obj = new TransformGroup();
       Scene s = null;
       ObjectFile f = new ObjectFile ();
       f.setFlags (ObjectFile.RESIZE | ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY);
       try{ s = f.load (model+".obj"); }catch(Exception ex) { ex.printStackTrace(); }
       obj.addChild(s.getSceneGroup());
       obj.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

 2. Create BranchGroup
       BranchGroup objRoot = new BranchGroup();
       
 3. Add model to a branch group
      objRoot.addChild(obj);

Questions:
1. How can i detect object size after load from file? (Step 1)
2. How can i detect object size after add to BranchGroup? (Step 3)
3. How can i find designed center of my 3d object? Mean that center of object can be placed in some other place, like in some corner (if it's a rectangled box), but not in the center of geometric object placed inside that object.