0

Does anyone know how I might be able to generate the following kind of noise?

  • Three inputs, three outputs
  • The outputs must always result in a vector of the same magnitude
  • If it receives the same input as some other time, it must return the same output
  • It must be continuous (best if it appears smooth, like perlin noise)
  • It must appear to be fairly random

EDIT: It would also be nice if it were isotropic, but that's not entirely necessary.

Miles
  • 1,858
  • 1
  • 21
  • 34
  • What do you mean by continuous? As the input varies smoothly the output must also vary smoothly? As if these coordinates were the time parameter in a drunkard's walk algorithm or something? – sh1 Jun 16 '13 at 00:52
  • yes, I just mean that the first and second derivatives of the function with respect to each input is continuous. If we smoothly and randomly changed each of the inputs over time, I would expect the output vector to sort of wander, but smoothly. More like the drunkard's "perceived gravity" vector. – Miles Jun 18 '13 at 17:38

1 Answers1

0

I've found a way, and it might not be very fast, but it does the job (this is c-like pseudocode designed to make porting to other languages easy).

vec3 sphereNoise(vec3 input, float radius)
{
    vec3 result;
    result.x = simplex(input.x, input.y); //could use perlin instead of simplex
    result.y = simplex(input.y, input.z); //but I prefer simplex for its speed
    result.z = simplex(input.z, input.x); //and its lack of directional artifacts

    //uncomment the following line to make it a spherical-shell noise
    //result.normalize();
    result *= radius;
    return result;
}
Miles
  • 1,858
  • 1
  • 21
  • 34