From ff0630cad2dd90f57b2a5aed8fcd18e0ff12d14f Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 21 May 2020 10:22:25 +0200 Subject: [PATCH] FDM supports gizmo: fixed rendering on mirrored objects --- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 9c5e5ebe8..e90f76fc4 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -120,6 +120,10 @@ void GLGizmoFdmSupports::render_triangles(const Selection& selection) const mo->instances[selection.get_instance_idx()]->get_transformation().get_matrix() * mv->get_matrix(); + bool is_left_handed = trafo_matrix.matrix().determinant() < 0.; + if (is_left_handed) + glsafe(::glFrontFace(GL_CW)); + glsafe(::glPushMatrix()); glsafe(::glMultMatrixd(trafo_matrix.data())); @@ -130,6 +134,8 @@ void GLGizmoFdmSupports::render_triangles(const Selection& selection) const iva.render(); } glsafe(::glPopMatrix()); + if (is_left_handed) + glsafe(::glFrontFace(GL_CCW)); } if (clipping_plane_active) glsafe(::glDisable(GL_CLIP_PLANE0));