Getting height of an instance after it's been scaled or moved?

Hi all.
I’m trying to put one mesh instance directly on top of another. All works fine until I move one of the instances around. I think it’s using the position of the original mesh versus the instance itself. What am I missing?

https://www.babylonjs-playground.com/#0UJYJQ#5

thanks!

Hm, this seems to work in PG.
https://www.babylonjs-playground.com/#0UJYJQ#6

But not working in my app.
Scratch this thread for the moment…

1 Like

Aaha!
Found the problem… the source meshes that i was trying to stack were not placed consistently at 0,0… modifying in Blender should do the trick.

1 Like

Well, that was part of the problem. But not the whole problem.
Still getting inconsistent heights back from instances…
This doesn’t do the trick:

var vectorsWorld = meshcopy1.getBoundingInfo().boundingBox.vectorsWorld;
var height = Number(vectorsWorld[1].y-(vectorsWorld[0].y));

Also tried most of the values in getBoundingInfo().boundingBox including extendSize and extendSizeWorld…

Which is the height of an instance after it’s been scaled and repositioned???

center: e {x: 0.002282172441482544, y: 0.5767510123114334, z: -0.041341036558151245}
centerWorld: e {x: 2.040417584804084, y: 0.46744361572745297, z: 3.4565839613516207}
extendSize: e {x: 0.5718059837818146, y: 0.5771441273827804, z: 0.5878380239009857}
extendSizeWorld: e {x: 0.17154180195100288, y: 0.17314324509492826, z: 0.17635141417787104}
directions: (3) [e, e, e]
vectorsWorld: (8) [e, e, e, e, e, e, e, e]
minimumWorld: e {x: 1.868875782853081, y: 0.29430037063252473, z: 3.2802325471737497}
maximumWorld: e {x: 2.211959386755087, y: 0.6405868608223813, z: 3.6329353755294918}
minimum: e {x: -0.569523811340332, y: -0.0003931150713469833, z: -0.629179060459137}
maximum: e {x: 0.5740881562232971, y: 1.1538951396942139, z: 0.5464969873428345}

here’s a good example.
I’d think one of these would work! But they don’t:
https://www.babylonjs-playground.com/#0UJYJQ#11

Seems like it’s taking size from the instance before it was scaled.

pinging @PolygonalSun