Programmer_D Programmer_D - 3 months ago 14
Javascript Question

Three.js - Create 3D text that's unaffected by zooming and panning

Three.js version: r79

Basically, I want to have a 3D object (a mesh created with THREE.TextGeometry) act like it's in 2D space but is always in the same exact place on the screen (never moves with the camera, no matter if I zoom or pan). Is there a way to do this?

I'm actually not quite sure how unless I make what I feel is a giant hack and update the coordinates of the text mesh every time there is a mouse scroll event or pan event.


One solution is to add the mesh as a child of the camera.

scene.add( camera ); // required, since the camera has a child
camera.add( mesh );
mesh.position.set( 0, 0, - 100 ); // or whatever

three.js r.79