POV-Ray : Newsgroups : povray.beta-test : Initialisation of a 4-vector array Server Time
3 Jul 2022 05:30:49 EDT (-0400)
  Initialisation of a 4-vector array (Message 1 to 4 of 4)  
From: mm
Subject: Initialisation of a 4-vector array
Date: 24 Jan 2002 05:55:55
Message: <3c4fe83b@news.povray.org>
pov 3.5 b 10

win

With the following, w4[0].t is not set correctly.

w4[1].t and w4[2].t are set correctly.

Curiously, this does not happen with an array of only 2 elements.



  #local a = array[3] {0.123, 0.456, 0.789}
  #local w = array[3] {x, y, z}
  #local w4 = array[3]

  #local ix = 0;
  #while (ix<3)
    #declare w4[ix] = a[ix]*t + w[ix];
    #debug concat(str(a[ix], 6, 3), " ", str(w4[ix].t,6,3),"\n")
    #local ix=ix+1;
  #end


Post a reply to this message

From:
Subject: Re: Initialisation of a 4-vector array
Date: 24 Jan 2002 06:09:56
Message: <nbqv4u431tn4ve7pa3ca2dndn8qd0hfbq1@4ax.com>
On Thu, 24 Jan 2002 11:58:13 +0100, "mm" <mmo### [at] wanadoofr> wrote:
> pov 3.5 b 10
> win

please read point 2 and 3 of 1.11.8 in documentation

> With the following, w4[0].t is not set correctly.

your example outputs two columns with content of a[] on my machine
so I can't confirm described behaviour but ...

>    #declare w4[ix] = a[ix]*t + w[ix];

... when I replace above with
#declare w4[ix] = (a[ix]*t) + w[ix];

then first number in second column is strange: sometimes proper, sometimes
veeery long, and sometimes "-1.#QO".

POV 3.5 b 10.icl on PII 233 128 MB with NT 4 Sp 6

ABX


Post a reply to this message

From: Felix Wiemann
Subject: Re: Initialisation of a 4-vector array
Date: 24 Jan 2002 06:18:12
Message: <3c4fed74$1@news.povray.org>
> With the following, w4[0].t is not set correctly.
>
> w4[1].t and w4[2].t are set correctly.

Confirmed.

> Curiously, this does not happen with an array of only 2 elements.

Confirmed.

It seems to be a problem with adding 4D and 3D-vectors. With 4D-vectors
used in array w, it doesn't occur. When using {x + 0, y + 0, z + 0}
instead of {x, y, z}, the numbers are:
0.123 -1.#QO
0.456  0.456
0.789  0.789
When rendering with str(w4[ix].x,6,3) and then rendering with
str(w4[ix].t,6,3), it's one time correctly calculated. The error comes
back when rendering the same scene again.


Post a reply to this message

From: Felix Wiemann
Subject: Re: Initialisation of a 4-vector array
Date: 24 Jan 2002 06:23:14
Message: <3c4feea2@news.povray.org>
> > With the following, w4[0].t is not set correctly.
> >
> > w4[1].t and w4[2].t are set correctly.
>
> Confirmed.

I forgot to say that the number I get is very long.

Intel P3 600 Mhz, Win 98 SE, 128 MB, POV-Ray WinBeta 10


Post a reply to this message

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