My application consists few hundreds of threejs box mesh moving randomly, each with different attributes (e.g. box id etc.). I would like to create an attribute label/tag for each box, and have these labels move along with the box it is associated with.
I tried to have this done by creating a text mesh using Text() constructor in troika-three-text, and group the text mesh with one of the box instances. But an error appears saying text mesh is not an Object3D, thus cannot be called for 'group' function. Similar error received when I tried to move the text mesh with .position.x/y/z function. According to documentation, it seems Troika text mesh can only be repositioned by accessing anchorX and anchorY properties, but how about movement in Z axis? Appreciate if I could have advise on the steps required to associate troika 3d text to a moving 3D object in threejs.
Thank you.