| 
|  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | Francois Labreque <fla### [at] videotron ca> wrote:
> Geoff Wedig wrote:
>> 
>> Speaking of manual bugs, can anyone confirm that the #range feature for
>> #switch is actually lower < value <= upper and not lower <= value <= upper
>> like it says in the manual?
> The doc is correct.
> #switch( var)
>     #range (1, 10)
>         box{ 0, 1 pigment{ color rgb 1 }}
>     #else
>         sphere{ 0, 1 pigment { color rgb <1,0,0> }}
> #end
> creates a white box when var=1, not a red sphere as you think it would.
Hmm, then something else must be funny, because when I do
// Define a bunch of stuff.
#switch(clock)
  #range(0, 9)
    #define stuff
  #break
  #range(10, 20)
    #define stuff
  #break
#end
The 10th frame doesn't get any definitions from the switch, which is why I
mentioned this.  I had to set it to range(9.5, 20) to get it to work right.
So what else might be causing this?
Geoff Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | "Francois Labreque" <fla### [at] videotron ca> wrote in message
news:3A952F9F.43B9E767@videotron.ca...
>
> Geoff Wedig wrote:
> >
> > Speaking of manual bugs, can anyone confirm that the #range feature for
> > #switch is actually lower < value <= upper and not lower <= value <=
upper
> > like it says in the manual?
>
> The doc is correct.
>
> #switch( var)
>     #range (1, 10)
>         box{ 0, 1 pigment{ color rgb 1 }}
>     #else
> sphere{ 0, 1 pigment { color rgb <1,0,0> }}
> #end
>
> creates a white box when var=1, not a red sphere as you think it would.
Nope, sorry.  Not so it would seem.  It is 1 to 10 inclusive but you need a
#break ahead of the #else otherwise you actually get both objects.  In
MegaPov anyway.
Bob H. Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | On 22 Feb 2001 12:31:32 -0500, Geoff Wedig wrote:
>#switch(clock)
>
>  #range(0, 9)
>    #define stuff
>  #break
>  #range(10, 20)
>    #define stuff
>  #break
>
>#end
>
>The 10th frame doesn't get any definitions from the switch, which is why I
>mentioned this.  I had to set it to range(9.5, 20) to get it to work right.
>
>So what else might be causing this?
roundoff error?
-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
 Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | Ron Parker <ron### [at] povray org> wrote:
> On 22 Feb 2001 12:31:32 -0500, Geoff Wedig wrote:
>>#switch(clock)
>>
>>  #range(0, 9)
>>    #define stuff
>>  #break
>>  #range(10, 20)
>>    #define stuff
>>  #break
>>
>>#end
>>
>>The 10th frame doesn't get any definitions from the switch, which is why I
>>mentioned this.  I had to set it to range(9.5, 20) to get it to work right.
>>
>>So what else might be causing this?
> roundoff error?
Not in this case.  I'm dealing strictly with integers.
Geoff Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | 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?
-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
 Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | Ron Parker <ron### [at] povray org> 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. ;)
Geoff Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | On 22 Feb 2001 13:41:49 -0500, Geoff Wedig wrote:
>Ron Parker <ron### [at] povray org> 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?
-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's. Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | "Ron Parker" <ron### [at] povray org> wrote in message
news:slr### [at] fwi  com...
> 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?
Always a good idea to make the variable in question readable in order to be
sure; via a text object, file output, or message stream.  Example:
#debug concat("Clock value is ", str(clock,0,-1))
But from what I can tell a clock done by frame number instead of the typical
0 to 1 is pretty much an integer.
Of course another good question might be what version of POV is being used,
just in case, eh?
Bob H. Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | Ron Parker <ron### [at] povray org> wrote:
> On 22 Feb 2001 13:41:49 -0500, Geoff Wedig wrote:
>>Ron Parker <ron### [at] povray  org> 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
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  
|  |  | Bob H. <omn### [at] msn com> wrote:
> "Ron Parker" <ron### [at] povray  org> wrote in message
> news:slr### [at] fwi  com...
>> 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?
> Always a good idea to make the variable in question readable in order to be
> sure; via a text object, file output, or message stream.  Example:
> #debug concat("Clock value is ", str(clock,0,-1))
> But from what I can tell a clock done by frame number instead of the typical
> 0 to 1 is pretty much an integer.
> Of course another good question might be what version of POV is being used,
> just in case, eh?
This was Megapov 0.6;
Geoff Post a reply to this message
 |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |