diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-06-13 09:38:49 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-06-13 09:38:49 +0300 |
commit | 7bfb0aaac0a8f6ba257610a12347247a6621dbb8 (patch) | |
tree | e943ca0ce53e9cc937656e3453332eedac264e14 /src | |
parent | abdb5c5d742f17457f5fe0bec572f1fa668e6344 (diff) |
Fixed method Camera::get_dir_forward()
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/Camera.hpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Camera.hpp b/src/slic3r/GUI/Camera.hpp index 6e1b539ab..adb148807 100644 --- a/src/slic3r/GUI/Camera.hpp +++ b/src/slic3r/GUI/Camera.hpp @@ -56,7 +56,7 @@ public: Vec3d get_dir_right() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(0); } Vec3d get_dir_up() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(1); } - Vec3d get_dir_forward() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(2); } + Vec3d get_dir_forward() const { return -m_view_matrix.matrix().block(0, 0, 3, 3).row(2); } Vec3d get_position() const { return m_view_matrix.matrix().block(0, 3, 3, 1); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index d118a6877..72db3a9dd 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -550,7 +550,7 @@ bool GLGizmoSlaSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous const Selection& selection = m_parent.get_selection(); const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin()); const Transform3d& instance_matrix_no_translation_no_scaling = volume->get_instance_transformation().get_matrix(true,false,true); - Vec3f direction_to_camera = camera.get_dir_forward().cast<float>(); + Vec3f direction_to_camera = -camera.get_dir_forward().cast<float>(); Vec3f direction_to_camera_mesh = (instance_matrix_no_translation_no_scaling.inverse().cast<float>() * direction_to_camera).normalized().eval(); Vec3f scaling = volume->get_instance_scaling_factor().cast<float>(); direction_to_camera_mesh = Vec3f(direction_to_camera_mesh(0)*scaling(0), direction_to_camera_mesh(1)*scaling(1), direction_to_camera_mesh(2)*scaling(2)); |