28 |
|
int save_mats = 1; |
29 |
|
int do_tex = 0; |
30 |
|
int do_norm = 0; |
31 |
+ |
char *xfm = NULL; |
32 |
|
char cbuf[256]; |
33 |
|
double verteps = -1.; |
34 |
|
int i, n; |
86 |
|
case 'r': /* output to Radiance file? */ |
87 |
|
radout = (argv[i][0] == '+'); |
88 |
|
break; |
89 |
+ |
case 'x': /* apply a transform */ |
90 |
+ |
if (xfm != NULL) { |
91 |
+ |
fprintf(stderr, "%s: only one '-x' option allowed\n", |
92 |
+ |
argv[0]); |
93 |
+ |
exit(1); |
94 |
+ |
} |
95 |
+ |
xfm = argv[++i]; |
96 |
+ |
break; |
97 |
|
default: |
98 |
|
fprintf(stderr, "%s: unknown option: %s\n", |
99 |
|
argv[0], argv[i]); |
187 |
|
sprintf(cbuf, "Removed %d duplicate faces", n); |
188 |
|
addComment(myScene, cbuf); |
189 |
|
} |
190 |
+ |
if (xfm != NULL) { |
191 |
+ |
if (verbose) |
192 |
+ |
fputs("Applying transform...\n", stderr); |
193 |
+ |
if (!xfmScene(myScene, xfm)) { |
194 |
+ |
fprintf(stderr, "%s: transform error\n", argv[0]); |
195 |
+ |
exit(1); |
196 |
+ |
} |
197 |
+ |
sprintf(cbuf, "Applied transform: %s", xfm); |
198 |
+ |
addComment(myScene, cbuf); |
199 |
+ |
} |
200 |
|
if (verbose) |
201 |
|
fputs("Writing out scene...\n", stderr); |
202 |
|
|
220 |
|
fprintf(stderr, "\t+/-t\t\t\t# keep/remove texture coordinates\n"); |
221 |
|
fprintf(stderr, "\t+/-n\t\t\t# keep/remove vertex normals\n"); |
222 |
|
fprintf(stderr, "\t-c epsilon\t\t# coalesce vertices within epsilon\n"); |
223 |
+ |
fprintf(stderr, "\t-x 'xf spec'\t# apply the quoted transform\n"); |
224 |
|
return(1); |
225 |
|
} |
226 |
|
|