POV-Ray : Newsgroups : povray.general : Translating turbulence Server Time
6 Nov 2024 16:32:56 EST (-0500)
  Translating turbulence (Message 1 to 4 of 4)  
From: Skip Talbot
Subject: Translating turbulence
Date: 18 May 2004 14:17:39
Message: <40aa5343@news.povray.org>
Let's say you've got a sphere filled with media and a spherical density.
You add a turbulence warp and you get the same pattern each time.  You could
rotate or scale the density to make look a little different at different
angles, but the pattern of the turbulence remains the same.  Is there a way
to translate a turbulence warp so that it's sampling from a different part
of the pattern?

Skip Talbot


Post a reply to this message

From: ingo
Subject: Re: Translating turbulence
Date: 18 May 2004 14:40:28
Message: <Xns94EDD24F1E61Cseed7@news.povray.org>
in news:40aa5343@news.povray.org Skip Talbot wrote:

> Is there a way
> to translate a turbulence warp so that it's sampling from a different
> part of the pattern?
> 

Translate the spherical pattern to somewhere random, apply turbulence, 
translate the whole thing to the position you want.

Changing the seed for turbulence would be nice option.


  texture {
    pigment {
      spherical
      translate <3,3,3>
      warp {
        turbulence 0.3
      }
      translate <-3,-3,-3>
      color_map {
        [0.0 color rgb 0.0 ]
        [1.0 color rgb 1.0 ]
      }
    }


Ingo


Post a reply to this message

From: Skip Talbot
Subject: Re: Translating turbulence
Date: 18 May 2004 19:30:33
Message: <40aa9c99$1@news.povray.org>
Ah ha, excellent idea, I thought there was a solution along these lines but
I couldn't quite piece it together.  Thanks again.

Skip Talbot


Post a reply to this message

From: Christopher James Huff
Subject: Re: Translating turbulence
Date: 19 May 2004 17:32:35
Message: <cjameshuff-8046AD.16325219052004@news.povray.org>
In article <Xns94EDD24F1E61Cseed7@news.povray.org>,
 ingo <ing### [at] tagpovrayorg> wrote:

>       translate <3,3,3>
>       warp {
>         turbulence 0.3
>       }
>       translate <-3,-3,-3>

You should also remember that the "warp {}" is necessary...otherwise, 
turbulence will be done first, no matter what its order relative to the 
other transformations is. As I recall, this dates from a time when 
turbulence was a separate feature, before warps were added.

You can package it into a nice little macro:

#macro Turbulence(Amt, Trans)
    transform {Trans inverse}
    warp {
        turbulence Amt
    }
    transform {Trans}
#end

#macro TurbulenceOLO(Amt, Octaves, Lambda, Omega, Trans)
    transform {Trans inverse}
    warp {
        turbulence Amt
        lambda Lambda
        octaves Octaves
        omega Omega
    }
    transform {Trans}
#end

TransformedTurbulence(0.3, transform {translate <-3,-3,-3>})

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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