POV-Ray : Newsgroups : povray.general : my_array[i][j][? ]=3D <1,2,3> : Re: my_array[i][j][? ]=3D3D <1,2,3> Server Time
5 Aug 2024 06:16:45 EDT (-0400)
  Re: my_array[i][j][? ]=3D3D <1,2,3>  
From: Tor Olav Kristensen
Date: 31 Oct 2002 18:05:03
Message: <web.3dc1b61ea04f59538149fba0@news.povray.org>
Tony LaVigne wrote:
>Hello,
>As you can see this is an array question.
>I want to insert  3 elements ( a 3-D vector) into an array, something like;
>
>#declare X = array[10][10][4];
>#declare my_array[i][j][?]= vcross(A,B);
>
>What would go in place of the "?"
>
>
>Currently I have to declare them one at at time, something like;
>
>#declare X = array[10][10][4];
>#declare D = vcross(A,B);
>#declare my_array[i][j][1]= D.x;
>#declare my_array[i][j][2]= D.y;
>#declare my_array[i][j][3]= D.z;

How about this ?


..
..
..
#declare vA = <1, 3, 2>;
#declare vB = <-4, 7, -2>;
..
..
..
#declare YourArray = array[10][10]
..
..
..
#declare YourArray[6][8] = vcross(vA, vB);
#declare YourArray[6][9] = vcross(vC, vD);
..
..
..


Tor Olav


Post a reply to this message

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