POV-Ray : Newsgroups : povray.advanced-users : --( IDENTIFIER - RValue )-- : Re: --( IDENTIFIER - RValue )-- Server Time
29 Jul 2024 08:19:02 EDT (-0400)
  Re: --( IDENTIFIER - RValue )--  
From: ABX
Date: 26 Mar 2003 02:29:29
Message: <psk28v4f7qk65qae2qsulu13ri0ckvs3ck@4ax.com>
On Tue, 25 Mar 2003 22:53:37 -0500, "-g00t©-" <Ano### [at] Hotmailcom> wrote:
> Is there a way to modify arrays?

Of course.

> (Like changing a Value of Only one Cell?)
> It doesn't seems to be possible. This why I'm using Parse_Strings. When I'm
> using a 20*20*20 3D grid It is 8000 operation of creating a new sub array.

below are all features built-in POV-Ray SDL

#declare MyArray = array[3][2]; // define dimensions
#declare MyArray[0][0] = 0;     // fill content
#declare MyArray[0][1] = 1;     // fill content
#declare MyArray[1][0] = 2;     // fill content
#declare MyArray[1][1] = 3;     // fill content
#declare MyArray[2][0] = 4;     // fill content
#declare MyArray[2][1] = 5;     // fill content
#declare Value = MyArray[1][0]; // get value from value
// refill content in loop;
#declare D1 = 0;
#while (D1 < dimension_size( MyArray , 1 ) )
  #declare D2 = 0;
  #while (D2 < dimension_size( MyArray , 2 ) )
    #declare MyArray[D1][D2] = sin(D1+D2); // any value
    #declare D2 = D2 + 1;
  #end
  #declare D1 = D1 + 1;
#end
// read content in loop;
#declare D1 = 0;
#while (D1 < dimension_size( MyArray , 1 ) )
  #declare D2 = 0;
  #while (D2 < dimension_size( MyArray , 2 ) )
    #debug "MyArray["
    #debug str(D1,0,0)
    #debug ","
    #debug str(D2,0,0)
    #debug "]="
    #debug str(MyArray[D1][D2],0,-1)
    #debug "\n"
    #declare D2 = D2 + 1;
  #end
  #declare D1 = D1 + 1;
#end

Apart from built-in features there is also standard include file called
"arrays.inc" with set of macros to operate on arrays. There is separate section
about it in documentation.

> Then Read/Write with Parse_Strings is highly time consuming.

No need for it IMO.

> Where Should I post a JPEG of the project?

in povray.binaries.images group as stated in
http://news.povray.org/povray.announce.frequently-asked-questions/

ABX


Post a reply to this message

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