From 3d7a7b397b9ef4b842c02d449a65accd00a547af Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Fri, 31 Dec 2010 18:20:51 +0100 Subject: [PATCH] simplipie: Fix error when fixing face culling and tessellation at the same time. --- data/base/features/mibridge.pie | 2 +- data/base/features/mibridgx.pie | 2 +- tools/conversion/simplipie.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/base/features/mibridge.pie b/data/base/features/mibridge.pie index 7d462a1ff..6b63c34ac 100644 --- a/data/base/features/mibridge.pie +++ b/data/base/features/mibridge.pie @@ -37,7 +37,7 @@ POINTS 33 -65 97 -64 0 97 -64 65 97 -64 -POLYGONS 26 +POLYGONS 28 200 3 2 1 0 199 87 199 131 194 131 200 3 0 3 2 194 131 194 87 199 87 200 3 6 5 4 194 131 194 87 199 87 diff --git a/data/base/features/mibridgx.pie b/data/base/features/mibridgx.pie index f4e350212..cd7509ea6 100644 --- a/data/base/features/mibridgx.pie +++ b/data/base/features/mibridgx.pie @@ -114,7 +114,7 @@ POINTS 110 0 127 -130 65 127 -130 65 127 -195 -POLYGONS 110 +POLYGONS 116 200 3 3 2 1 169 71 139 71 139 41 200 3 3 1 0 169 71 139 41 169 41 200 3 4 5 1 79 2 48 2 79 46 diff --git a/tools/conversion/simplipie.c b/tools/conversion/simplipie.c index be7377419..fcc94db02 100644 --- a/tools/conversion/simplipie.c +++ b/tools/conversion/simplipie.c @@ -305,6 +305,10 @@ static void dump_to_pie(FILE *ctl, FILE *fp, const char *input) faceList[j].index[m] = posList[faceList[j].index[m]].reindex; } facesPIE3 += faceList[j].vertices - 3; // easy tessellation + if (faceList[j].cull) + { + facesPIE3 += faceList[j].vertices - 3; // must add additional face that is faced in the opposite direction also for tessellated faces + } } if (verbose && (facesPIE3 - faces))