Scalling doesn't change mesh volume

Hello everyone,
here’s playground I made Babylon.js Playground
How can it be changed to show the volume of the box when it’s being scaled + when I’m scalling the volume doesn’t change…
Thanks.

When you scale, it’s the scaling property of the mesh that is updated, not the bounding box extrema.

You should do something like this to compute the volume:

const meshVolume = x * y * z * mesh.scaling.x * mesh.scaling.y * mesh.scaling.z;
4 Likes

@Symlis
@Evgeni_Popov is too fast for me :slight_smile:

https://www.babylonjs-playground.com/#8KTH83#1

4 Likes

Thank you guys! :slight_smile:

I’m just not wondering now if there’s event listener for gizmo scalling. I can’t find it.