I have a Three.js Scene where I have a simple THREE.Mesh I call cube. I want to add a label to cube that always displays above cube (so in the positive y direction, given that y is up).
Therefor, the label should inherit the position of the cube, but not the rotation or scale. I want the label to always be same size relative to the camera I am looking through.
Given that I already have initialized cube, I now create the label:
var label = new THREE.Mesh(geometry, material);
label.position.set(0, 1, 0); // above cube
Then I add the label to the cube to inherit its position:
cube.add(label);
Fair enough. However, when I rotate or scale the cube, the label goes with it relative to the cube.
I would like the label to stay above the cube, remain the same size, ignore both rotation and scale, but inherit position of the cube.
How would I achieve this effect?