POV-Ray : Newsgroups : povray.general : Writing array in inverse order Server Time
29 Jul 2024 12:29:52 EDT (-0400)
  Writing array in inverse order (Message 1 to 4 of 4)  
From: Albun
Subject: Writing array in inverse order
Date: 14 Feb 2012 09:00:01
Message: <web.4f3a67de114402c12e3764520@news.povray.org>
Hi,

so, i got a line for writing an array,  it's ok for this,
and the point are in one order (first to the last):

#write (Data, array_name[V],",\n")

But, i want an array with an inverse order (last to the first pt), and for
writing the same reverse array , with Reverse_Array, it's not really ok. There
is an output file, and it's possible to read it, but points are not where i
want...

#write (Data, Reverse_Array(array_name)array_name[V],",\n")

Maybe it's not the good macros for manipulating arrays in this case, or i use it
badly ?


Albun


Post a reply to this message

From: Roman Reiner
Subject: Re: Writing array in inverse order
Date: 14 Feb 2012 10:55:01
Message: <web.4f3a83107f3bbcef3ece0fa0@news.povray.org>
"Albun" <nomail@nomail> wrote:
> Hi,
>
> so, i got a line for writing an array,  it's ok for this,
> and the point are in one order (first to the last):
>
> #write (Data, array_name[V],",\n")
>
> But, i want an array with an inverse order (last to the first pt), and for
> writing the same reverse array , with Reverse_Array, it's not really ok. There
> is an output file, and it's possible to read it, but points are not where i
> want...
>
> #write (Data, Reverse_Array(array_name)array_name[V],",\n")
>
> Maybe it's not the good macros for manipulating arrays in this case, or i use it
> badly ?
>
>
> Albun

I don't know those macros you're using, but if

#write (Data, array_name[V],",\n")

works as expected, then

#write (Data, array_name[N-1-V],",\n")

should do what you want (where N is the number of elements in your array).

Hope that helps,
Regards Roman


Post a reply to this message

From: Albun
Subject: Re: Writing array in inverse order
Date: 14 Feb 2012 16:05:01
Message: <web.4f3acb537f3bbceff6e192fb0@news.povray.org>
It's Okay, Wizard of PoV...


Post a reply to this message

From: Roman Reiner
Subject: Re: Writing array in inverse order
Date: 15 Feb 2012 08:45:01
Message: <web.4f3bb6037f3bbcef3ece0fa0@news.povray.org>
"Albun" <nomail@nomail> wrote:
> It's Okay, Wizard of PoV...

Lol, thanks! Glad I could help :)


Post a reply to this message

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