POV-Ray : Newsgroups : povray.general : how to read a 2d uv vectors in pov-ray : Re: how to read a 2d uv vectors in pov-ray Server Time
1 Aug 2024 22:17:28 EDT (-0400)
  Re: how to read a 2d uv vectors in pov-ray  
From: lien0n
Date: 11 Apr 2005 22:35:00
Message: <web.425b335bdda292ef598059850@news.povray.org>
I tried on my computer. Only (1) works, and the last two cannot. When
working with the last two approach, same error message was given.
So it seems that i must use #undef temp to ensure temp is an undefined uv
vector variable inside each pass.

Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it lien0n who wrote:
>
> It's actually the "#local temp = <0,0>" line that's freaking it out. The
> #read directive is, for some reason, refusing to read data into a
> variable that currently contains a uv vector.
>
> However, if you omit that line, the #read works the first time (when
> 'temp' is undefined), and happily reads a uv vector into 'temp'. Then on
> the second pass, the #read directive refuses to read data into a
> variable that currently contains the uv vector it read on the previous
> pass.
>
> A few quick tests show that all these workrounds work:
>
> 1. Have 'temp' be undefined whenever the #read is invoked
>
>     #local i=0;
>     #while (i<Bottom_numUV)
>       #read (File,temp)
>       temp
>       #undef temp
>     #local i=i+1;
>     #end
>
> 2. Make 'temp' be a float whenever the #read is invoked
>
>     #local i=0;
>     #while (i<Bottom_numUV)
>       #local temp = 0;
>       #read (File,temp)
>       temp
>     #local i=i+1;
>     #end
>
> 3. Make 'temp' be a 3-vector whenever the #read is invoked
>
>     #local i=0;
>     #while (i<Bottom_numUV)
>       #local temp = <0,0,0>;
>       #read (File,temp)
>       temp
>     #local i=i+1;
>     #end
>
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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