Hi , I need to place a book on a table, so that, after projection, the book appears in the given screen position (xs, ys).
I already know the yw (y world coordinate) the book must have, and I need to find the xw and zw.
I also know xs and ys, the screen coordinates where the book must appear after projection.
In other words, I need to find xw and zw such that (xw, yw, zw) after projection becomes (xs, ys).
yw, xs and ys are known.
I don’t think I can use Camera.ScreenToWorldPoint because I don’t know the distance from the camera. This is what I need to find ![]()
Could someone kindly explain how to find xw and zw? Thank you
I have a tip here: Using Camera.ScreenToRay method, you can convert your screen position into a ray you can then use with Physics.Raycast, to cast against your table.This will result in a world point on that table, matching your xs and ys, because the ray was fired straight out. Put the book there and voila.
– hexagonius