POV-Ray : Newsgroups : povray.binaries.images : Dan's double density algorithm? (16kB) : Dan's double density algorithm? (16kB) Server Time
4 Oct 2024 23:16:18 EDT (-0400)
  Dan's double density algorithm? (16kB)  
From: Greg M  Johnson
Date: 7 Feb 1999 17:50:14
Message: <36be18a6.0@news.povray.org>
In a separate post about flames and media, Dan gave advice for getting a
density of y(1-y) which is attached at the end.
I tried Dan's algorithm and I think that instead I got y^2.
My code is:

interior {
         media {
               emission rgb 1 //<0.75,0.75,0.75>
               intervals 30
               samples 10, 10
               confidence 0.9999
               variance 1/1000
               density {
                      gradient y
                      translate -y
                      }
               density {
                       gradient y
                       }
              }
         }

Applying this to an object at hand, attached below, I think that you can
see that it clearly looks like y^2, not y(1-y).

-------BEGIN QUOTE FROM DAN CONNELLY----------------

But I can explain densities.

Basically each density statment in series multiplies the net density by
its values.

So

density {
  gradient y
}

results in density, over the interval y from 0 to 1, equal to y.

But :

density {
  gradient y
}
density {
  gradient y
}

results in density, over the interval y from 0 to 1, equal to y^2.
(this would be better done using poly_wave 2)

And,

density {
  gradient y
  translate -y
}
density {
  gradient y
}

yields density of y (1 - y) over the same interval.

So "shaping" the media is a matter of using the densities which
apply the appropriate zero boundary conditions with the appropriate
transitions.

Dan


Post a reply to this message


Attachments:
Download 'us-ascii' (4 KB)

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