From f6574c7abe5ac8eaf81931c15f2e950878290d29 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 17 Jun 2014 13:07:07 +0000 Subject: [PATCH] Added a fallback to the standard fan tessellator for managing the cases where the glu::tessellator can fail (better than nothing...) --- wrap/io_trimesh/import_obj.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 511bc956..ea3fed39 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -468,6 +468,8 @@ namespace vcg { #ifdef __gl_h_ //qDebug("OK: using opengl tessellation for a polygon of %i verteces",vertexesPerFace); vcg::glu_tesselator::tesselate(polygonVect, indexTriangulatedVect); + if(indexTriangulatedVect.size()==0) + FanTessellator(polygonVect, indexTriangulatedVect); #else //qDebug("Warning: using fan tessellation for a polygon of %i verteces",vertexesPerFace); FanTessellator(polygonVect, indexTriangulatedVect);