POV-Ray : Newsgroups : povray.general : Calculating / read from file vertices in mesh2 instead of typing them in? : Re: Calculating / read from file vertices in mesh2 instead of typing them i= Server Time
29 Apr 2024 03:41:11 EDT (-0400)
  Re: Calculating / read from file vertices in mesh2 instead of typing them i=  
From: defferl
Date: 29 Aug 2016 09:10:01
Message: <web.57c43361ef5390f8966b8c530@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Why, yes, of course there is a way. There always is. But it all depends
> on the format your data originally comes in.
>
> For instance, you could rewrite the above as:
>
>     vertex_vectors {
>       4,
>       #for(U,0,1)
>         #for(V,0,1)
>           <vx[U][V],vy[U][V],vz[U][V]>,
>         #end
>       #end
>     }
>
> though I would normally recommend generating the data as a single array
> of vectors, rather than three arrays of scalars, so that you could
> simply write:
>
>     vertex_vectors {
>       4,
>       #for(U,0,1)
>         #for(V,0,1)
>           v[U][V],
>         #end
>       #end
>     }
>
> Maybe this is sufficient to give you an idea or two; if not, let us know
> a few more details.

Thanks very much! I was looking for the first way, but your second suggestion is
too elegant not to use it (I can't help, it somehow reminds me of Python)! It's
already implemented and works like a charm.

Bald Eagle: Thanks too! It's actually not the original tea pot, just similar in
general shape. And yes, data already comes in mesh2-format, I just did not know
that there is such an easy way to fill it into the mesh2.

And of course thanks for all the "side-ideas" - if they don't solve the problem,
they usually are an inspiration for further work :)


Post a reply to this message

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