From bb3ebb02449c270766319f7a4c03b8d86f7610dd Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Sat, 29 Jun 2013 10:43:35 +0200 Subject: [PATCH] Switch to orthographic projection --- lib/Slic3r/GUI/PreviewCanvas.pm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm index dd3af6982..615e29b15 100644 --- a/lib/Slic3r/GUI/PreviewCanvas.pm +++ b/lib/Slic3r/GUI/PreviewCanvas.pm @@ -87,22 +87,11 @@ sub Resize { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - my_gluPerspective(45, $x/$y, .5, 100); + glOrtho(-$x/2, $x/2, -$y/2, $y/2, 0.5, 100); glMatrixMode(GL_MODELVIEW); } -sub my_gluPerspective { - my ($fov, $ratio, $near, $far) = @_; - - my $top = tan(deg2rad($fov)*0.5) * $near; - my $bottom = -$top; - my $left = $ratio * $bottom; - my $right = $ratio * $top; - - glFrustum( $left, $right, $bottom, $top, $near, $far ); -} - sub DESTROY { my $self = shift;