|
|
Le 20/09/2010 11:41, Corvin Zahn nous fit lire :
> Does anyone have an idea, whats wrong?
>
Yes, now I do.
The computation of the shooting cone for rays need some adjustement (and
propably a more serious revision in a next release to rewrite it to
handle some cases).
To make thinks clear, the cone was computed as follow:
compute the radius of the bounding sphere of the target. (RAD)
compute the distance between the lightsource and the center of the
bounding sphere. (DIST)
(The bounding sphere is the sphere which contains the bounding box)
The result was a cone of center the lightsource, toward the center of
the bounding sphere. The orthogonal section at that point was a disc of
same radius as the sphere.
Issues:
a. If the lightsource is inside the sphere, you're stuck.
b. otherwise, a small part of the sphere is out of the cone
that part get more and more important as DIST is about RAD.
(with large DIST/RAD ratio, the issue is nearly invisible, but
what you encountered was a case where DIST/CASE was low.)
Issue b is fixed by adjusting RAD by 1/sin(acos(DIST/RAD))
Issue a need a better rewrite (to be considered in a later, later release)
Post a reply to this message
|
|