POV-Ray : Newsgroups : povray.general : Types of datas in array : Re: Types of datas in array Server Time
26 Apr 2024 20:02:23 EDT (-0400)
  Re: Types of datas in array  
From: Le Forgeron
Date: 23 Sep 2018 05:05:50
Message: <5ba7576e$1@news.povray.org>
Le 23/09/2018 à 11:02, kurtz le pirate a écrit :
> Hi,
> 
> I have declared this simple array :
>   #declare MyArray  = array[n][3];
> 
> Then, i put some value on it :
> 
>   #declare MyArray[i][0] = 1.23456; float is OK
>   #declare MyArray[i][1] = int(rand(alea)); integer is OK
>   #declare MyArray[i][2] = rgb <a,b,c>; color not accepted.
>                                         float
required.
> 
> So, *all* the elements of the array must be of the *same type* ?
> By design ?

Yes. But you have an array of array here.

#declare MyArray = array[3][n];
and you can have it your way.


#declare MyArray[0][i] = 1.23456;


Post a reply to this message

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