0
\$\begingroup\$

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...

What I want to implement: blender translation widget

Where I am having problems:

  1. 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.
    1. 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.

\$\endgroup\$
  • \$\begingroup\$ Does this previous Q&A on implementing these gizmos in OpenGL give you some leads? \$\endgroup\$ – DMGregory May 30 at 2:41
  • \$\begingroup\$ Hi, it gives me some leads and confirms my thoughts about the complexity of a solid implementation. I will look into projecting the infinitely long line to screenspace and measure the distance delta of the movie movement... but I don't know how to solve the problem when my axis is rotated on it's head and the movement gets flipped \$\endgroup\$ – D3d_dev May 30 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.