you can read the project of mayo sourcecode
Archived discussion
Issue with ViewCube
Just testing GLFW sample code that ships with OpenCascade. I tried adding ViewCube to that code by just adding two lines in GlfwOcctView::initViewer()
// Create interactive context myContext = new AIS_InteractiveContext (aViewer); Handle(AIS_ViewCube) aViewCube = new AIS_ViewCube(); myContext->Display(aViewCube, 0, 0, false);
Cube works but there is an issue that mouse hover and click are offset, though primitives (box and sphere) are registering hover in clicks correctly. Also it looks like that view cube is effected by the scene light, not sure if thats expected.
Discussion
3 archived replies
Posts are displayed in their archived order.
Mayo is using QT not GLFW.
I met similar issue using qt. It is caused by Screen scaling resulting in inconsistent physical and logical resolutions. And the mouse position in the view is not at where the actual mouse is. Maybe you can try to override the mouse event function and multiply the mouse position by the scaling ratio.