1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Convert Neutral File Format input to Radiance scene description. |
6 |
|
* |
106 |
|
{ |
107 |
|
printf("# File created by %s\n", progname); |
108 |
|
printf("\nvoid light light\n"); |
109 |
< |
printf("0\n0\n3 1 1 1\n"); |
109 |
> |
printf("0\n0\n3 1e6 1e6 1e6\n"); |
110 |
|
printf("\nvoid plastic fill\n"); |
111 |
|
printf("0\n0\n5 .5 .5 .5 0 0\n"); |
112 |
|
} |
287 |
|
while ((c = getchar()) != EOF && c != '\n') |
288 |
|
; |
289 |
|
printf("\nlight sphere l%d \n", ++nlights); |
290 |
< |
printf("0\n0\n4 %g %g %g 1\n", x, y, z); |
290 |
> |
printf("0\n0\n4 %g %g %g .01\n", x, y, z); |
291 |
|
} |
292 |
|
|
293 |
|
|
372 |
|
fprintf(stderr, "%s: fill material syntax error\n", progname); |
373 |
|
exit(1); |
374 |
|
} |
378 |
– |
d /= 1.-s-t; |
379 |
– |
r *= d; |
380 |
– |
g *= d; |
381 |
– |
b *= d; |
375 |
|
if (p > 1.) |
376 |
|
p = 1./p; |
377 |
|
if (t > .001) { /* has transmission */ |
378 |
< |
printf("\nvoid trans fill\n"); |
379 |
< |
printf("0\n0\n7 %g %g %g %g 0 %g 1\n", r, g, b, s, t); |
378 |
> |
if (n > 1.1) { /* has index of refraction */ |
379 |
> |
printf("\nvoid dielectric fill\n"); |
380 |
> |
printf("0\n0\n5 %g %g %g %g 0\n", r, g, b, n); |
381 |
> |
} else { /* transmits w/o refraction */ |
382 |
> |
printf("\nvoid trans fill\n"); |
383 |
> |
printf("0\n0\n7 %g %g %g %g 0 %g 1\n", |
384 |
> |
r*d, g*d, b*d, s, t); |
385 |
> |
} |
386 |
|
} else { /* no transmission */ |
387 |
|
printf("\nvoid plastic fill\n"); |
388 |
< |
printf("0\n0\n5 %g %g %g %g %g\n", r, g, b, s, p); |
388 |
> |
printf("0\n0\n5 %g %g %g %g %g\n", r*d, g*d, b*d, s, p); |
389 |
|
} |
390 |
|
} |
391 |
|
|
427 |
|
progname); |
428 |
|
exit(1); |
429 |
|
} |
430 |
< |
if (invert = r0 < 0.) { |
430 |
> |
if ( (invert = r0 < 0.) ) { |
431 |
|
r0 = -r0; |
432 |
|
r1 = -r1; |
433 |
|
} |
548 |
|
* $Revision$ |
549 |
|
* $Date$ |
550 |
|
* $Log$ |
551 |
< |
* Revision 2.3 1993/03/05 15:16:16 greg |
552 |
< |
* portability improvements |
551 |
> |
* Revision 2.6 2003/07/27 22:12:01 schorsch |
552 |
> |
* Added grouping parens to reduce ambiguity warnings. |
553 |
> |
* |
554 |
> |
* Revision 2.5 2003/02/22 02:07:23 greg |
555 |
> |
* Changes and check-in for 3.5 release |
556 |
> |
* Includes new source files and modifications not recorded for many years |
557 |
> |
* See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release |
558 |
|
* |
559 |
|
* Revision 1.2 88/09/12 12:53:47 markv |
560 |
|
* Fixed problem in LookupColorbyName, had return ; and return(0). |