diff options
Diffstat (limited to 'boltzgas/visual')
-rw-r--r-- | boltzgas/visual/camera.py | 16 | ||||
-rw-r--r-- | boltzgas/visual/view.py | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/boltzgas/visual/camera.py b/boltzgas/visual/camera.py index 44831f4..2bfbc1d 100644 --- a/boltzgas/visual/camera.py +++ b/boltzgas/visual/camera.py @@ -42,27 +42,27 @@ class Projection: return self.matrix class Rotation: - def __init__(self, shift, x = np.pi, z = np.pi): + def __init__(self, shift, x = np.pi, y = np.pi): self.matrix = matrix44.create_from_translation(shift), self.rotation_x = quaternion.Quaternion() - self.update(x,z) + self.update(x,y) - def shift(self, x, z): + def shift(self, x, y): self.matrix = np.matmul( self.matrix, - matrix44.create_from_translation([x,0,z]) + matrix44.create_from_translation([x,y,0]) ) self.inverse_matrix = np.linalg.inv(self.matrix) - def update(self, x, z): + def update(self, x, y): rotation_x = quaternion.Quaternion(quaternion.create_from_eulers([x,0,0])) - rotation_z = self.rotation_x.conjugate.cross( - quaternion.Quaternion(quaternion.create_from_eulers([0,0,z]))) + rotation_y = self.rotation_x.conjugate.cross( + quaternion.Quaternion(quaternion.create_from_eulers([0,y,0]))) self.rotation_x = self.rotation_x.cross(rotation_x) self.matrix = np.matmul( self.matrix, - matrix44.create_from_quaternion(rotation_z.cross(self.rotation_x)) + matrix44.create_from_quaternion(rotation_y.cross(self.rotation_x)) ) self.inverse_matrix = np.linalg.inv(self.matrix) diff --git a/boltzgas/visual/view.py b/boltzgas/visual/view.py index b4c1acd..bdc18e8 100644 --- a/boltzgas/visual/view.py +++ b/boltzgas/visual/view.py @@ -125,8 +125,8 @@ class View: self.particle_shader = Shader(*particle_shader) self.decoration_shader = Shader(*decoration_shader) - self.camera_projection = Projection(distance = 6) - self.camera_rotation = Rotation([-1/2, -1/2, -1/2]) + self.camera_projection = Projection(distance = 5) + self.camera_rotation = Rotation([-1/2, -1/2, -1/2], np.pi/2, 0) self.camera_pos = np.matmul([0,-self.camera_projection.distance,0,1], self.camera_rotation.get_inverse()) self.mouse_monitors = [ |