POV-Ray : Newsgroups : povray.general : Translate by turbulence Server Time
6 Aug 2024 04:15:59 EDT (-0400)
  Translate by turbulence (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From:
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 10:37:50
Message: <i8qtiusukna1bkaftjqee1nekhildarvqe@4ax.com>
On Fri, 12 Jul 2002 10:23:11 -0400, "TinCanMan" <Tin### [at] hotmailcom>
wrote:
> > Can you use user defined functions to recreate turbulence behaviour ?
> > If yes, that's could be solution (using some noise functions additionaly).
>
> Possibly.
> How would you get the translation value from the noise function?

<f_noise(x,y,z),f_noise(y,z,x),f_noise(y,z,x)> ?

ABX


Post a reply to this message

From: TinCanMan
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 10:40:34
Message: <3d2eea62$1@news.povray.org>

news:i8qtiusukna1bkaftjqee1nekhildarvqe@4ax.com...
> On Fri, 12 Jul 2002 10:23:11 -0400, "TinCanMan"
<Tin### [at] hotmailcom>
> wrote:
> > > Can you use user defined functions to recreate turbulence behaviour ?
> > > If yes, that's could be solution (using some noise functions
additionaly).
> >
> > Possibly.
> > How would you get the translation value from the noise function?
>
> <f_noise(x,y,z),f_noise(y,z,x),f_noise(y,z,x)> ?
>
> ABX

Hmm, I'll try this out.

After reading more into how turbulence works I don't think there is a simple
solution to this.  Turbulence works by grabbing a value *from* the
turbulated location rather than moving the point *to* a turbulated location.

-tgq


Post a reply to this message

From:
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 10:43:47
Message: <ejqtiu85qkheglkr0pucrpsj3p4jdvi3gd@4ax.com>
On Fri, 12 Jul 2002 10:36:16 -0400, "TinCanMan" <Tin### [at] hotmailcom>
wrote:
>
> Thanks, but it appears to be the opposite of what I want (if I understand
> turbulence properly).  The vector returned by vturbulence() for pt A is the
> original vector of the point that is essentially now located at A rather
> than where the point that was originally at A is now.

I'm affraid it will be the same in my solution. What you are looking for is
bidirectional (reversable) turbulence (noise). I have looked for this kind if
noise at the time when I was working on deform patch. I passed but perhaps you
will find it.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 10:50:11
Message: <3D2EECA2.BFD1426@gmx.de>

> 
> It can be wrong solution when you want displace geometry instead of vector as
> for displacement in isosurfaces.

I think TinCanMan only wanted to translate a sphere.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Christoph Hormann
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 10:50:57
Message: <3D2EECCD.B8486BA8@gmx.de>
TinCanMan wrote:
> 
> > Have a look at the 'vturbulence()' function.
> 
> Thanks, but it appears to be the opposite of what I want (if I understand
> turbulence properly).  The vector returned by vturbulence() for pt A is the
> original vector of the point that is essentially now located at A rather
> than where the point that was originally at A is now.

Have you tried it?

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rune
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 11:20:26
Message: <3d2ef3ba@news.povray.org>
Christoph Hormann wrote:
> TinCanMan wrote:
>>
>>> Have a look at the 'vturbulence()' function.
>>
>> Thanks, but it appears to be the opposite of what I want (if I
>> understand turbulence properly).  The vector returned by
>> vturbulence() for pt A is the original vector of the point that is
>> essentially now located at A rather than where the point that was
>> originally at A is now.
>
> Have you tried it?

Well, it's pointless.

Turbulence in textures work backwards, so a turbulated texture can have
the same point turbulated to two or more locations. The vturbulence
function works forward and thus is incompatible with turbulence in
textures, and naturally a function can not return more than one result.

However, for very small amounts of turbulence, the results for forward
and backwards turbulence may be close enough that they won't be spotted
(because turbulence directions change gradually).

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated July 12)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From:
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 11:28:40
Message: <64ttius804jeuqbge1mk749nddg8ekrbte@4ax.com>
On Fri, 12 Jul 2002 16:50:53 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
>
> Have you tried it?

If I would everything fine then tehere should be crossection at the center of
square.

#local Amount  = 0.5;
#local Lambda  = 1.5;
#local Omega   = 0.8;
#local Octaves = 5.0;
#local Frequency = 3;
#local P=<0,0,0>;
#local P=P+Amount*vturbulence(Lambda,Omega,Octaves,P*Frequency);
box{
  P-<.1,.1,0> P+<.1.1.1>
  pigment{
    checker color blue 1 color red 1
    turbulence Amount
    lambda Lambda
    omega Omega
    octaves Octaves
    frequency Frequency
  }
  finish{ambient 1 diffuse 0}
  translate -P
  translate z
}

