Grid Snap tool in babylon js for proper wall construction

Viewed 174

I would like to implement a snap grid function in my pointer, but it seems when I zoom in or out, the grid distance changes. Is there a solution for this?

Here is the playground: https://playground.babylonjs.com/#VHW8N9#2

I created the grid using this

scene.pick(Math.round(scene.pointerX/100)*100, Math.round(scene.pointerY/100)*100)
1 Answers
Related