Adding annotations (or markers) dynamically after rotating an object

Hey guys. :wave:

I need some help from the three.js community. I faced with a problem with dynamically adding annotations to the surface of an object that has been rotated using Transform Controls.

  1. The user clicks on the surface of an object.
  2. The annotation is drawn, which is pinned to the surface of the object.
  3. The user rotates the object with the annotation pinned to it, following the pin point.
  4. The user adds the annotation again on the other side of the object.
  5. All added annotations rotate with the object.

Code: inspiring-currying-4n36vk - CodeSandbox

1 Like

You are rotating the group containing the BoxHelper, the annotations are outside that group, that’s why the rotation is no affecting them. Try to move your annotations inside the group.

Thanks @Fennec for the answer.
I have moved the annotation rendering logic to the group that contains the box for annotations. But I still have a position issue after clicking on the rotated box surface.

Maybe you know how to get the correct position of the intersection after clicking on the Box surface?