Radial Perlin Noise
I have been messing around with perlin noise, creating a radial effect for a game I'm working on. The result is a RadialPerlin class for creating radial perlin noise bitmaps like this.
The code is in a single class called RadialPerlin, used like this
var perlin:RadialPerlin = new RadialPerlin( 100, 3, Math.random() * 100000, false, 15, false, true ); perlin.draw( 0, 0 ); var bmp:Bitmap = new Bitmap( perlin.bitmapData ); addChild( bmp );
Download the RadialPerlin class and demo.
The RadialPerlin object is initialised with some values (details of the parameters are in the class file) then drawn into a BitmapData object using its draw method. The draw method takes a couple of offset parameters - one for the distance from the centre and the other for the rotation. You can then grab the BitmapData object from the RadialPerlin object via its bitmapData property and do what you like with it.
The code is licenced under the MIT license. Have fun, and if you make something interesting with it let me know.
Share this post or a comment online -
Also in the collection Actionscript
- Finite State Machines for AI in Actionscript
- Singletons - we're better off without them
- Simple example of acceleration
- List Loader for Actionscript 2
- Singleton Factory
- Events in Actionscript 2
- Different types of weak references
- Events in Actionscript 3
- Creating weak references in Actionscript 3
- Polling the keyboard in Actionscript 3
- The parentheses operator
- Object Pool class
- The I in Interface
- Four ways to link a list (a performance test on linked list architectures)