POV-Ray : Newsgroups : povray.general : my_array[i][j][? ]=3D <1,2,3> : Re: my_array[i][j][? ]=3D <1,2,3> Server Time
5 Aug 2024 06:18:25 EDT (-0400)
  Re: my_array[i][j][? ]=3D <1,2,3>  
From: Christopher James Huff
Date: 31 Oct 2002 19:23:02
Message: <chrishuff-2DB5CB.19153831102002@netplex.aussie.org>
In article <web.3dc1b12b2dddf81788d4e3910@news.povray.org>,
 "Tony LaVigne" <ton### [at] xenomechanicscom> wrote:

> 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 "?"

Any number from 0 to 3.


> 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;

Well, a vector is not an array, and an array is not a vector. You need 
to use an array of vectors or set each component to a different array 
element. And you are reserving 4 elements, you only need 3.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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