I thought that i have completed the 3d picking but after testing it few times ,i found that it is a little bit(too much) inaccurate.
i am using ray casting with bullet everything is ok with that, but the thing is i can't get the accurate 3d coordinates according to the mouse position on the viewing plan .
here's my code
i do the same thing for the topleft corner.
retInversePro() is returning inverse(view)*inverse(projection);
this much error i am having
(the white line just shows the box diagonal in the 3d world on the viewing plane,which shows the error the end of it should be within the cursor point but it is not)
The end of the white line shows the where mouse button is released.
and this is how i am storing the mouse position
i can also post code about how i am mapping the position of cursor (device coordinates ) to the NDC.
It would be a lot of help for me if someone could tell me what is going wrong.
Thanks in advance.