POV-Ray : Newsgroups : povray.beta-test : Reverse_Array Bug : Re: Reverse_Array Bug Server Time
4 Nov 2024 13:45:35 EST (-0500)
  Re: Reverse_Array Bug  
From: Ron Parker
Date: 29 Sep 2001 22:23:09
Message: <slrn9rd0gg.7nr.ron.parker@fwi.com>
On Sat, 29 Sep 2001 16:24:20 +0200, Martial wrote:
>in array.inc
>//--------------------------------------
>#macro Reverse_Array(Array)
>    #local J = 0;

     #local N = dimension_size(Array, 1) - 1;  // <-- better correction

>    #while(J < floor(N/2))
>        #local Temp = Array[J]
>        #local Array[J] = Array[N-J] 
>        #local Array[N-J] = Temp 
>        #local J = J + 1;
>    #end
>#end


-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbf 1}hollow interior{media{emission 3-T}}}#end 
Z(-x-x.2x)camera{location z*-10rotate x*90normal{bumps.02scale.05}}


Post a reply to this message

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