I'm trying to convert the mouse coordinates into 3d world coardinates. I have checked all the topics on the forum regarding to this area, but neither solution is working correctly in my case. I would like to compute the coordinates of a point - pointed by the mouse - on a given plane. For example the plane is gp_Pln(gp_Pnt(0,0,0), gp_Dir(0,1,0)) - the xz plane through the origo - and I would like to get the coordinates pointed by the mouse on this plane.
I tried the following:
- get the coordinates on the projection plane with v3d_View::Convert
- created a line through the eye point the the point on the projection plane
- computed the intersection of this line and the xz plane.
but the results are totally wrong.
Does anyone have any idea what's wrong in this logic?
Thanks in advance,