199 |
|
int niter, i = 0; |
200 |
|
|
201 |
|
/* Set up sample coordinates */ |
202 |
< |
do { |
203 |
< |
v [0] = v [1] = v [2] = 0; |
204 |
< |
v [i++] = 1; |
205 |
< |
fcross(u, v, nd -> pnorm); |
206 |
< |
} while (normalize(u) < FTINY); |
207 |
< |
|
202 |
> |
getperpendicular(u, nd -> pnorm); |
203 |
|
fcross(v, nd -> pnorm, u); |
204 |
|
|
205 |
|
if (nd -> specfl & SP_REFL) { |
263 |
|
int i = 0; |
264 |
|
|
265 |
|
/* Set up sample coordinates */ |
266 |
< |
do { |
272 |
< |
v [0] = v [1] = v [2] = 0; |
273 |
< |
v [i++] = 1; |
274 |
< |
fcross(u, v, normal); |
275 |
< |
} while (normalize(u) < FTINY); |
276 |
< |
|
266 |
> |
getperpendicular(u, normal); |
267 |
|
fcross(v, normal, u); |
268 |
|
|
269 |
|
/* Convert theta & phi to cartesian */ |
314 |
|
nd.specfl |= SP_FLAT; |
315 |
|
|
316 |
|
/* Perturb normal */ |
317 |
< |
if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > sqr(FTINY)) |
317 |
> |
if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > sqr(FTINY)) )) |
318 |
|
nd.pdot = raynormal(nd.pnorm, rayIn); |
319 |
|
else { |
320 |
|
VCOPY(nd.pnorm, rayIn -> ron); |
743 |
|
/* get modifiers */ |
744 |
|
raytexture(rayIn, mat -> omod); |
745 |
|
|
746 |
< |
if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > FTINY * FTINY) |
746 |
> |
if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > FTINY * FTINY))) |
747 |
|
/* Perturb normal */ |
748 |
|
cos1 = raynormal(dnorm, rayIn); |
749 |
|
else { |
890 |
|
/* reorient if necessary */ |
891 |
|
if (rayIn -> rod < 0) |
892 |
|
flipsurface(rayIn); |
893 |
< |
if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > FTINY * FTINY) |
893 |
> |
if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > FTINY * FTINY) )) |
894 |
|
pdot = raynormal(pnorm, rayIn); |
895 |
|
else { |
896 |
|
VCOPY(pnorm, rayIn -> ron); |