POV-Ray : Newsgroups : povray.binaries.images : df3 creation revisited ... : df3 creation revisited ... Server Time
7 Aug 2024 05:22:48 EDT (-0400)
  df3 creation revisited ...  
From: David El Tom
Date: 26 May 2006 14:16:30
Message: <447745fe@news.povray.org>
playing with media and clouds, I tried to write a macro to create binary
df3 files from within SDL.

Of cause I failed 'cause it seems to be unpossible to write a binary
zero to a file (will allways be interpreted as end of string).

I renembered a macro created by Gilles Tran (makeclouds) which included
to render a series of images corresponding to slices of the density
volume and merging these images with an external program together.

In order to simplify this approach I wrote my own macro, which writes a
density file in ASCII format and convert it with a tiny PERL script into
the binary df3 format.

Eventhough it still needs an external script, I think it's a more
versatile approach adressing the same problem. There is no more need to
render slices anymore; instead of this you get only one file which have
to be converted. As this file is pure ASCII it can be converted easely
without writing a program which have to handle image formats and data.

OUTLINE:
The macro itself takes a pre-declared pigment as input. Together with
the file name to write to and the voxel resolution, the corners of
density extents are specified.
The pigment is turned into a vector function which is evaluated for the
midpoint of every voxel. The resulting color value will then be
interpreted as density by means of the .gray operator and written to the
ascii file.

I post the macro together with the PERL script in p.b.s

the image shows just a simple test:

generation of the ascii density file (90x30x60 = 162000 voxels) : 10s
conversion to binary df3 : < 1s

comments, critics and suggestions for improvment are welcome (as ever)

... dave


Post a reply to this message


Attachments:
Download 'df3_cloud.jpg' (15 KB)

Preview of image 'df3_cloud.jpg'
df3_cloud.jpg


 

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