Projecting 3D to 2D (or use a Billboard?)

Now I have this question… I want to know how do I project points from 3D space to 2D space. There are lots of examples of how to make 2D -> 3D stuff with a ray and it works fine, but how to do the opposite? Probably there is some standard functionality for that, but I can’t find it…

And actually, what I’m trying to acheive - is to create something like tags for 3D objects, that is, simply text or another 2D sprite, attached to an object, and it always faces the camera. So it has to retain it’s size and always face the camera… I guess billboards would probably do here, but if so, how do I keep their size constant however the object moves?

The Camera object has the methods you are looking for =)

1 Like

yep, in particular

http://hub.jmonkeyengine.org/javadoc/com/jme3/renderer/Camera.html#getScreenCoordinates(com.jme3.math.Vector3f)

1 Like

Oh thanks! How could 've I been so missing… :slight_smile: BTW, I found that I better not use the BillBoards since their implications, so I’ll stick with GUI node and the projection stuff I think.