So I wrote a simple custom viewport camera manipulator in Python. It's working well, though certainly more expensive than the built-in camera manipulator..
However, while trying to figure out how things work, I wrote:
self.camera = self.view_port.defaultCamera() cam_xlate = hou.Vector3(self.camera.translation()) print (cam_xlate)
After some eyeballing, I realized the returned value was, in fact, the camera's pivot's world position plus the camera's position in its rotated local space w.r.t. its pivot. That is:
cam_xform = self.view_port.viewTransform().explode() #Actual world transformation of the camera pivot = hou.Vector3(self.camera.pivot()) print (cam_xlate == pivot + (cam_xform['translate'] - pivot) * self.camera.rotation()) # True
My question: adding a world-space vector and a local-space vector doesn't seem to make sense. Why is hou.GeometryViewportCamera.translation() returning these values? Is it some convention that I'm unaware of? Or is it just a bug?