POV-Ray : Newsgroups : povray.advanced-users : ?? Server Time
4 Nov 2024 21:21:56 EST (-0500)
  ?? (Message 1 to 4 of 4)  
From: Noah A
Subject: ??
Date: 30 Jun 1999 18:43:02
Message: <377A9D4D.9AAED50D@powersurfr.com>
what is this array thing and how's it work?


Post a reply to this message

From: Ken
Subject: Re: ??
Date: 30 Jun 1999 19:05:30
Message: <377AA27A.32D0F90F@pacbell.net>
Noah A wrote:
> 
> what is this array thing and how's it work?

An array is a method of storing data and then later using that stored date
within a function or operation. For example I could predefine a string of
numbers that I want to pass to a pigment statment. I could use an array
to store those string and then later use them in the following way:


#declare Dnum = 6;
#declare Data = array [Dnum][5]
{ {0.60, 0.50, 0.3, 0.1, 0.66},
  {0.70, 0.13, 0.4, 0.3, 0.55},
  {0.60, 0.17, 0.5, 0.2, 0.44},
  {0.70, 0.25, 0.6, 0.4, 0.33},
  {0.60, 0.31, 0.7, 0.6, 0.22},
  {0.70, 0.50, 0.8, 0.5, 0.11}}

 #declare I=0;
  #while (I < Dnum)
#declare Acid_Trip = 
 pigment {
  rgbft < Data[I][0], Data[I][1], Data[I][3], Data[I][4], Data[I][5] >
  }
  #declare I =I + 1;
 #end


  I could also use similar data to translate an object to a fixed number
of points in space like so:

#declare Dnum = 6;
#declare Data = array [Dnum][3]
{ {  10.60, -10.50,  10.3},
  { -10.70,  10.13, -10.4},
  {  10.60, -10.17,  10.5},
  { -10.70,  10.25, -10.6},
  {  10.60, -10.31,  10.7},
  { -10.70,  10.50, -10.8}}

 #declare I = 0;
  #while (I < Dnum)
    sphere { < Data[I][0], Data[I][1], Data[I][3] >, 1
   }
  #declare I = I + 1;
 #end

  The above example should produce six spheres located in space corrosponding
to the numbers stored in the array.

  There are many other possibilities with this function and I have only
just begun to explore them myself. In fact it is quite possible that my
syntax is wrong but the basic idea is correct.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Noah A
Subject: Re: ??
Date: 1 Jul 1999 16:45:47
Message: <377BD34C.E8E286F1@powersurfr.com>
thanks unky ken

Ken wrote:

> Noah A wrote:
> >
> > what is this array thing and how's it work?
>
> An array is a method of storing data and then later using that stored date
> within a function or operation. For example I could predefine a string of
> numbers that I want to pass to a pigment statment. I could use an array
> to store those string and then later use them in the following way:
>
> #declare Dnum = 6;
> #declare Data = array [Dnum][5]
> { {0.60, 0.50, 0.3, 0.1, 0.66},
>   {0.70, 0.13, 0.4, 0.3, 0.55},
>   {0.60, 0.17, 0.5, 0.2, 0.44},
>   {0.70, 0.25, 0.6, 0.4, 0.33},
>   {0.60, 0.31, 0.7, 0.6, 0.22},
>   {0.70, 0.50, 0.8, 0.5, 0.11}}
>
>  #declare I=0;
>   #while (I < Dnum)
> #declare Acid_Trip =
>  pigment {
>   rgbft < Data[I][0], Data[I][1], Data[I][3], Data[I][4], Data[I][5] >
>   }
>   #declare I =I + 1;
>  #end
>
>   I could also use similar data to translate an object to a fixed number
> of points in space like so:
>
> #declare Dnum = 6;
> #declare Data = array [Dnum][3]
> { {  10.60, -10.50,  10.3},
>   { -10.70,  10.13, -10.4},
>   {  10.60, -10.17,  10.5},
>   { -10.70,  10.25, -10.6},
>   {  10.60, -10.31,  10.7},
>   { -10.70,  10.50, -10.8}}
>
>  #declare I = 0;
>   #while (I < Dnum)
>     sphere { < Data[I][0], Data[I][1], Data[I][3] >, 1
>    }
>   #declare I = I + 1;
>  #end
>
>   The above example should produce six spheres located in space corrosponding
> to the numbers stored in the array.
>
>   There are many other possibilities with this function and I have only
> just begun to explore them myself. In fact it is quite possible that my
> syntax is wrong but the basic idea is correct.
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net


Post a reply to this message

From: Matt Giwer
Subject: Re: ??
Date: 6 Jul 1999 02:56:42
Message: <3781A8C3.8E7057DF@giwersworld.org>
> what is this array thing and how's it work?

	How it works depends upon what you are going to do with it. An
array, like a vector is simply an ordered set of numbers. So is
the image POV produces for that matter. 

	But, once implemented as standard math vectors, Standard array
manipuation functions can be used. In fact, it is the
implementaion of the manipulation functions, the is most
important.

-- 
<blink>-------please--don't-----------------</blink>

http://www.giwersworld.org/artii/
http://www.giwersworld.org/artiii/

Finally up on 99/06/22 updated 06/30


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

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