Custom Transform Control doesn't follow mouse

I will try to work again on it
If I find a solution I will share it here

by user 224464722878005248

Typically gizmos are implemented like this:

  • on pointer down you define a plane or line for interactions based on what the raycast has hit
  • on pointer move you get the current point on that line or plane
  • you move or rotate the object based on the delta of that point to the frame before

Hellooo
I got news, think I find how
Here the code I started, from now it’s only tests with translation but it seems working. (I will work for rotation guizmo now)

You can change the arrow appearance, it works with every direction, you can change the translation scale and it’s calulated with the camera proximity and matrixWorld of the object to prevent for being children etc

Just a detail, I tried to randomized rotation of the parent + local position of my test object (cube) + rotation of my test object.
But if I try to do :
this.context.scene.add(parentObject);
parentObject.add(this.gameObject);

my pointer events doesn’t work anymore, do you know why ?
guizmoBehaviour.ts
customGizmo.ts

by user 224464722878005248

I tried to do the same with rotation gizmo but I’m not sure about the mouse following.

if you have a solution for better mouse traking for rotation gizmo
And this :

this.context.scene.add(parentObject);
parentObject.add(this.gameObject);

Which break the pointerEvent functions
guizmoBehaviour.ts
rotationGuizmoBehaviour.ts
customGizmo.ts

by user 224464722878005248