Im struggling to achieve the translation widget in my own render engine. Funny enough I thought that widgets are easy, but boy was I wrong...
Where I am having problems:
- When my object's transform is nested (child) and I want to implement a local translation widget the mouseinput coordinates might become inverted, depending on the current orientation of the object. Example: rotate parent 180° (facing back to camera) and dragging the x axis in left mouse direction results in right motion. Expected: dragging the x axis in right mouse direction results in right motion no matter how the object is rotated.
- The motion becomes slow when I approach near perpendicular angles with the selected axis.
My implementation is based on: https://www.codeproject.com/Articles/35139/Interactive-Techniques-in-Three-dimensional-Scenes
I somehow think that I should use something else instead of the virtual planes at initial hitpoint of the raycast.
What's the best approach to implement a translation widget with local coordinates and mouse inputs for drag? I am using pure sharpdx for rendering and bulletsharp for the mouse picking / raytesting.