From 9b9ed91e6e013d4be7b8ddee279ef7318e9048b3 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 7 Jan 2015 20:45:50 +0100 Subject: [PATCH] Nicer rendering for 3D slices --- lib/Slic3r/GUI/PreviewCanvas.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm index 325d39bc1..c0188edde 100644 --- a/lib/Slic3r/GUI/PreviewCanvas.pm +++ b/lib/Slic3r/GUI/PreviewCanvas.pm @@ -874,9 +874,13 @@ sub draw_volumes { glLineWidth(0); glColor3f(@{COLORS->[0]}); glBegin(GL_QUADS); - glNormal3f((map $_/$line->length, @{$line->normal}), 0); + # We'll use this for the middle normal when using 4 quads: + #my $xy_normal = $line->normal; + #$_xynormal->scale(1/$line->length); + glNormal3f(0,0,-1); glVertex3f((map unscale($_), @{$line->a}), $bottom_z); glVertex3f((map unscale($_), @{$line->b}), $bottom_z); + glNormal3f(0,0,1); glVertex3f((map unscale($_), @{$line->b}), $top_z); glVertex3f((map unscale($_), @{$line->a}), $top_z); glEnd();