while trying to model something hairy, I came up with a small PERL
script that parses an include file with mesh data in mesh2 format and
creates an include file with arrays of evenly distributed points on the
mesh and corresponding normals as well as uv informations (if aviable).
Why an external script, you may ask.
The answer is, that I found no way to access the internal data of a
declared mesh. So I would had to write a parser in SDL to parse the mesh
include file.
PERL seemed the better choice to me as it is made to analyse and process
text files (Practical Extraction and Report Language), also I found
that there is an significant speed difference in using this script and
parsing the result in POVRay compared with pure SDL.
One of the early versions of this script createt an include with over
1.7 million points and normals form a mesh with roughly 68000 facettes
in ca. 40 sec.
know issuses are high memory consumption if placing huge numbers of points.
use and / or modify at your will.
would be nice if you drop me a message if you have suggestions for
improvments.
... dave
Post a reply to this message
Attachments:
Download 'us-ascii' (20 KB)
|