I am using OCCT 7.1 and Qt5.6.
I would like to display a Widget at a specific coordinate (2d). I use a QtWidget that a i move with 2d coordinate.
The position of the widget is computed from the position of an AIS_InteractiveObject displayed in the view. So i have to convert the 3d position of the interactive object into 2d screen coordinate. It's like making a projection of the 3d object from world coordinate to screen coordinate.
I found in occ sources this code
Handle(V3d_View) myV3dView = ...;
Standard_Integer p2dX p2dY;
I think this code convert a 3d world coordinate into screen coordinate. I search on the internet and this solution seems to be ok. But my result is not ok.
Asume that the AIS_InteractiveObject is the representation of a point.
If the AIS_InteractiveObject 3d position is visible in the view, i think i can get the projected 2d screen coordinate of this position.
The 2d point must be :
0 < pnt2dX < viewWidth
0 < pnt2dY < viewHeigth
I dont get good result. For the same 3d position, if i change the zoomFactor (myView->SetZoom(...) ), i dont get the same 2d position.
What am i doing wrong ? Can you help me ?