Select the scaling controls in JS of the bounding box gizmo

Hello,

I’m a beginner in JS and on BabylonJS, here’s my project : playground demo
In which I’d like to calculate the remaining distance between the black frame and the white box so that I can completely fill the space in the frame without the white box protruding from the frame, and using only the scaling controls of the gizmo bounding box.

So my question is : Can I select each bounding box gizmo control separately in the code?

Then, when the black frame is completely filled by the white box, I would like to disable the controls of the bounding box gizmo (As if the black frame were my box’s enlargement limit)

The final step would be to automatically detect which control is selected in order to position the Ray in the direction of the scaling, this is why i need to detect which controls is selected to know in wich direction start the Ray.

Hi @max.t welcome to the forum
You should be able to use observable. It will be executed when drag ends. Then, you can query and set mesh properties, like size limitations.

1 Like