36 |
|
int nvts; |
37 |
|
|
38 |
|
int ndegen = 0; /* count of degenerate faces */ |
39 |
+ |
int n0norm = 0; /* count of zero normals */ |
40 |
|
|
41 |
|
typedef int VNDX[3]; /* vertex index (point,map,normal) */ |
42 |
|
|
145 |
|
} |
146 |
|
if (ndegen) |
147 |
|
printf("# %d degenerate faces\n", ndegen); |
148 |
+ |
if (n0norm) |
149 |
+ |
printf("# %d invalid (zero) normals\n", n0norm); |
150 |
|
exit(0); |
151 |
|
userr: |
152 |
|
fprintf(stderr, "Usage: %s [-o obj][-m mapping][-n][-f] [file.obj]\n", |
501 |
|
return(0); |
502 |
|
} else |
503 |
|
vi[2] = -1; |
504 |
+ |
/* zero normal is not normal */ |
505 |
+ |
if (vi[2] >= 0 && DOT(vnlist[vi[2]],vnlist[vi[2]]) <= FTINY) |
506 |
+ |
vi[2] = -1; |
507 |
|
return(1); |
508 |
|
} |
509 |
|
|
759 |
|
vnlist[nvns][0] = x; |
760 |
|
vnlist[nvns][1] = y; |
761 |
|
vnlist[nvns][2] = z; |
762 |
< |
if (normalize(vnlist[nvns]) == 0.0) |
757 |
< |
return(0); |
762 |
> |
n0norm += (normalize(vnlist[nvns]) == 0.0); |
763 |
|
return(++nvns); |
764 |
|
} |
765 |
|
|