POV-Ray : Newsgroups : povray.binaries.animations : Planetary fly-overs with height-fields : Re: Planetary fly-overs with height-fields Server Time
27 Feb 2024 19:16:53 EST (-0500)
  Re: Planetary fly-overs with height-fields  
From: Tor Olav Kristensen
Date: 5 Dec 2020 11:35:01
Message: <web.5fcbb643a2e69bcba93700e40@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> Hi(gh)!
>
> On 04.12.20 11:27, Tor Olav Kristensen wrote:
> > Hi Yadgar
> >
> > =?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> >> ...
> >> The faces are constructed this way:
> >>
> >> #declare a = 0;
> >> #declare c = 0;
> >> #while (a < ydim-1)
> >>     #declare b = 0;
> >>     #while (b < xdim-1)
> >>       #declare Faces[a*ydim+b]  = <a*res+b, a*res+b+1, (a+1)*res+b>;
> >>       #declare Faces[a*ydim+b+1] = <a*res+b+1, (a+1)*res+b+1, (a+1)*res+b>;
> >>       #declare c = c+2;
> >>       #declare b = b+1;
> >>     #end
> >>     #declare a = a+1;
> >> #end
> >
> > Have you tested if the code above works as you intended ?
>
> With the script I extracted the code from, it works perfectly!

But about all of the calculations you do in this line "#declare
Faces[a*ydim+b+1] = ..." are wasted (i.e. not used), except for in the last
iteration of the "#while (b < xdim-1)" loop. That is because they are
overwritten in the next iteration of the loop.

And if you use c to count the number of vectors defined so far in the Faces
array, then the count will be about twice as high as the actual number of
vectors put into that array.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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