16 |
|
typedef struct { |
17 |
|
Scene *sc; |
18 |
|
Face *f; |
19 |
+ |
int rev; |
20 |
|
} SceneFace; |
21 |
|
|
22 |
|
/* Callback to create new triangle */ |
27 |
|
Face *f = sf->f; |
28 |
|
VNDX triv[3]; |
29 |
|
|
30 |
+ |
if (sf->rev) { /* need to reverse triangle? */ |
31 |
+ |
int t = a; |
32 |
+ |
a = c; |
33 |
+ |
c = t; |
34 |
+ |
} |
35 |
|
triv[0][0] = f->v[a].vid; |
36 |
|
triv[0][1] = f->v[a].tid; |
37 |
|
triv[0][2] = f->v[a].nid; |
85 |
|
poly->v[i].mX = pt[ax]; |
86 |
|
poly->v[i].mY = pt[ay]; |
87 |
|
} |
88 |
+ |
mysf.rev = (polyArea(poly) < .0); |
89 |
|
i = polyTriangulate(poly, addtriangle); |
90 |
|
polyFree(poly); |
91 |
|
/* flag face if replaced */ |