POV-Ray : Newsgroups : povray.general : Writing array in inverse order : Re: Writing array in inverse order Server Time
29 Jul 2024 10:20:30 EDT (-0400)
  Re: Writing array in inverse order  
From: Roman Reiner
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

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