POV-Ray : Newsgroups : povray.windows : Nested While Loops Bug? Problem with arrays? Server Time
28 Jul 2024 16:17:18 EDT (-0400)
  Nested While Loops Bug? Problem with arrays? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Jeffrey H  Zimmer
Subject: Nested While Loops Bug? Problem with arrays?
Date: 18 Oct 1998 07:22:23
Message: <3629c15f.0@news.povray.org>
Downloaded and began playing with 3.1 recently.  The new arrays look like a
great addition (not to mention the new editor).  However I'm having problems
initializing a two-dimensional array (128 x 128) with vectors using a nested
while loop (one for x, the other for y).  Has anyone else dealt with this?

Thanks,
Jeff


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 18 Oct 1998 17:48:19
Message: <362A53E9.7FF43F2@flash.net>
Please post your code here -- there are several errors
you could be making (for example, using indices from 1
to 128 instead of 0 to 127), but it is impossible to tell
without seeing the code.

Dan

Jeffrey H. Zimmer wrote:
> 
> Downloaded and began playing with 3.1 recently.  The new arrays look like a
> great addition (not to mention the new editor).  However I'm having problems
> initializing a two-dimensional array (128 x 128) with vectors using a nested
> while loop (one for x, the other for y).  Has anyone else dealt with this?
> 
> Thanks,
> Jeff

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Remco de Korte
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 18 Oct 1998 19:44:09
Message: <362A7DC0.B12C5733@xs4all.nl>
Jeffrey H. Zimmer wrote:
> 
> Downloaded and began playing with 3.1 recently.  The new arrays look like a
> great addition (not to mention the new editor).  However I'm having problems
> initializing a two-dimensional array (128 x 128) with vectors using a nested
> while loop (one for x, the other for y).  Has anyone else dealt with this?
> 
> Thanks,
> Jeff

