[vtkusers] Camera Inverting Issue when Locking Z

Stuart, Travis t.stuart at dautomation.com
Fri Jan 4 11:14:01 EST 2019


Hi,
I'm able to lock the Z axis always upwards when interacting with my camera via the code below. However, when moving the camera so that it's looking directly above or below the scene, the display will flip back and forth inverting.

Do you know of a better way to lock the Z axis or how can I prevent the camera from getting too close to being directly above or below the scene?

class Interactor(vtk.vtkInteractorStyleMultiTouchCamera):
    def __init__(self):
        self.AddObserver("MouseMoveEvent", self.on_mouse_move)


    def on_mouse_move(self, obj, event):
        camera = vtk_renderer.GetActiveCamera()
        camera.SetViewUp(0, 0, 1)

        self.OnMouseMove()

Regards,
Travis Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190104/822cffee/attachment.html>


More information about the vtkusers mailing list