- Home /
Convert from Image plane to World plane. Inverse perspective Mapping
Hi, I have a scene in which I have attached a camera on a mobile robot. Camera provides perspective view in display. Now I have written a script that allows me to draw on the display using mouse and trace a line in pixel coordinates. What I want to do is to convert these pixel coordinates to point to actual place in world coordinates i.e inverse perspective mapping. I have tried a lot of answers and tried available methods screen to world point and ray casting but I am not getting desired results.
Answer by zainmedhi · Oct 20, 2017 at 01:49 AM
I am a bit disappointed here with the community as no one bothered to help me out here. I found the answer however and answering my own question in case it helps someone. I couldnt figure out a way to carry out IPM in unity but there is another way more accurate way. I used raycasting. It allos us to project a beam from camera center and gives the point where it intersects the first rigid body. Its very much like inverse pinhole camera model. So in order to map from image plane to world coordinates we just need to project a ray from camera to the coordinate mouse pixel position is pointing. link text provides more details
Your answer
![](https://koobas.hobune.stream/wayback/20220612140858im_/https://answers.unity.com/themes/thub/images/avi.jpg)