| 16 |
|
* xorg yorg zorg xdir ydir zdir |
| 17 |
|
* |
| 18 |
|
* The direction need not be normalized. Output is flexible. |
| 19 |
+ |
* If the direction vector is (0,0,0), then the output is flushed. |
| 20 |
|
* All values default to ascii representation of real |
| 21 |
|
* numbers. Binary representations can be selected |
| 22 |
|
* with '-ff' for float or '-fd' for double. By default, |
| 95 |
|
while (getvec(orig, inform, fp) == 0 && |
| 96 |
|
getvec(direc, inform, fp) == 0) { |
| 97 |
|
|
| 98 |
< |
if (normalize(direc) == 0.0) |
| 99 |
< |
error(USER, "zero direction vector"); |
| 98 |
> |
if (normalize(direc) == 0.0) { /* zero ==> flush */ |
| 99 |
> |
fflush(stdout); |
| 100 |
> |
continue; |
| 101 |
> |
} |
| 102 |
|
/* compute and print */ |
| 103 |
|
if (outvals[0] == 'i') |
| 104 |
|
irrad(orig, direc); |
| 105 |
|
else |
| 106 |
|
radiance(orig, direc); |
| 107 |
< |
/* flush if requested */ |
| 107 |
> |
/* flush if time */ |
| 108 |
|
if (--nextflush == 0) { |
| 109 |
|
fflush(stdout); |
| 110 |
|
nextflush = hresolu; |