diff options
Improve mouse monitoring, add 3d view shift support
Diffstat (limited to 'utility/projection.py')
-rw-r--r-- | utility/projection.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utility/projection.py b/utility/projection.py index 335e488..1750fac 100644 --- a/utility/projection.py +++ b/utility/projection.py @@ -39,6 +39,13 @@ class Rotation: self.rotation_x = quaternion.Quaternion() self.update(x,z) + def shift(self, x, z): + self.matrix = numpy.matmul( + self.matrix, + matrix44.create_from_translation([x,0,z]) + ) + self.inverse_matrix = numpy.linalg.inv(self.matrix) + def update(self, x, z): rotation_x = quaternion.Quaternion(quaternion.create_from_eulers([x,0,0])) rotation_z = self.rotation_x.conjugate.cross( |