A set of generated random numbers, good ones at least, should have no relationship with each other and should have no discernible pattern. While this is great, there are many times you need to have a way to generate random numbers that have some relation to each other. For instance clouds in a CGI image. The perlin noise function is a way to do just that. This function generates an overall smooth or natural set of numbers.
This was developed by Ken Perlin in 1983 as a result of his frustration with the "machine-like" look of CGI at the time. He formally described his findings in a paper in 1985 called An image Synthesizer. In 1997, Perlin was awarded an Academy Award for Technical Achievement for creating the algorithm. You can read more about this here.
I have a bunch of canvases below that highlight the differences between random and perlin noise functions.
1 dimensional noise generation: This canvas shows two graphs. The first one is where the y-axis is a random value. The one below that is where the y-axis
is perlin noise. The difference is quite remarkable.
2 dimensional noise generation: The two canvases below shows two randomly generated images. The pixels on the
first one are randomly generated.
The pixels on the second one are generated out of perlin noise in 2 dimensions.
The second one looks like a clouds highlighting the smoothness of the perlin noise function.
3 dimensional noise generation: And finally, here's perlin noise generated in 3 dimensions.
I still haven't figured out how to display or show things in 3D. However instead of showing the generated noise in 3D,
I go through the 3rd dimension as if it was slices showing every 2D slice at a time.
The code below shows how perlin noise is generated and should be appropriately commented. The sources for this code comes from these sources.