From 70c032868ae8f8bc9a12cc94a700d6d0ef32ce5d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 1 Mar 2015 19:58:05 +0100 Subject: [PATCH] Prevent OpenGL scene from Z clipping --- lib/Slic3r/GUI/3DScene.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index eb35a2d31..794de1fc1 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -588,9 +588,10 @@ sub Resize { glMatrixMode(GL_PROJECTION); glLoadIdentity(); + my $depth = 10 * max(@{ $self->max_bounding_box->size }); glOrtho( -$x/2, $x/2, -$y/2, $y/2, - -200, 10 * max(@{ $self->max_bounding_box->size }), + -$depth, 2*$depth, ); glMatrixMode(GL_MODELVIEW);