109 |
|
{ |
110 |
|
printf("# File created by %s\n", progname); |
111 |
|
printf("\nvoid light light\n"); |
112 |
< |
printf("0\n0\n3 1 1 1\n"); |
112 |
> |
printf("0\n0\n3 1e6 1e6 1e6\n"); |
113 |
|
printf("\nvoid plastic fill\n"); |
114 |
|
printf("0\n0\n5 .5 .5 .5 0 0\n"); |
115 |
|
} |
290 |
|
while ((c = getchar()) != EOF && c != '\n') |
291 |
|
; |
292 |
|
printf("\nlight sphere l%d \n", ++nlights); |
293 |
< |
printf("0\n0\n4 %g %g %g 1\n", x, y, z); |
293 |
> |
printf("0\n0\n4 %g %g %g .01\n", x, y, z); |
294 |
|
} |
295 |
|
|
296 |
|
|
375 |
|
fprintf(stderr, "%s: fill material syntax error\n", progname); |
376 |
|
exit(1); |
377 |
|
} |
378 |
– |
d /= 1.-s-t; |
379 |
– |
r *= d; |
380 |
– |
g *= d; |
381 |
– |
b *= d; |
378 |
|
if (p > 1.) |
379 |
|
p = 1./p; |
380 |
|
if (t > .001) { /* has transmission */ |
381 |
< |
printf("\nvoid trans fill\n"); |
382 |
< |
printf("0\n0\n7 %g %g %g %g 0 %g 1\n", r, g, b, s, t); |
381 |
> |
if (n > 1.1) { /* has index of refraction */ |
382 |
> |
printf("\nvoid dielectric fill\n"); |
383 |
> |
printf("0\n0\n5 %g %g %g %g 0\n", r, g, b, n); |
384 |
> |
} else { /* transmits w/o refraction */ |
385 |
> |
printf("\nvoid trans fill\n"); |
386 |
> |
printf("0\n0\n7 %g %g %g %g 0 %g 1\n", |
387 |
> |
r*d, g*d, b*d, s, t); |
388 |
> |
} |
389 |
|
} else { /* no transmission */ |
390 |
|
printf("\nvoid plastic fill\n"); |
391 |
< |
printf("0\n0\n5 %g %g %g %g %g\n", r, g, b, s, p); |
391 |
> |
printf("0\n0\n5 %g %g %g %g %g\n", r*d, g*d, b*d, s, p); |
392 |
|
} |
393 |
|
} |
394 |
|
|
551 |
|
* $Revision$ |
552 |
|
* $Date$ |
553 |
|
* $Log$ |
554 |
< |
* Revision 2.3 1993/03/05 15:16:16 greg |
555 |
< |
* portability improvements |
554 |
> |
* Revision 2.4 1993/07/20 11:34:40 greg |
555 |
> |
* fixes in materials and light sources (hacks all) |
556 |
|
* |
557 |
|
* Revision 1.2 88/09/12 12:53:47 markv |
558 |
|
* Fixed problem in LookupColorbyName, had return ; and return(0). |