On 10/01/2013 09:42, Brent McPherson wrote:
Julian,

If I had to approach this in the tool SDK I would probably just store the 
relative mouse offset that was applied while shift-dragging and add this onto 
the input mouse position when not shift-dragging.

That way the spotlight position wouldn't jump or change when using 
shift-dragging. (because the offset would cancel out the effect of 
shift-dragging)

You should also consider sharing the source code so others can help you improve 
the tool.

Thanks Brent, that sounds good. I guess it would mean that once the user had done some Shift+LMB dragging the mouse cursor itself would no longer sit on the specular highlight but the OGL target point would?

Source is woefully ropey and unstructured at the moment:
https://dl.dropbox.com/u/69741069/jj_SpecularPlaceTool.0.5.source.rar

Lots of structural questions like whether for performance reasons it would be better to remove the GetGeometry() queries from MouseDrag and only renew/cache geometry when the object under the cursor has changed and, at the same time, setup Closest Location Queries with the relevant transforms on that change. Was getting a huge number of PointLocator errors with my initial attempts....so it all remains dumped in the MouseDrag function. I'm sure there are much, much better ways of doing it.
Julian


Reply via email to