From 0420d76037640f3ddc799f4c8dda776e460ad91a Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 10 Dec 2018 16:09:20 +0100 Subject: [PATCH] Fixed rotation of volumes contained in rotated instances --- src/slic3r/GUI/GLCanvas3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 721969fa55..5df8c61c0a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1531,7 +1531,8 @@ void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local) #if ENABLE_WORLD_ROTATIONS { Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation); - Vec3d new_rotation = Geometry::extract_euler_angles(m * m_cache.volumes_data[i].get_volume_rotation_matrix()); + const Transform3d& inst_m = m_cache.volumes_data[i].get_instance_rotation_matrix(); + Vec3d new_rotation = Geometry::extract_euler_angles(inst_m.inverse() * m * inst_m * m_cache.volumes_data[i].get_volume_rotation_matrix()); (*m_volumes)[i]->set_volume_rotation(new_rotation); } #else