Fix panning for off-center frame

This commit is contained in:
Grant Sanderson
2023-01-28 23:05:52 -08:00
parent e58aea9e2f
commit abdcb64461

View File

@ -814,7 +814,7 @@ class Scene(object):
frame = self.camera.frame
# Handle perspective changes
if self.window.is_key_pressed(ord(PAN_3D_KEY)):
ff_d_point = frame.to_fixed_frame_point(d_point)
ff_d_point = np.dot(d_point, frame.get_view_matrix()[:3, :3].T)
ff_d_point *= self.pan_sensitivity
frame.increment_theta(-ff_d_point[0])
frame.increment_phi(ff_d_point[1])