I'm absolutely no POV-expert but could it have something to do with the size of
the array? Perhaps POV uses a stack or something like that. I don't know: is
there a maximum size (oops, didn't read the docs obviously....)

Remco


Post a reply to this message

From: Sally Rothenberg
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 20 Oct 1998 21:17:20
Message: <362d2810.0@news.povray.org>
Jeffrey,

I'm not sure this is the same problem but I noticed I can't seem to write to
a single
element in my UV lattice (2 dim array) of vectors, although I can read:

    #local nx = clat[U][V].x;

My workaround was:

     #local clat[U][V] = <cc+1,0,0>;

If you are initializing in a nested loop, you might try:

   #local clat[U][V] = <xvalue,yvalue,zvalue>;

If this has something to do with my using version 3.1 rather than 3.1a, I'd
sure like to
know about it !

Hope this helps,
Sally

Jeffrey H. Zimmer wrote in message <3629c15f.0@news.povray.org>...
>Downloaded and began playing with 3.1 recently.  The new arrays look like a
>great addition (not to mention the new editor).  However I'm having
problems
>initializing a two-dimensional array (128 x 128) with vectors using a
nested
>while loop (one for x, the other for y).  Has anyone else dealt with this?
>
>Thanks,
>Jeff
>
>


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 20 Oct 1998 22:43:25
Message: <362D3C0D.CD65EB8F@flash.net>
There is a bug in the vector code for dimensions other
than 2.  This is a known, and long time, problem.  I've
played around with the source code a bit in an attempt
to find the error -- it's clear it is getting confused
about the dimensionality of the vector (in the case
of 2-d), but I didn't find the precise error.

A manifestation of this is the following won't work :

#declare UV = <1, 2>;
#declare V  = uv.v;

For dimension larger than 3, there are other problems.

Dan

P.S. I believe I've seen the correction posted somewhere,
but I am not sure where.



Sally Rothenberg wrote:
> 
> Jeffrey,
> 
> I'm not sure this is the same problem but I noticed I can't seem to write to
> a single
> element in my UV lattice (2 dim array) of vectors, although I can read:
> 
>     #local nx = clat[U][V].x;
> 
> My workaround was:
> 
>      #local clat[U][V] = <cc+1,0,0>;
> 
> If you are initializing in a nested loop, you might try:
> 
>    #local clat[U][V] = <xvalue,yvalue,zvalue>;
> 
> If this has something to do with my using version 3.1 rather than 3.1a, I'd
> sure like to
> know about it !
> 
> Hope this helps,
> Sally
> 
> Jeffrey H. Zimmer wrote in message <3629c15f.0@news.povray.org>...
> >Downloaded and began playing with 3.1 recently.  The new arrays look like a
> >great addition (not to mention the new editor).  However I'm having
> problems
> >initializing a two-dimensional array (128 x 128) with vectors using a
> nested
> >while loop (one for x, the other for y).  Has anyone else dealt with this?
> >
> >Thanks,
> >Jeff
> >
> >

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 21 Oct 1998 03:50:06
Message: <362D83F2.2DF45862@flash.net>
Dan Connelly wrote:
> 
> There is a bug in the vector code for dimensions other
> than 2.

This should be 3.


-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Nathan Kopp
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 22 Oct 1998 15:46:15
Message: <362F7D1F.A62AC804@ltu.edu>
The two-dimension vector bug is well known (but for some reason not yet
fixed).  I am not familear with problems with dimensions greater than
three, though.  Could you provide details?

-Nathan Kopp

Dan Connelly wrote:
> 
> There is a bug in the vector code for dimensions other
> than 2.  This is a known, and long time, problem.  I've
> played around with the source code a bit in an attempt
> to find the error -- it's clear it is getting confused
> about the dimensionality of the vector (in the case
> of 2-d), but I didn't find the precise error.
> 
> A manifestation of this is the following won't work :
> 
> #declare UV = <1, 2>;
> #declare V  = uv.v;
> 
> For dimension larger than 3, there are other problems.
> 
> Dan
> 
> P.S. I believe I've seen the correction posted somewhere,
> but I am not sure where.
> 
> Sally Rothenberg wrote:
> >
> > Jeffrey,
> >
> > I'm not sure this is the same problem but I noticed I can't seem to write to
> > a single
> > element in my UV lattice (2 dim array) of vectors, although I can read:
> >
> >     #local nx = clat[U][V].x;
> >
> > My workaround was:
> >
> >      #local clat[U][V] = <cc+1,0,0>;
> >
> > If you are initializing in a nested loop, you might try:
> >
> >    #local clat[U][V] = <xvalue,yvalue,zvalue>;
> >
> > If this has something to do with my using version 3.1 rather than 3.1a, I'd
> > sure like to
> > know about it !
> >
> > Hope this helps,
> > Sally
> >
> > Jeffrey H. Zimmer wrote in message <3629c15f.0@news.povray.org>...
> > >Downloaded and began playing with 3.1 recently.  The new arrays look like a
> > >great addition (not to mention the new editor).  However I'm having
> > problems
> > >initializing a two-dimensional array (128 x 128) with vectors using a
> > nested
> > >while loop (one for x, the other for y).  Has anyone else dealt with this?
> > >
> > >Thanks,
> > >Jeff
> > >
> > >
> 
> --
> http://www.flash.net/~djconnel/


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 22 Oct 1998 22:36:49
Message: <362FDD7B.88238E32@flash.net>
From :

news://news.povray.org/360cbb8f.0%40news.povray.org

#declare a = <1, 2, 3, 4>;

yields an error.

Dan

Nathan Kopp wrote:
> 
> The two-dimension vector bug is well known (but for some reason not yet
> fixed).  I am not familear with problems with dimensions greater than
> three, though.  Could you provide details?
> 
-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Nathan Kopp
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 23 Oct 1998 01:46:59
Message: <363009EA.81077218@ltu.edu>
Dan Connelly wrote:
> 
> #declare a = <1, 2, 3, 4>;
> 
> yields an error.
> 

That's true, but

#declare a = color<1, 2, 3, 4>;

works just fine.  This also works for 5-d vectors.  Maybe it should be
changed, but it was done intentionally, so it's not really a 'bug'.

-Nathan Kopp


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 23 Oct 1998 02:47:38
Message: <36301847.A9FB022A@flash.net>
It is a bug, intentional or otherwise, if it is inconsistent with the
documentation, and I don't know where the documentation indicates
that 4-d vectors must be associated with the color keyword.

What is the purpose of such a restriction?

Dan

Nathan Kopp wrote:
> 
> Dan Connelly wrote:
> >
> > #declare a = <1, 2, 3, 4>;
> >
> > yields an error.
> >
> 
> That's true, but
> 
> #declare a = color<1, 2, 3, 4>;
> 
> works just fine.  This also works for 5-d vectors.  Maybe it should be
> changed, but it was done intentionally, so it's not really a 'bug'.
> 
> -Nathan Kopp

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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