POV-Ray : Newsgroups : povray.general : <no subject> : Re: <no subject> Server Time
29 Jul 2024 14:17:18 EDT (-0400)
  Re: <no subject>  
From: Trevor G Quayle
Date: 16 Apr 2011 21:45:00
Message: <web.4daa44f76f92e856b05ef170@news.povray.org>
"jkennedy12" <jke### [at] cornellcollegeedu> wrote:
> This is part of the code I'm writing.
>
> #declare RailArray = array[N];
> #declare tmp = 0;
> #while(tmp<=N)
>         #declare RailArray[temp] = 0//Spline_1(temp/N);
> #end
>
> It gives me an error when I call the part inside the loop. N is equal to 10.
> Spline_1 is obviously a spline. I can't figure out why it doesn't like this.

Array indexes are 0 based, so an array of dimension N goes from 0 to 1-N.

Try: #while(tmp<N)

-tgq


Post a reply to this message

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