POV-Ray : Newsgroups : povray.general : analytic density? Server Time
16 Nov 2024 13:21:14 EST (-0500)
  analytic density? (Message 1 to 1 of 1)  
From: Dan Connelly
Subject: analytic density?
Date: 11 Jul 1998 07:53:48
Message: <35A7443C.F4932E88@flash.net>
I've been struggling somewhat with the density statement.
I want to specify the density in terms of arbitrary
analytic 1-d functions.

One way is via the generation of density files (df3)....
but this requires an external perl script ( use
pack "SSS" for the header and pack "C" for the data )
and is thus less flexible than in-line code.

Another may be via density maps, but density map bodies 
take density bodies, and it is unclear how to specify
a constant, fixed density in a density body.

Does anyone have a simple example?

idealized example (doesn't work -- constants aren't
valid density bodies) :

#macro F(Y) {
 (insert function here)
}

density {
  gradient y
  density_map {
    #declare Y  = 0;
    #declare dY = 0.01;
    #while (Y < 1 + dY/2)
      [Y F(Y)]
      #declare Y = Y + dY;
    #end
  }
}

thanks,
Dan

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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