Ok so theoretically if the center is 0,0,0, the lower value of the meshes bounding box should be the offset. I tried that but I'm still needing a corrective offset.
I can't seem to figure out a trending value to use. I'm guessing that calcBoundingBox() is not calculating the boundary exactly at the lowest vertex for performance reasons perhaps.
OBJECT 1
--------
Scale = 40f
Center = 0,0,0
LowerBoundingBox = -77
UpperBoundingBox = 50
Wants Offset = -10
Mesh BoundingBox 0 = -62.069466 1=51.452503 2=-33.44815 3=9.098154 4=-78.36731 5=49.07093
Scale = 80f
Center = 0,0,0
LowerBoundingBox = -67
UpperBoundingBox = 18
Wants Offset = -20
Mesh BoundingBox 0 = -124.13893 1=102.90501 2=-66.8963 3=18.196308 4=-156.73462 5=98.14186
OBJECT 2
--------
Scale = 95f
Center = 0,0,0
LowerBoundingBox = -550
UpperBoundingBox = -9
Wants Offset = 10
Mesh BoundingBox 0 = -80.026985 1=96.586525 2=-550.9481 3=-9.235985 4=-89.274704 5=144.33151
Scale = 35f
Center = 0,0,0
LowerBoundingBox = -202
UpperBoundingBox = -3.4
Wants Offset = 5
Mesh BoundingBox 0 = -29.483627 1=35.58451 2=-202.98088 3=-3.4027314 4=-32.890682 5=53.17477
By the way, there is no scaling being done loading the 3D file, there are no axis rotations (all objects point up natively), there are no animations.
obj = Object3D.mergeAll(Loader.load3DS(myContext.getResources().openRawResource(R.raw.obj7), 40f));
//obj.calcCenter();
//obj.getMesh().compress();
obj.calcBoundingBox();
obj.setTexture("obj7tex");
obj.setSpecularLighting(true);
obj.compile();
//obj.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
world.addObject(obj);
obj.translate(mainArea.getRandomPos());
ObjectToGroundAuto(obj);
The offset seems to follow the scale so I may just calculate the offset manually at scale 100f, then scale that master offset in ratio when scaling the cloned objects.