POV-Ray : Newsgroups : povray.advanced-users : vturbulence in functions? : Re: vturbulence in functions? Server Time
29 Jul 2024 12:21:16 EDT (-0400)
  Re: vturbulence in functions?  
From: Christopher James Huff
Date: 28 Mar 2002 17:15:37
Message: <chrishuff-B79BBC.17162328032002@netplex.aussie.org>
In article <3ca377f3@news.povray.org>,
 "Rune" <run### [at] mobilixnetdk> wrote:

> Turbulence returns a vector for each point in space. f_noise3d returns a
> value for each point in space and thus can't simulate turbulence.

Turbulence is based on 3D noise. Just use 3 calls to f_noise3d(), each 
with a random offset.


> Besides, turbulence has a level of chaos defined by the number of octaves,
> while the noise function has no level of chaos at all. This is not so
> important in my case though. The important thing is that I need an even
> distribution so that the turbulence is equally strong in all directions.

Use more noise3d() calls at different scales. That is exactly what the 
octaves parameter does.
Look up some pages on Perlin noise for more ideas...

This will be slower than a built-in function, of course. You might try 
and see if you can get the right result by using the function as a 
pattern and turbulating the pattern, then using the pattern as a 
function.

function {pattern {function {FUNCTION} turbulence...}}
FUNCTION will get the turbulated versions of the xyz parameters.

You could also do this to use those values in addition to the 
unturbulated values in a separate function:

#declare turb_x = function {pattern {function {x} turbulence...}}
#declare turb_y = function {pattern {function {y} turbulence...}}
#declare turb_z = function {pattern {function {z} turbulence...}}

The distance turbulence pushes a point (the output of the vturbulence() 
function) would be: < turb_x(x) - x, turb_y(y) - y, turb_z(z) - z>

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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