Playmaker Forum

PlayMaker News => General Discussion => Topic started by: jgalvezpa on January 15, 2014, 09:43:18 PM

Title: Perlin Noise Action[SOLVED]
Post by: jgalvezpa on January 15, 2014, 09:43:18 PM
Hi im using perlin noise action to give random movement to my objects also using add force 2D, the problem is that perlin noise only give positive value  0-1, they add random movement but they always look to be moving in the positive side of screen, could you tweak perlin noise action to  -1 0 1 something like that,
i could multiply it for negative value, but then the force only will be in negative side.
Title: Re: Perlin Noise Action
Post by: dasbin on January 16, 2014, 02:38:25 PM
Why not just:

x = random (0..1)
x = x - 0.5
x = x * 2
Title: Re: Perlin Noise Action
Post by: Groo Gadgets on January 16, 2014, 03:03:46 PM
Heya,

I think the easiest way would be to use Jean's awesome float remap action:

http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311 (http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311)

Simply map your 0 - 1 range to -1 - 1   :)

Cheers,

Simon
Title: Re: Perlin Noise Action[SOLVED]
Post by: jeanfabre on January 24, 2014, 06:07:39 AM
Hi,

 yes, this float remap should have been better worded, the right mathematical term is cross multiplication:

http://en.wikipedia.org/wiki/Cross-multiplication

bye,

 Jean