Enjoy BYOND? Contribute today!
Demos & Libraries
Tutorials & Snippets
Art & Sound
Contests & Events
About Icon Processor
Jul 26 2012, 9:39 pm
I am interested in your Perlin noise generator. I have it working for map generation, I am just wondering if you could explain the PerlinNoise datum a little more. Specifically what each of the variables and constants modify.
The ones I am curious about are:
Jul 27 2012, 9:19 am
Perlin noise uses a matrix of random vectors and interpolates between those vectors to generate the noise values. The SIZE var tells it how large that matrix of vectors will be. You shouldn't need to worry about that too much but if you are making a 100x100 map you'd want the SIZE and scale to be set such that the noise values don't repeat.
The interpolation var determines what method is used to interpolate between vectors when generating noise values. It can be set to LINEAR or COSINE.
The scale var is a multiplier applied to all coordinates. If you're making a 32x32 icon and the size of the matrix you're using is 5x5x5. If you use each pixel's coordinates to get noise values the function will repeat (noise(1, 1, 1) is the same as noise(6, 1, 1) because the size is 5). You can set the scale to 0.1 so that calling noise(32, 32, 1) will actually sample the noise function at the coordinates 3.2, 3.2, 0.1.
The levels var determines how many times the noise function is sampled.
This web page has some good pictures to show how it works and what these variables are used for:
Jul 27 2012, 4:05 pm
In response to
Thanks for the rundown and the link. Perlin noise seems like it can be very useful in creating games.
Copyright © 2013 BYOND. All rights reserved.
Terms of Service