@@ -217,7 +217,7 @@ sub PDL::Graphics::TriD::Triangles::gdraw {
217217 my $tmpn = $shading <= 2 ? undef : $options -> {Smooth }
218218 ? $this -> {VertexNormals }-> dice_axis(1,$this -> {Faceidx }-> flat)
219219 -> splitdim(1,$this -> {Faceidx }-> dim(0)) : $this -> {FaceNormals }-> dummy(1,3);
220- $f -> ($points -> dice_axis(1,$this -> {Faceidx })-> splitdim(1,3), $shading > 2 ? $tmpn : (), $colours );
220+ $f -> ($points -> dice_axis(1,$this -> {Faceidx }-> flat )-> splitdim(1,3), $shading > 2 ? $tmpn : (), $colours );
221221 if ($shading > 2) { glDisable(GL_COLOR_MATERIAL); }
222222}
223223
@@ -259,16 +259,6 @@ sub PDL::Graphics::TriD::Trigrid::gdraw {
259259 my $faces = $points -> dice_axis(1,$this -> {Faceidx }-> flat)-> splitdim(1,3);
260260 my $colours = $this -> {Colors }-> dice_axis(1,$this -> {Faceidx }-> flat)-> splitdim(1,3);
261261 my $options = $this -> {Options };
262- glShadeModel(GL_SMOOTH); # By-vertex doesn't make sense otherwise.
263- my $f = ' PDL::gl_triangles' ;
264- $f .= ' _wn' if $options -> {Shading };
265- { no strict ' refs' ; $f = \&$f ; }
266- my $tmpn = !$options -> {Shading } ? undef : $options -> {Smooth }
267- ? $this -> {VertexNormals }-> dice_axis(1,$this -> {Faceidx }-> flat)
268- -> splitdim(1,$this -> {Faceidx }-> dim(0)) : $this -> {FaceNormals }-> dummy(1,3);
269- if ($options -> {Shading }) { glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE); glEnable(GL_COLOR_MATERIAL); }
270- $f -> ($faces , $options -> {Shading } ? $tmpn : (), $colours );
271- if ($options -> {Shading }) { glDisable(GL_COLOR_MATERIAL); }
272262 if ($options -> {ShowNormals }) {
273263 die " No normals to show!" if !grep defined $this -> {$_ }, qw( FaceNormals VertexNormals) ;
274264 if (defined $this -> {VertexNormals }) {
0 commit comments