Upon examples, I knew there’s some way to project one point on screen’s (x, y) to ‘3d”s points. But I can’t figure out how to translate it back. Thanks for any clue.
4 thoughts on “unproject – How to get the real position on ‘screen(top, left)’ of specific 3d object?”
Comments are closed.
Yeah,
camera.matrix
needs to be replaced now withcamera.matrixWorldInverse
.Try with this:
fine…yet mr doob himself put code, so what gives?
Incase anyone still needs this after upgrading…
Ok, very old issue, but I had a nested object, which didn’t work with the above code.
My case was: I wanted the real x-and-y (and z) position for a nested object after rendering, so I adapted the above examples.
Please note:
The screen-z relative is between 0 and 1, relative to the front and back clipping planes of the camera/renderer and this works fine for my purposes (sorting).
and
typical call:
Just in case anyone runs into the same problem.