I am seeking Three.js code that can convert 3D object coordinates to 2D coordinates within a 'div' element, allowing me to place text labels in the correct positions without them scaling, moving, or rotating along with the 3D movement. Unfortunately, all the examples I have attempted thus far appear to employ outdated functions and techniques. Currently, I am working with version r69 of Three.js.
One example of an 'older' technique that consistently generates errors for me can be found here:
Three.js: converting 3d position to 2d screen position
In contrast, I recently discovered a snippet of what appears to be newer code, but due to lack of context, I have not been able to make it work effectively: