the basic camera action is Yaw,Azimuth,Elevation,is it possible to rotate camera around like vector line [2,1,3]?
use vtkTransform can do it
transform_node = self.camera_node.GetParentTransformNode()
if not transform_node:
transform_node = util.AddNewNodeByNameByClass("vtkMRMLLinearTransformNode")
self.camera_node.SetAndObserveTransformNodeID(transform_node.GetID())
transform_node = self.camera_node.GetParentTransformNode()
modelToParentTransform = vtk.vtkMatrix4x4()
handleToWorldMatrix = vtk.vtkTransform()
handleToWorldMatrix.PostMultiply()
handleToWorldMatrix.Translate(-self.focus_point[0], -self.focus_point[1], -self.focus_point[2])
handleToWorldMatrix.RotateWXYZ(val,self.cemera_vector_normalized)
handleToWorldMatrix.Translate(self.focus_point)
modelToParentTransform.DeepCopy(handleToWorldMatrix.GetMatrix())
transform_node.SetMatrixTransformToParent(modelToParentTransform)