Skip to content

Instantly share code, notes, and snippets.

@nervoussystem
Created June 1, 2010 22:15
Show Gist options
  • Select an option

  • Save nervoussystem/421597 to your computer and use it in GitHub Desktop.

Select an option

Save nervoussystem/421597 to your computer and use it in GitHub Desktop.
//vary noise discretely to approximate gradient
float xGradient = (noise(x+DELTA,y)-noise(x-DELTA,y))/(2*DELTA);
float yGradient = (noise(x,y+DELTA)-noise(x,y-DELTA))/(2*DELTA);
particle.position().add(noiseStrength*xGradient, noiseStrength*yGradient,0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment