[quote]Eh? Snapping on a flat xy plane is dead easy, just something like:
[/quote]
Yes, drawing a snap of the current mouse position is easy.
But doing an interactive snapping GUI is not so easy :(. It’s easy to get something “that works” but it tends to be annoying to use.
For instance, when moving objects on a coarse grid, you do NOT want to “just render-snap” because then objects appear not to move for 100 pixels, then suddenly jump a massive distance.
Then the can of worms opens for how you’re going to mix snapping with smooth movement into one cohesive GUI. And it’s easy to get lost in the border-conditions for the snapping behaviour.
It’s even worse if you’re doing drag-n-drop, and to have to be careful about whether you’re measuring movement relative to the cursor start postiion or the object’s last partial snap etc. Funnily enough, if you reset the objects position to wherever you drop it then the GUI becomes VERY unresponsive; instead, you want to cache the last offset of the object when you dropped it, so that if e.g. you move object one pixel to left, causing it to jump left, you can let go and then pick it up and move it one pixel to the right instead of 100 pixels in order to make it jump to the right again.
Or…you just take into account mouse direction and guess where to preset the smooth co-ords to.
See? Gets complex…