| 208 |
|
} |
| 209 |
|
nstats++; |
| 210 |
|
} |
| 211 |
< |
printf("# Done processing file: %s\n", fname); |
| 211 |
> |
printf("\n# Done processing file: %s\n", fname); |
| 212 |
|
printf("# %d lines, %d statements, %d unrecognized\n", |
| 213 |
|
lineno, nstats, nunknown); |
| 214 |
|
} |
| 318 |
|
char *mod = matname; |
| 319 |
|
VNDX v1i, v2i, v3i; |
| 320 |
|
BARYCCM bvecs; |
| 321 |
+ |
int texOK, patOK; |
| 322 |
|
|
| 323 |
|
if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3)) |
| 324 |
|
return(0); |
| 325 |
|
/* compute barycentric coordinates */ |
| 326 |
< |
if ((v1i[2]>=0&&v2i[2]>=0&&v3i[2]>=0) || |
| 327 |
< |
(v1i[1]>=0&&v2i[1]>=0&&v3i[1]>=0)) |
| 326 |
> |
texOK = (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0); |
| 327 |
> |
patOK = picfile[0] && (v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0); |
| 328 |
> |
if (texOK | patOK) |
| 329 |
|
if (comp_baryc(bvecs, vlist[v1i[0]], vlist[v2i[0]], |
| 330 |
|
vlist[v3i[0]]) < 0) |
| 331 |
< |
return(0); |
| 331 |
> |
return(-1); |
| 332 |
|
/* put out texture (if any) */ |
| 333 |
< |
if (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0) { |
| 333 |
> |
if (texOK) { |
| 334 |
|
printf("\n%s texfunc %s\n", mod, TEXNAME); |
| 335 |
|
mod = TEXNAME; |
| 336 |
|
printf("4 dx dy dz %s\n", TCALNAME); |
| 347 |
|
vnlist[v3i[2]][2]); |
| 348 |
|
} |
| 349 |
|
/* put out pattern (if any) */ |
| 350 |
< |
if (picfile[0] && v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0) { |
| 350 |
> |
if (patOK) { |
| 351 |
|
printf("\n%s colorpict %s\n", mod, PATNAME); |
| 352 |
|
mod = PATNAME; |
| 353 |
|
printf("7 noneg noneg noneg %s %s u v\n", picfile, TCALNAME); |
| 359 |
|
vtlist[v2i[1]][1], vtlist[v3i[1]][1]); |
| 360 |
|
} |
| 361 |
|
/* put out triangle */ |
| 362 |
< |
printf("\n%s polygon %s.%d\n", matname, objname, ++nfaces); |
| 362 |
> |
printf("\n%s polygon %s.%d\n", mod, objname, ++nfaces); |
| 363 |
|
printf("0\n0\n9\n"); |
| 364 |
|
pvect(vlist[v1i[0]]); |
| 365 |
|
pvect(vlist[v2i[0]]); |
| 441 |
|
fcross(vc2, v1, v2); |
| 442 |
|
ok2 = normalize(vc2) != 0.0; |
| 443 |
|
if (!(ok1 | ok2)) |
| 444 |
< |
return(0); |
| 444 |
> |
return(-1); |
| 445 |
|
/* compute normal interpolation */ |
| 446 |
|
axis = norminterp(norm, p0i, p1i, p2i, p3i); |
| 447 |
|
|