@@ -825,15 +825,24 @@ static protected void copyGeometry(PShape src, PShape dest) {
825825 for (int i = 0 ; i < src .vertexCount ; i ++) {
826826 float [] vert = src .vertices [i ];
827827
828- // Do we need to copy these as well?
829- // s.ambient(vert[AR] * 255, vert[AG] * 255, vert[AB] * 255);
830- // s.specular(vert[SPR] * 255, vert[SPG] * 255, vert[SPB] * 255);
831- // s.emissive(vert[ER] * 255, vert[EG] * 255, vert[EB] * 255);
832- // s.shininess(vert[SHINE]);
833-
834- dest .normal (vert [PGraphics .NX ],
835- vert [PGraphics .NY ],
836- vert [PGraphics .NZ ]);
828+ dest .fill (vert [PGraphics .R ] * 255 ,
829+ vert [PGraphics .G ] * 255 ,
830+ vert [PGraphics .B ] * 255 ,
831+ vert [PGraphics .A ] * 255 );
832+
833+ // Do we need to copy these as well?
834+ // dest.ambient(vert[PGraphics.AR] * 255, vert[PGraphics.AG] * 255, vert[PGraphics.AB] * 255);
835+ // dest.specular(vert[PGraphics.SPR] * 255, vert[PGraphics.SPG] * 255, vert[PGraphics.SPB] * 255);
836+ // dest.emissive(vert[PGraphics.ER] * 255, vert[PGraphics.EG] * 255, vert[PGraphics.EB] * 255);
837+ // dest.shininess(vert[PGraphics.SHINE]);
838+
839+ if (0 < PApplet .dist (vert [PGraphics .NX ],
840+ vert [PGraphics .NY ],
841+ vert [PGraphics .NZ ], 0 , 0 , 0 )) {
842+ dest .normal (vert [PGraphics .NX ],
843+ vert [PGraphics .NY ],
844+ vert [PGraphics .NZ ]);
845+ }
837846 dest .vertex (vert [X ], vert [Y ], vert [Z ],
838847 vert [PGraphics .U ],
839848 vert [PGraphics .V ]);
0 commit comments