How to set 3d geometry position by 2d screen pos?

From Three.js Aligning HTML Elements to 3D
I had learned how to set html element pos from geometry position.
But how do I do the opposite way, which I mean(for example):
I have a canvas width is 800 height is 600, then I need to put a 3d box to the left side,
eg, (0, 100) , how can I make it the right way?
the short question is : input a 2d pos (x,y) and camera info, can I get the 3d pos (x1,y1,z1) ?

Try it with Vector3.unproject(). Use the first lines from the following answer at stackoverflow:

1 Like

Thanks you! I had read the question before and realize the key is ‘unproject’ but still feel confused…I’ll try to spend more time to learn it :smile:

1 Like