POV-Ray : Newsgroups : povray.general : Doc bug - substr() : Re: Doc bug? #range - not a doc bug. Server Time
8 Aug 2024 12:20:37 EDT (-0400)
  Re: Doc bug? #range - not a doc bug.  
From: Geoff Wedig
Date: 22 Feb 2001 14:03:43
Message: <3a95628d@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:

> On 22 Feb 2001 13:41:49 -0500, Geoff Wedig wrote:
>>Ron Parker <ron### [at] povrayorg> wrote:
>>
>>> On 22 Feb 2001 13:10:38 -0500, Geoff Wedig wrote:
>>>>> roundoff error?
>>>>
>>>>Not in this case.  I'm dealing strictly with integers.
>>
>>> Are you sure clock is an integer?
>>
>>Well, initial_clock and final clock are both integers, and equal to initial
>>frame and final frame respectively.  And in the log they're all .00000, so
>>yeah, pretty sure. ;)

> Can you tell me what initial and final clock/frame are, so I can try to 
> duplicate the problem?

Not easily.  I've revised the code to get rid of the problem frames.  I
believe they were 0 and 90 or 0 and 70 (one of the two).

Here's the switch I was using.  There were default parameters (essentially
case 0) defined before the #switch.  I found that frames 13, 20, 25, etc
were using these defaults rather than the range, and assumed it to be dues
to that be a < rather than <=.  I changed them to .5 less and everything
worked fine.


#switch (clock)

  #case(0)
    $attack_percentage = 0;
    $window_opening    = 1;
    $engine_glow       = 1;
  #break
  #range(1,12)
    $attack_percentage = 0;
    $window_opening    = (25-clock)/25;
    $engine_glow       = 1;
  #break
  #range(13,19)
    $attack_percentage = 0;
    $window_opening    = (25-clock)/25;
    $engine_glow       = (37-clock)/25;
  #break
  #range(20,24)
    $attack_percentage = (clock-19)/50;
    $window_opening    = (25-clock)/25;
    $engine_glow       = (37-clock)/25;
  #break
  #range(25,37)
    $attack_percentage = (clock-19)/50;
    $window_opening    = 0;
    $engine_glow       = (37-clock)/25;
  #break
  #range(38,59)
    $attack_percentage = (clock-19)/50;
    $window_opening    = 0;
    $engine_glow       = 0;
  #break
  #range(60, 69)
    $attack_percentage = (clock-19)/50;
    $window_opening    = 0;
    $engine_glow       = 0;
    $shield_on       = (clock - 60)/20;
  #break
  #range(70,90)
    $shield_on       = min((clock - 60)/20,1);
  #break
#end  

Geoff


Post a reply to this message

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