73 |
|
static RAY thisray; /* for our convenience */ |
74 |
|
|
75 |
|
static int oputo(), oputd(), oputv(), oputl(), oputL(), |
76 |
< |
oputp(), oputn(), oputs(), oputw(), oputm(); |
76 |
> |
oputp(), oputn(), oputN(), oputs(), oputw(), oputm(); |
77 |
|
|
78 |
|
static int (*ray_out[10])(), (*every_out[10])(); |
79 |
|
static int castonly; |
118 |
|
sprintf(errmsg, "cannot open input file \"%s\"", fname); |
119 |
|
error(SYSTEM, errmsg); |
120 |
|
} |
121 |
+ |
#ifdef MSDOS |
122 |
+ |
if (inform != 'a') |
123 |
+ |
setmode(fileno(fp), O_BINARY); |
124 |
+ |
#endif |
125 |
|
/* set up output */ |
126 |
|
setoutput(outvals); |
127 |
|
switch (outform) { |
202 |
|
case 'p': /* point */ |
203 |
|
*table++ = oputp; |
204 |
|
break; |
205 |
< |
case 'n': /* normal */ |
205 |
> |
case 'n': /* perturbed normal */ |
206 |
|
*table++ = oputn; |
207 |
+ |
castonly = 0; |
208 |
|
break; |
209 |
+ |
case 'N': /* unperturbed normal */ |
210 |
+ |
*table++ = oputN; |
211 |
+ |
break; |
212 |
|
case 's': /* surface */ |
213 |
|
*table++ = oputs; |
214 |
|
break; |
404 |
|
|
405 |
|
|
406 |
|
static |
407 |
< |
oputn(r) /* print normal */ |
407 |
> |
oputN(r) /* print unperturbed normal */ |
408 |
|
register RAY *r; |
409 |
|
{ |
410 |
|
if (r->rot < FHUGE) { |
416 |
|
(*putreal)(0.0); |
417 |
|
(*putreal)(0.0); |
418 |
|
} |
419 |
+ |
} |
420 |
+ |
|
421 |
+ |
|
422 |
+ |
static |
423 |
+ |
oputn(r) /* print perturbed normal */ |
424 |
+ |
RAY *r; |
425 |
+ |
{ |
426 |
+ |
FVECT pnorm; |
427 |
+ |
|
428 |
+ |
if (r->rot >= FHUGE) { |
429 |
+ |
(*putreal)(0.0); |
430 |
+ |
(*putreal)(0.0); |
431 |
+ |
(*putreal)(0.0); |
432 |
+ |
return; |
433 |
+ |
} |
434 |
+ |
raynormal(pnorm, r); |
435 |
+ |
(*putreal)(pnorm[0]); |
436 |
+ |
(*putreal)(pnorm[1]); |
437 |
+ |
(*putreal)(pnorm[2]); |
438 |
|
} |
439 |
|
|
440 |
|
|