Advertisement

Using Perlin Noise to turn a vector

Started by April 25, 2018 11:50 PM
3 comments, last by 51mon 6 years, 9 months ago

I've finished a class that can generate textures using the perlin noise function on the fly. The texture may be 2D or 3D. Also, I've seen a guy who can generate vector fields using perlin noise, but the problem is, when you do iterations to the 3D environment, you just have one value to turn, which is a scalar perhaps, and you want to do three things (yaw, pitch and roll), is it possible to generate a 3D vector field using the 3D perlin noise function?

thanks

Jack

Perlin noise is an N-to-1 mapping, meaning that whatever dimensionality your noise is, you end up with a one-dimensional result (usually represented as a grayscale color).  So if you want to displace coordinates with perlin noise, you're going to have to displace each coordinate individually.  You could do something like this:


Vector3 YawPitchRollValues = new Vector3(Perlin1D(oldVec.x+offset1), Perlin1D(oldVec.y+offset2), Perlin1D(oldVec.z+offset3));

 

 

Advertisement

Okay, thanks man... I see..

I think there is a mistake in the pseudo code above. I think you should use. float3 result = float3(Noise3d(coord.xyz + offset1.xyz), Noise3d(coord.xyz + offset2.xyz), Noise3d(...)).

You can also look into curl noise as well. It's often used for 3d and has some benefits

This topic is closed to new replies.

Advertisement