POV-Ray : Newsgroups : povray.unofficial.patches : SuperPatch / bad triangle : Re: SuperPatch / bad triangle Server Time
2 Sep 2024 20:15:04 EDT (-0400)
  Re: SuperPatch / bad triangle  
From: Ron Parker
Date: 1 Jul 1999 14:44:37
Message: <377bb715@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.