|
 |
On Thu, 01 Jul 1999 13:16:05 -0400, edna dornblazer wrote:
>edna dornblazer wrote:
>> lighting.c and render.c are both from June 10.
>> My trace says its crashing from Reflect()
>[ ... ]
>
>I think I found it.
>In lighting.c, in Reflect():
>
> z = (FRAND() * 2) - 1;
> t = FRAND() * M_PI * 2;
> r = sqrt(1 - z*z);
>Well, FRAND*2 (at least with MSDOS/DJGPP) on occasion returns
>numbers slightly bigger than 1.0, and the subsequent
>r=sqrt(negative number) yields NaN vectors a little later.
>Replacing the r=sqrt() line with
> r = sqrt(fabs(1 - z*z));
>at least lets that stupid triangle render.
Ah, that makes sense. Windows has a tendency to ignore FP errors.
Hm, I'm piling up all sorts of bugfixes. Time for a bugfix release,
methinks. Now to find them all...
Post a reply to this message
|
 |