POV-Ray : Newsgroups : povray.binaries.images : Dan's double density algorithm? (16kB) Server Time
5 Oct 2024 01:19:55 EDT (-0400)
  Dan's double density algorithm? (16kB) (Message 1 to 2 of 2)  
From: Greg M  Johnson
Subject: Dan's double density algorithm? (16kB)
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)

From: Dan Connelly
Subject: Re: Dan's double density algorithm? (16kB)
Date: 7 Feb 1999 22:30:27
Message: <36BD08C1.97B10708@flash.net>
Whoops!  My fault.....
that should be "translate y", not "translate -y".

I made the classic mistake of translating the observer rather than the
field.... what I want is the interval from (-1,0) to be "boosted" to
(0,1), which requires a +1 translating.

Sorry...
Dan


"Greg M. Johnson" wrote:
> 
> 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
>                        }
>               }
>
-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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