Open gborangecat opened 4 years ago
Sorry to revive an old thread, but felt it was better than creating another with the same topic.
I am also looking to manipulate a camera in pythonocc. I want to make an orbit camera:
My approach is to make a new qtViewer class redefining the mousePressEvent, mouseMoveEvent, and mouseReleaseEvent functions. I can work out the math for it later, but I'm struggling to find the right method to rotate around a specific axis, not the view's up axis.
I think the info is on OpenCascade's codebase, specifically: v3d_view & Rotate The issue is I don't know how to reference the V3d_TypeOfAxe listed as a possible parameter. I've found it under src/SWIG_files/wrapper/V3d.pyi
So, am I on the right track? Am I right that if I can somehow use the v3dTypeOfAxe->V3d_Y I could rotate around the upwards axis? If so, how so I turn self._display_View.Turn() in this way?
I don't know about the V3d_TypeOfAxe
param of the camera, I've never had to use it, same for the Turn
method.
Note that the rotation is defined in the OCCViewer class, see https://github.com/tpaviot/pythonocc-core/blob/master/src/Display/OCCViewer.py#L679
Yes, but I think that's based off the view's position in the scene. I wanted to rotate around an axis regardless of that.
I'm having limited success with using SetEye by using mouse y change the z setting. It's adding the tilt I was looking for. But I can't seem to combine it with the mouse x
I am working on a project about 6D object pose estimation, in which I need to generate a couple of CAD model templates from different perspectives, e.g. taking samples by placing camera in 0-180° yaw/pitch angle around and 10mm-1000mm distance from the model. By capturing the model templates I can proceed my project to template matching, and then use the information of templates to estimate the real pose of object in real-world camera. Now I have already had the stp file of the object, and I can read it and display it in pythonocc. I searched for tutorials about pythonocc but I cannot find a detailed description to manipulate the camera. The only related example I found is in "pythonocc-demos-master/pythonocc-demos-master/examples/core_visualization_camera.py".
I got confused by the code. So I would like to raise an issue about this question. Can anyone show me how to manipulate the camera in pythonocc?