| 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 |
|
|
| 548 |
|
* $Revision$ |
| 549 |
|
* $Date$ |
| 550 |
|
* $Log$ |
| 551 |
< |
* Revision 2.3 1993/03/05 15:16:16 greg |
| 552 |
< |
* portability improvements |
| 551 |
> |
* Revision 2.5 2003/02/22 02:07:23 greg |
| 552 |
> |
* Changes and check-in for 3.5 release |
| 553 |
> |
* Includes new source files and modifications not recorded for many years |
| 554 |
> |
* See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release |
| 555 |
|
* |
| 556 |
|
* Revision 1.2 88/09/12 12:53:47 markv |
| 557 |
|
* Fixed problem in LookupColorbyName, had return ; and return(0). |