70 |
|
char *defmat = DEFMAT; /* default (starting) material name */ |
71 |
|
char *defobj = DEFOBJ; /* default (starting) object name */ |
72 |
|
|
73 |
+ |
int flatten = 0; /* discard surface normal information */ |
74 |
+ |
|
75 |
|
char *getmtl(), *getonm(); |
76 |
|
|
77 |
|
char mapname[128]; /* current picture file */ |
101 |
|
case 'm': /* use custom mapfile */ |
102 |
|
ourmapping = getmapping(argv[++i], &qlist); |
103 |
|
break; |
104 |
+ |
case 'f': /* flatten surfaces */ |
105 |
+ |
flatten++; |
106 |
+ |
break; |
107 |
|
default: |
108 |
|
goto userr; |
109 |
|
} |
577 |
|
if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3)) |
578 |
|
return(0); |
579 |
|
/* compute barycentric coordinates */ |
580 |
< |
texOK = (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0); |
580 |
> |
texOK = !flatten && (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0); |
581 |
|
#ifdef TEXMAPS |
582 |
|
patOK = mapname[0] && (v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0); |
583 |
|
#else |
797 |
|
#ifdef TEXMAPS |
798 |
|
/* also check for texture indices */ |
799 |
|
#endif |
800 |
< |
if (!(p0i[2]>=0 && p1i[2]>=0 && p2i[2]>=0 && p3i[2]>=0)) |
800 |
> |
if (flatten || !(p0i[2]>=0 && p1i[2]>=0 && p2i[2]>=0 && p3i[2]>=0)) |
801 |
|
return(-1); |
802 |
|
/* find dominant axis */ |
803 |
|
VCOPY(v1, vnlist[p0i[2]]); |