POV-Ray : Newsgroups : povray.general : Array... Server Time
7 Aug 2024 13:14:39 EDT (-0400)
  Array... (Message 11 to 19 of 19)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: F Audet
Subject: Re: Array...
Date: 15 Oct 2001 11:46:05
Message: <3BCB03E4.6337B066@sympatico.ca>
I should have missed something, somewhere...

Is there a tutorial about arrays,  on the web ?

Thank you,               Alex


Post a reply to this message

From: JRG
Subject: Re: Array...
Date: 15 Oct 2001 14:15:46
Message: <3bcb27d2@news.povray.org>
Hi F.Audet, wasn't you who wrote:
>
>

>
> > On Sun, 14 Oct 2001 21:39:23 -0400, F.Audet wrote:
> > >I decided to do what I wanted to do in simulating an array
> > >with two #while loops, and it finally worked.
> > >But if you could see why the famous array
> > >did not work,  here is the code :
> >
> > Maybe something having to do with returning a local from a macro; this
might
> > have been a bug in 3.1 as well.  Try rewriting the macro like this:
> >
> > >
> > >#declare s1 = seed(1);
> > >#macro bin_01 ()
> > >  #if ( rand(s1) <= 0.5 )
> > >    object { nice_zero }
> > >  #else
> > >    object { nice_one }
> > >  #end
> > >#end
> >
>
> ... It does parse and trace,  but nothing appears on the screen.
> Messages: 1 frame level object; 1 infinite.   // my plane object !
> ... I think it is my fault,  cause I just tried,  a minute ago,  with
> a simple csg object,  without any kind of randomness and #local,
> and it doesn' t work anymore !
>
> in fact,  the following code doesn' t work at all...
> #declare YOUR_ARRAY = array[20][20]
> #declare i = 0;
> #while (i<20)
> #declare j=0;
> #while (j<20)
> #declare YOUR_ARRAY[i][j] = sphere { 0, 1 pigment { White }}
> #declare j=j+1;
> #end
> #declare i=i+1;
> #end
>
> Have I to put it into "object {YOUR_ARRAY}", or something like that ?!?
>
> Alex Pilot

I think you misunderstood what an array is. Just having 400 objects put in
an array does not mean that you get them traced!
If you want to put your 400 objects in a 20x20 units grid you have to add
the following code:

 #declare i = 0;
 #while (i<20)
#declare j=0;
#while (j<20)
object {YOUR_ARRAY[i][j] translate <-10 +i, 0 , -10+j>}
#declare j=j+1;
#end
#declare i=i+1;
#end

But probably it's me who has misunderstood you...

--
Jonathan.


Post a reply to this message

From: Warp
Subject: Re: Array...
Date: 15 Oct 2001 15:01:47
Message: <3bcb329a@news.povray.org>
JRG <jrg### [at] hotmailcom> wrote:
: I think you misunderstood what an array is.

  It is possible that someone who has no experience in programming may have
no notion what an "array" is in a programming language. The term "array"
has also another meaning in a different context and this may be the cause
of the confusion.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: F Audet
Subject: Re: Array...
Date: 15 Oct 2001 15:22:37
Message: <3BCB36A5.FD815ADF@sympatico.ca>


> JRG <jrg### [at] hotmailcom> wrote:
> : I think you misunderstood what an array is.
>
>   It is possible that someone who has no experience in programming may have
> no notion what an "array" is in a programming language. The term "array"
> has also another meaning in a different context and this may be the cause
> of the confusion.

 I thought the array function allowed to reproduce an object
into a grid system... I didn' t think about it in term of programming anymore.
Excuse me,  I misunderstood the reel functionality of an array.

Alex

>
>
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: JRG
Subject: Re: Array...
Date: 15 Oct 2001 15:26:10
Message: <3bcb3852@news.povray.org>
Then you just need this one:

#declare i = 0;
#while (i<20)
#declare j=0;
#while (j<20)
object {binary_01() translate <-10 +i, 0 , -10+j>}
#declare j=j+1;
#end
#declare i=i+1;
#end

Hope this helps,

--
Jonathan.


Post a reply to this message

From: F Audet
Subject: Re:that's ok
Date: 15 Oct 2001 20:24:44
Message: <3BCB7D73.EEE5DB3C@sympatico.ca>


> Then you just need this one:
>
> #declare i = 0;
> #while (i<20)
> #declare j=0;
> #while (j<20)
> object {binary_01() translate <-10 +i, 0 , -10+j>}
> #declare j=j+1;
> #end
> #declare i=i+1;
> #end
>
> Hope this helps,
>
> --
> Jonathan.

Yes,  I did it that way and
I think everything is OK by now...   Have a look at Binaries-images
to see what were the purpose of my requests.
......................."Virus_inc"............"F.Audet"...............................

Thank you very much for your responses,

                                                                   Alex


Post a reply to this message

From: KalleK
Subject: Re: Array...
Date: 17 Oct 2001 14:38:42
Message: <3bcdd032@news.povray.org>
> No,  I am still working with the 3.1 version because my computer
does
> not accept 800*600 screen minimum requirement...  I plan to solve
> this problem soon,  with a more recent computer...

Do you mean, Povray 3.5 (beta) doesn't run with 640*480 screen
resolution? (3.1g did some warning - is not designed to run under
800*600 - but it run) I'm a bit afraid about that message, I'm going
to use Povray 3.5 (when it's out) on a 640*480 screen.
Can someone tell me if that's true (or better: not true) - I tried
with beta 4, it worked (you could not press the ok-button of the
povlegal-screen - but it worked)
Or did I misunderstand you?

cukk


Post a reply to this message

From: Ben Chambers
Subject: Re: Array...
Date: 17 Oct 2001 18:41:19
Message: <3bce090f@news.povray.org>
"KalleK" <kal### [at] gmxde> wrote in message news:3bcdd032@news.povray.org...
> Do you mean, Povray 3.5 (beta) doesn't run with 640*480 screen
> resolution? (3.1g did some warning - is not designed to run under
> 800*600 - but it run) I'm a bit afraid about that message, I'm going
> to use Povray 3.5 (when it's out) on a 640*480 screen.
> Can someone tell me if that's true (or better: not true) - I tried
> with beta 4, it worked (you could not press the ok-button of the
> povlegal-screen - but it worked)
> Or did I misunderstand you?
>
> cukk

I just tried it.  It runs.

...Chambers


Post a reply to this message

From: KalleK
Subject: Re: Array...
Date: 18 Oct 2001 04:02:12
Message: <3bce8c84@news.povray.org>
> I just tried it.  It runs.

Phewww...

Thank you

cukk


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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