diff --git a/CHANGELOG.md b/CHANGELOG.md index f584dac82..2ed89b821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed `GroupObject` `pointcolor` not found error with impliment `exclude_type_list`. * Fixed `Tag` inconsistent height issue. +* Dynamically adjust camera pan delta based on distacne. ### Removed diff --git a/src/compas_viewer/renderer/camera.py b/src/compas_viewer/renderer/camera.py index 0fd8303b5..31bd94c55 100644 --- a/src/compas_viewer/renderer/camera.py +++ b/src/compas_viewer/renderer/camera.py @@ -356,7 +356,8 @@ def pan(self, dx: float, dy: float): with each increment the size of :attr:`Camera.pan_delta`. """ R = Rotation.from_euler_angles(self.rotation) - T = Translation.from_vector([-dx * self.pandelta * self.scale, dy * self.pandelta * self.scale, 0]) + scaled_pandelta = self.pandelta * self.distance / 10 + T = Translation.from_vector([-dx * scaled_pandelta, dy * scaled_pandelta, 0]) M = (R * T).matrix vector = [M[i][3] for i in range(3)] self.target += vector