POV-Ray : Newsgroups : povray.windows : Nested While Loops Bug? Problem with arrays? Server Time
28 Jul 2024 18:22:31 EDT (-0400)
  Nested While Loops Bug? Problem with arrays? (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
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

From: Nathan Kopp
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 25 Oct 1998 00:41:01
Message: <36329D69.B50F77B@Kopp.com>
I agree that it should be changed.  The reason is probably that four- and
five- element vectors were originally intended for colors only.  However,
many users can probably think of far more uses.

Actually, fixing this 'bug' would require some changes to some of the
assumptions made by POV.  First, colors (4d or 5d vectors) and coordinates
(2d or 3d vectors) are considered different by POV.  Using one in place of
another usually generates errors.  This may not be the best way to handle
the issue, but it is what was chosen by the POV-Ray team long ago and
would require a bit of work to change.

-Nathan


Dan Connelly wrote:
> 
> 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


Post a reply to this message

From: Nathan Kopp
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 25 Oct 1998 00:43:55
Message: <36329E17.6F9044CF@Kopp.com>
One thing to add... this is basically a question of whether POV should be
a 'strongly typed' language or not.  In other words, should we allow
implicit conversions (color <-> vector) or not.

-Nathan


Post a reply to this message

From: Dan Connelly
Subject: Re: Nested While Loops Bug? Problem with arrays?
Date: 25 Oct 1998 05:56:56
Message: <363303C1.84E81FA7@flash.net>
Nathan Kopp wrote:
> 
> One thing to add... this is basically a question of whether POV should be
> a 'strongly typed' language or not.  In other words, should we allow
> implicit conversions (color <-> vector) or not.


I would leave the assignment of color status to the rgb* and/or
color keywords.

Vector->color conversions are trivial, but color->vector conversions
must be done with certain assumptions, such as rgbft.

But if there is no problem with vector<->color conversions,
why not allow them?  What is wrong with

  pigment { color rgb vrotate(<1, 0, 0>, <0, 0, clock*360>) }

or

  #local c = color rgb <1, 0, 0>;
  vlength(c)

for example?

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


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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