|
|
While working on my vegetation macros I cooked up a simple set of macros
(of which actually only one needs to called by the User) which converts
either a float, uv-vector or xyz-vector into an appropriate filename.
Instead of just using the numbers 0 to 9 as digits, the alphabet is used
as well,
enlargening the possibilities.
Its just a method to easily create external arrays. While in POV, you
don't need to bother about the filenames, you just work as if you'd
use array-indices (though instead of Array[X][Y][Z] you'd use
Get_DNG_File(<X,Y,Z>), which generates the coded filename).
What's the actual use?
I needed a VERY variable array-storing-method, to keep track of
how many objects were placed in a given confinement. Since I have
no way of telling how many objects actually fit into a grid, and
reparsing arrays all the time is quiet time-consuming, I thought about
moving the data to disk. A simple way of adding whenever I need
to, though deleting is a more difficult task, by just appending to the
file...
So, if I'd want a 1D-Array (which is actually 2D, cause in each
file I can put as many float/boolean/vector/string as I like), I can
easily use 2.251.875.390.625 different filenames.
Its only 3.675 for a 3D array (since the naming is xx_xx_xx.end),
but that is probably sufficient for any POV-User scripting in POV...
Comment if you like, use if you want to. I don't think the average
POVer really needs it, but since its easy to use, I thought I'd make
it available to the public, just in case...
You can find the file (in a ZIP along with an example file) in my
downloads section.
--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
Post a reply to this message
|
|