I have SetDefaultTypeOfView ( V3d_PERSPECTIVE ) in a Viewer,But I don't How to get the x,y,z Co-ordinate from mouse pointer's position in OCC Perspective Screen?
Venugopal Gudimetla Thu, 01/06/2011 - 18:02
Hi were you able to figure out? right now I am trying to switch between perspective view and orthographic views and also would like transform user mouse clicks to x,yz coordinates in perspective view exactly like the problem you have. Could you or anyone who figured out please help?
The Convert() method of the V3d_View class provide a set of tools to go from 2D to 3D (or the opposite). Have a look at the V3d_View.hxx header file in order to check available function prototypes. For instance :
"""
//! Converts the projected point into a point
//! in the reference frame of the view corresponding
//! to the intersection with the projection plane
//! of the eye/view point vector.
Standard_EXPORT void Convert(const Standard_Integer Xp,const Standard_Integer Yp,V3d_Coordinate& X,V3d_Coordinate& Y,V3d_Coordinate& Z) const;
"""
Thu, 01/06/2011 - 18:02
Hi were you able to figure out? right now I am trying to switch between perspective view and orthographic views and also would like transform user mouse clicks to x,yz coordinates in perspective view exactly like the problem you have. Could you or anyone who figured out please help?
Thanks,
Venu
Fri, 01/07/2011 - 08:41
The Convert() method of the V3d_View class provide a set of tools to go from 2D to 3D (or the opposite). Have a look at the V3d_View.hxx header file in order to check available function prototypes. For instance :
"""
//! Converts the projected point into a point
//! in the reference frame of the view corresponding
//! to the intersection with the projection plane
//! of the eye/view point vector.
Standard_EXPORT void Convert(const Standard_Integer Xp,const Standard_Integer Yp,V3d_Coordinate& X,V3d_Coordinate& Y,V3d_Coordinate& Z) const;
"""
Thomas
Fri, 01/07/2011 - 17:28
Hi Thomas, Thanks for showing me a direction, I will try that out and will post my findings for further direction if any.
Thanks,
Venu
Sun, 01/09/2011 - 05:10
Little more digging after what Thomas said pointed me to ConvertClickToPoint function which transforms a mouse point to 3D point in perspective view.
Thanks,
Venu