Clicking bug when panning (+ Rotation algorithm)
I’ve laid out my bungalow and garden successfully – impressed by the wall placement and happy with the object library.
1) The background grid doesn’t extend as far as the extents of my objects (or my land exceeds the given grid-size).
2) The rotation is impressively fast but one small adjustment can make a HUGE improvement to the GUI. First, the bug: zoom in, then use the arrow-keys to pan. I wanted to check out a small shelf in my bathroom to see if it needed rotation. Turns out I couldn’t see it – however I rotate, the room is clipped once I pan. In other words, the clipping isn’t accounting for the panning.
Anyway – over to the awesome way of 3D rotation (once you’ve felt it, no other way is good enough). You already have code to know what is under the mouse (for setting the colour of walls on double-click, for example). When the user starts a rotation, get the 3D point of whatever is under the mouse and set that as the rotation centre (and view centre for clipping).
Imagine looking at a long rod (perhaps a walking stick) using a 3D view. There is a fine engraving on the handle, rotate the walking stick so that you can work on the tip to add the text engraving. Anything that rotates about the origin or centre of the world will be useless for this. Rotate about the point the user clicks on and it is easy to stay looking at the end of the walking stick and to change ends, just click on a visible part near the other end.
If the user clicks and there is no object under the mouse, use the last rotation point. Usually in your application the floor will be under the mouse if no object is, but it is still possible in horizontal views to click on nothing (sky or very distant ground). I would define the floor clicks as being ‘within the bounds of the existing geometry’.
Awesome free site/app Thanks very much, I hope my tip helps you improve it (and most of all I hope you fix the clipping so I can see my shelf ;-)
RSS Feed for this topic