How to scale the model's sub items on the Y-axis so that the model always stays close to the bottom, and how to calculate the difference between the model and the bottom of the model? thanks

How to scale the model’s sub items on the Y-axis so that the model always stays close to the bottom, and how to calculate the difference between the model and the bottom of the model? thanks


https://playground.babylonjs.com/#UVVJA7

Looks like the pivot is off in the mesh as scaling would move it even more:

The simplest is to rebuild/move it in 3d tools and reexport.

Other wise you can try adding an extra transform in the hierachy to offset it and finally you could use a pivot in Babylon.

1 Like

When scaling the sub item model, I tried the algorithm closely at the bottom of the model for a long time, but it still didn’t work. Can you give me some specific ideas or demos

As I mentioned you should either rely on the set pivot function or insert a new node in the hierarch if you can not update the mesh (despite this being the mist efficient way)