I am trying to pick meshes by pointer pick and then place a plane on the top of the mesh that I have picked. This is working well but apart from this I want to control the position of the added plane with a slider once the plane is locked to a surface.
Ideally, I want the plane to translate in the direction of its normal.
But the slider logic is seemingly wrong as I am doing too many translations!
Can you suggest a better way for a more intuitive slider-based dragging of the locked plane?
Hello and welcome to the Babylon community! What do you mean by “too many translations”? Do you mean the plane is moving too far when you move the slider?
The slider gets an initial value of the ‘d’ of the plane. That is the rest configuration of the plane.
Now when I am translating the value of the slider along the direction of the plane, the translations are getting compounded!
I’m not sure if a slider would be the best GUI element for your case? Moving a value on a slider implies increasing some value, but if you want the value to change a fixed time for each interaction, a button would make more sense.