| 470 |
|
int t, p; |
| 471 |
|
|
| 472 |
|
dv[2] = DOT(dvec, ourview.vdir); |
| 473 |
< |
theta = (float)((1./DEGREE) * acos(dv[2])); |
| 473 |
> |
theta = acos(dv[2]); |
| 474 |
|
if (theta >= maxtheta) |
| 475 |
|
return(.0f); |
| 476 |
|
dv[0] = DOT(dvec, ourview.hvec); |
| 477 |
|
dv[1] = DOT(dvec, ourview.vvec); |
| 478 |
< |
phi = (float)((1./DEGREE) * atan2(-dv[0], dv[1])); |
| 479 |
< |
while (phi < .0f) phi += 360.f; |
| 478 |
> |
phi = atan2(-dv[0], dv[1]); |
| 479 |
> |
while (phi < .0f) phi += (float)(2.*PI); |
| 480 |
|
t = (int)(theta/maxtheta * sntp[0]); |
| 481 |
< |
p = (int)(phi*(1./360.) * sntp[1]); |
| 481 |
> |
p = (int)(phi*(1./(2.*PI)) * sntp[1]); |
| 482 |
|
/* hack for non-uniform sensor grid */ |
| 483 |
+ |
theta *= (float)(1./DEGREE); |
| 484 |
+ |
phi *= (float)(1./DEGREE); |
| 485 |
|
while (t+1 < sntp[0] && theta >= s_theta(t+1)) |
| 486 |
|
++t; |
| 487 |
|
while (t-1 >= 0 && theta <= s_theta(t-1)) |
| 544 |
|
continue; |
| 545 |
|
} |
| 546 |
|
rr.rmax = .0; |
| 547 |
< |
rayorigin(&rr, PRIMARY, NULL, NULL); |
| 547 |
> |
rayorigin(&rr, PRIMARY|SPECULAR, NULL, NULL); |
| 548 |
|
scalecolor(rr.rcoef, sf); |
| 549 |
|
if (ray_pqueue(&rr) == 1) |
| 550 |
|
addcolor(vsum, rr.rcol); |
| 560 |
|
continue; |
| 561 |
|
} |
| 562 |
|
rr.rmax = .0; |
| 563 |
< |
rayorigin(&rr, PRIMARY, NULL, NULL); |
| 563 |
> |
rayorigin(&rr, PRIMARY|SPECULAR, NULL, NULL); |
| 564 |
|
scalecolor(rr.rcoef, sf); |
| 565 |
|
if (ray_pqueue(&rr) == 1) |
| 566 |
|
addcolor(vsum, rr.rcol); |