13
votes

I've added some text to my scene with THREE.TextGeometry, and the text seems to be stuck in whichever xy plane I place it. Any way to have it adjust to always be in plane with the screen- readable for the user?

2

2 Answers

23
votes

Try

mesh.lookAt( camera.position );

The local z-axis of the mesh should then point toward the camera.

8
votes

To make the text always face the screen (rather than the camera):

mesh.quaternion.copy(camera.quaternion);

Note that this differs from object.lookAt(camera); since this will result in different orientation depending on where on the screen the object is located. Object3D.onBeforeRender can be used to update the orientation on each frame. It might be useful to disable frustum culling using Object3D.frustumCulled = false; to ensure that the callback always is triggered.