70 |
|
d = 1.0/(n*n); |
71 |
|
scalecolor(hp->acoef, d); |
72 |
|
/* make tangent plane axes */ |
73 |
< |
hp->uy[0] = 0.1 - 0.2*frandom(); |
74 |
< |
hp->uy[1] = 0.1 - 0.2*frandom(); |
75 |
< |
hp->uy[2] = 0.1 - 0.2*frandom(); |
76 |
< |
for (i = 0; i < 3; i++) |
77 |
< |
if (r->ron[i] < 0.6 && r->ron[i] > -0.6) |
78 |
< |
break; |
79 |
< |
if (i >= 3) |
73 |
> |
hp->uy[0] = hp->uy[1] = hp->uy[2] = 0; |
74 |
> |
for (i = 3; i--; ) |
75 |
> |
if ((0.6 < r->ron[i]) & (r->ron[i] < 0.6)) |
76 |
> |
hp->uy[i] = 0.1+frandom(); |
77 |
> |
if (DOT(hp->uy,hp->uy) <= FTINY) |
78 |
|
error(CONSISTENCY, "bad ray direction in inithemi()"); |
81 |
– |
hp->uy[i] = 1.0; |
79 |
|
VCROSS(hp->ux, hp->uy, r->ron); |
80 |
|
normalize(hp->ux); |
81 |
|
VCROSS(hp->uy, r->ron, hp->ux); |