ABX


Post a reply to this message

From: TinCanMan
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 11:33:55
Message: <3d2ef6e3@news.povray.org>
> TinCanMan wrote:
> >
> > > Have a look at the 'vturbulence()' function.
> >
> > Thanks, but it appears to be the opposite of what I want (if I
understand
> > turbulence properly).  The vector returned by vturbulence() for pt A is
the
> > original vector of the point that is essentially now located at A rather
> > than where the point that was originally at A is now.
>
> Have you tried it?
>
> Christoph

Yes, and it didn't work.
I couldn't get the function method to work either so I think I'm S.O.L.
As Rune pointed out, the problem with turbulence and vturbulence is that, by
the nature of the way they work, a single point can be turbulated to more
than one point. Turbulence doesn't move pt A by x,y,z but rather uses the
point x,y,z away at the location of A.

-tgq


Post a reply to this message

From: Christoph Hormann
Subject: Re: Translate by turbulence
Date: 12 Jul 2002 12:14:25
Message: <3D2F0061.4D884FD0@gmx.de>
TinCanMan wrote:
> 
> [...]
> 
> Yes, and it didn't work.
> I couldn't get the function method to work either so I think I'm S.O.L.
> As Rune pointed out, the problem with turbulence and vturbulence is that, by
> the nature of the way they work, a single point can be turbulated to more
> than one point. Turbulence doesn't move pt A by x,y,z but rather uses the
> point x,y,z away at the location of A.

I know it isn't a precise solution of your problem, but as ABX pointed out
it can't be solved easily because you can't reverse turbulence.  You can
try to iteratively approximate the solution and thereby gain better
results.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: TinCanMan
Subject: Re: Translate by turbulence (Yay! I've done it!)
Date: 12 Jul 2002 21:10:14
Message: <3d2f7df6$1@news.povray.org>
Hooray! I macroed myself a method to translate by turbulence!
I don't guarantee how well this works, especially for large turbulence
values, but it will work for what I want to do.  Thanks to Christoph for
pointing me to vturbulence() which was the key to making it work.

-tgq

Have a try at the following scene and play with the numbers if you want to
see it in action.  The translated sphere is raised off the plane a bit
because of y direction turbulence.
//start
camera{
  up y
  right x*image_width/image_height
  angle 45
  location <30,30,-30>
  look_at 0
}

light_source{y*1000 rgb 1}

#declare tTurb=0.50;
#declare tLamb=1.2;
#declare tOcta=5;
#declare tOmeg=0.25;

plane{y 0
  pigment{checker rgb 1 rgb 0
    translate -y/2
    warp{
      turbulence tTurb
      octaves tOcta
      lambda tLamb
      omega tOmeg
    }
    scale 20
  }
}

//P0 = Point to translate
//Acc = Accuracy
#macro turb_translate (tTurb,tOcta,tLamb,tOmeg,P0,Acc)
  #local PC=P0;
  #local Dir=<0,0,0>;
  #local V0=vlength(vturbulence(tLamb, tOmeg, tOcta, P0)*tTurb);
  #local Step=V0/2;
  #macro AB(PC,Step,d,Dir,V0)
    #local P1=PC+Step*d;
    #local V1=vlength(P1+vturbulence(tLamb, tOmeg, tOcta, P1)*tTurb-P0);
    #if (V1<V0 | d.x=1)
      #local Dir=d;
      #local V0=V1;
    #end
  #end
  #while (V0>Acc)
    #local DrP=Dir;
    AB(PC,Step, x,Dir,V0)
    AB(PC,Step,-x,Dir,V0)
    AB(PC,Step, y,Dir,V0)
    AB(PC,Step,-y,Dir,V0)
    AB(PC,Step, z,Dir,V0)
    AB(PC,Step,-z,Dir,V0)
    #if (vlength(DrP+Dir)=0)
      #local Step=Step/2;
    #else
      #local Step=V0/2;
    #end
    #local PC=PC+Step*Dir;
  #end
  PC
#end

#declare TPt=<0,0,0>;
sphere{TPt 1 pigment{rgb <1,0,0>}}
sphere{0 1 pigment{rgb <1,0,0>} translate
turb_translate(tTurb,tOcta,tLamb,tOmeg,TPt,0.001)*20}
//end


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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