POV-Ray : Newsgroups : povray.animations : Shed version 2 : Re: Shed version 2 Server Time
26 Apr 2024 18:50:21 EDT (-0400)
  Re: Shed version 2  
From: Klewlis
Date: 21 Feb 2017 19:10:01
Message: <web.58acd5bfe97123ee5f9209890@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Klewlis" <nomail@nomail> wrote:
>
> > OK, I suspect the problem is in the fact that I am running the animation from an
> > ..ini file.  This would be the same problem I had with the #while command.
>
> I would not have guessed that would be a / the problem
>

Actually, the problem is not in the Switch/Range.  The problem is in the other
coding I used.

#switch (frame_number)
    #range (1, 35)
        #declare b=b+1;
        object { SunLight
            rotate x*(b/2)
        }
    #break
    #range (36, 60)
        object { SunLight
            rotate x*(b/2)
        }
    #break
    #range (61, 282)
        #declare b=b+1;
        object { SunLight
            rotate x*(b/2)
        }
    #break
#end

Just before this code, I do: #declare b=0, so each time POV parses the file, b
is initialized to 0.  During the first 35 frames b=1 because of this.

This actually makes me wonder why this works:
    #declare a=2;

    #for (i, 1.5, 241.5, 16)
        #declare a=a+1;
        #if (frame_number>a)
            object {Stud
                rotate z*90
                #if (i<240)
                    translate <i, 0, 140.375>
                #else
                    translate <i-1.5, 0, 140.375>
                #end
            }
        #end
    #end

(I am not complaining, I am glad it works.)  It seems that each time the file is
parsed, "i" would be initialized to 1.5, but instead it is incremented by 16.

Thank you;
Ken


Post a reply to this message

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