1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
5 |
|
#endif |
6 |
|
|
7 |
|
/* |
19 |
|
#define AMBFILE 0 /* ambient file name */ |
20 |
|
#define DETAIL 1 /* level of scene detail */ |
21 |
|
#define EXPOSURE 2 /* picture exposure setting */ |
22 |
< |
#define ILLUM 3 /* mkillum input files */ |
23 |
< |
#define INDIRECT 4 /* indirection in lighting */ |
24 |
< |
#define MATERIAL 5 /* material files */ |
25 |
< |
#define MKILLUM 6 /* mkillum options */ |
26 |
< |
#define OBJECT 7 /* object files */ |
27 |
< |
#define OCONV 8 /* oconv options */ |
28 |
< |
#define OCTREE 9 /* octree file name */ |
29 |
< |
#define OPTFILE 10 /* rendering options file */ |
30 |
< |
#define PENUMBRAS 11 /* shadow penumbras are desired */ |
31 |
< |
#define PFILT 12 /* pfilt options */ |
32 |
< |
#define PICTURE 13 /* picture file root name */ |
33 |
< |
#define QUALITY 14 /* desired rendering quality */ |
34 |
< |
#define RAWFILE 15 /* raw picture file root name */ |
35 |
< |
#define RENDER 16 /* rendering options */ |
36 |
< |
#define REPORT 17 /* report frequency and errfile */ |
37 |
< |
#define RESOLUTION 18 /* maximum picture resolution */ |
38 |
< |
#define SCENE 19 /* scene files */ |
39 |
< |
#define UP 20 /* view up (X, Y or Z) */ |
40 |
< |
#define VARIABILITY 21 /* level of light variability */ |
41 |
< |
#define VIEWS 22 /* view(s) for picture(s) */ |
42 |
< |
#define ZFILE 23 /* distance file root name */ |
43 |
< |
#define ZONE 24 /* simulation zone */ |
22 |
> |
#define EYESEP 3 /* interocular distance */ |
23 |
> |
#define ILLUM 4 /* mkillum input files */ |
24 |
> |
#define INDIRECT 5 /* indirection in lighting */ |
25 |
> |
#define MATERIAL 6 /* material files */ |
26 |
> |
#define MKILLUM 7 /* mkillum options */ |
27 |
> |
#define OBJECT 8 /* object files */ |
28 |
> |
#define OCONV 9 /* oconv options */ |
29 |
> |
#define OCTREE 10 /* octree file name */ |
30 |
> |
#define OPTFILE 11 /* rendering options file */ |
31 |
> |
#define PENUMBRAS 12 /* shadow penumbras are desired */ |
32 |
> |
#define PFILT 13 /* pfilt options */ |
33 |
> |
#define PICTURE 14 /* picture file root name */ |
34 |
> |
#define QUALITY 15 /* desired rendering quality */ |
35 |
> |
#define RAWFILE 16 /* raw picture file root name */ |
36 |
> |
#define RENDER 17 /* rendering options */ |
37 |
> |
#define REPORT 18 /* report frequency and errfile */ |
38 |
> |
#define RESOLUTION 19 /* maximum picture resolution */ |
39 |
> |
#define SCENE 20 /* scene files */ |
40 |
> |
#define UP 21 /* view up (X, Y or Z) */ |
41 |
> |
#define VARIABILITY 22 /* level of light variability */ |
42 |
> |
#define VIEWS 23 /* view(s) for picture(s) */ |
43 |
> |
#define ZFILE 24 /* distance file root name */ |
44 |
> |
#define ZONE 25 /* simulation zone */ |
45 |
|
/* total number of variables */ |
46 |
< |
int NVARS = 25; |
46 |
> |
int NVARS = 26; |
47 |
|
|
48 |
|
VARIABLE vv[] = { /* variable-value pairs */ |
49 |
|
{"AMBFILE", 3, 0, NULL, onevalue}, |
50 |
|
{"DETAIL", 3, 0, NULL, qualvalue}, |
51 |
|
{"EXPOSURE", 3, 0, NULL, fltvalue}, |
52 |
+ |
{"EYESEP", 3, 0, NULL, fltvalue}, |
53 |
|
{"illum", 3, 0, NULL, catvalues}, |
54 |
|
{"INDIRECT", 3, 0, NULL, intvalue}, |
55 |
|
{"materials", 3, 0, NULL, catvalues}, |
186 |
|
quit(0); |
187 |
|
userr: |
188 |
|
fprintf(stderr, |
189 |
< |
"Usage: %s [-s][-n][-t][-e][-V][-v view][-o dev] rfile [VAR=value ..]\n", |
189 |
> |
"Usage: %s [-w][-s][-n][-t][-e][-V][-v view][-o dev] rfile [VAR=value ..]\n", |
190 |
|
progname); |
191 |
|
quit(1); |
192 |
|
} |
341 |
|
|
342 |
|
setdefaults() /* set default values for unassigned var's */ |
343 |
|
{ |
344 |
< |
double org[3], size; |
344 |
> |
double org[3], lim[3], size; |
345 |
|
char buf[128]; |
346 |
|
|
347 |
|
if (!vdef(ZONE)) { |
350 |
|
org[1], org[1]+size, org[2], org[2]+size); |
351 |
|
vval(ZONE) = savqstr(buf); |
352 |
|
vdef(ZONE)++; |
353 |
+ |
} |
354 |
+ |
if (!vdef(EYESEP)) { |
355 |
+ |
if (sscanf(vval(ZONE), "%*s %lf %lf %lf %lf %lf %lf", |
356 |
+ |
&org[0], &lim[0], &org[1], &lim[1], |
357 |
+ |
&org[2], &lim[2]) != 6) |
358 |
+ |
badvalue(ZONE); |
359 |
+ |
sprintf(buf, "%f", |
360 |
+ |
0.01*(lim[0]-org[0]+lim[1]-org[1]+lim[2]-org[2])); |
361 |
+ |
vval(EYESEP) = savqstr(buf); |
362 |
+ |
vdef(EYESEP)++; |
363 |
|
} |
364 |
|
if (!vdef(INDIRECT)) { |
365 |
|
vval(INDIRECT) = "0"; |