POV-Ray : Newsgroups : povray.binaries.images : Media Experiments : Re: Media Experiments Server Time
5 Nov 2024 16:41:42 EST (-0500)
  Re: Media Experiments  
From: Lonnie
Date: 13 Jul 2005 06:55:00
Message: <web.42d4f290f5ca07c6328c25a60@news.povray.org>
Mike Kost <con### [at] povraytashcorpnet> wrote:
> Lonnie wrote:
> > I am growing a bit more bold with media and photon mapping, but density
> > files elude me.  What kind of editor do I use to produce one, or must it
> > be done with a programming language?
>
> As best I've found so far, you've got to construct a density file using a
> self-written program. There's a few things that are a bit more advanced,
> but it's not a nice GUI by a long shot. Most of the material out on the web
> is fairly self-driven & command line. Here's a few I've stumbled on in the
> past:
>
> http://www.povray.org/documentation/view/3.6.1/374/
>     (DF3 File format vaguely described)
> http://astronomy.swin.edu.au/~pbourke/povray/df3/
>     (C code snippet)
> http://www.oyonale.com/ressources/english/sources13.htm
>     (Using .df3 files to make clouds)
>
> Mike K
> --
> http://povray.tashcorp.net

Thanks Mike.  The cloud site was helpful and interesting.  I have used
JustBASIC 1.0 to write a df3 file that produces random density (kinda like
static on a TV, but in 3D.)  Most programming languages would do, as long
as they can write individual bytes in a binary file.

  open "myfile.df3" for binary as #myfile

  print #myfile, chr$(0)  'This is the header, space is 20x20x20, or 8000
bytes
  print #myfile, chr$(20)
  print #myfile, chr$(0)
  print #myfile, chr$(20)
  print #myfile, chr$(0)
  print #myfile, chr$(20)

  for t=1 to 8000         'This writes the body
      print #myfile, chr$(int(rnd(1)*255))
  next
  close #myfile

Imagine my suprise when this worked on the first try.


Post a reply to this message


Attachments:
Download 'testdensity.jpg' (8 KB)

Preview of image 'testdensity.jpg'
testdensity.jpg


 

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