POV-Ray : Newsgroups : povray.general : Reading mesh2 data from file : Re: Reading mesh2 data from file Server Time
19 Apr 2024 17:04:35 EDT (-0400)
  Re: Reading mesh2 data from file  
From: Kima
Date: 3 Jul 2021 16:10:00
Message: <web.60e0c2f4c54a2bf0e75ac487d427f3e5@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Kima" <nomail@nomail> wrote:
> > Since a mesh is made of thousands or millions of triangles, it is tidy to keep
> > the data in separate files and include them in the .pov file whenever necessary.
> > I mean something like
> >
> > #declare Vertices = read from vertices.txt;
> > #declare Faces = read from faces.txt;
> > ...
> > fopen directive of POV-Ray reads the file into variables,
> > #read (FILE_HANDLE_IDENTIFIER,MyString,MyFloat,MyVect)
> >
> > I don't know if it works as vertices and faces are thousands/millions of
> > vectors.
>
> storing vertex and face coords/points in separate files etc should/would work.
> however, have you considered only doing "the work" once?  that is, create an
> ..inc file from your '*.txt' files instead and simply use that from then on?
> have attached an example.
>
>
> regards, jr.

I admit it is odd. I create the vertices and faces by a script in C. I save the
vertex and face vectors within loops directly into files by fprintf. Then, I get
the numbers at the end of the loops. AT  this stage, I cannot append the numbers
at the beginning of the vectors saved into files.

Therefore, my output is two files and the corresponding numbers.


Post a reply to this message

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