aboutsummaryrefslogtreecommitdiff
path: root/utility/projection.py
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-10-08 20:55:57 +0200
committerAdrian Kummerlaender2019-10-08 20:55:57 +0200
commit850a3ac48046e3630524c67ecac5e2f26d499b3f (patch)
treea2744f67a12a7d8f9cd0689cfecf935f655b1362 /utility/projection.py
parent5c55995cbaedbeb0f6b9ee0ce9f3e69daaf02119 (diff)
downloadsymlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar.gz
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar.bz2
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar.lz
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar.xz
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.tar.zst
symlbm_playground-850a3ac48046e3630524c67ecac5e2f26d499b3f.zip
Improve mouse monitoring, add 3d view shift support
Diffstat (limited to 'utility/projection.py')
-rw-r--r--utility/projection.py7
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(