Subscribe to RSS
get email updates
home | about | pixDif AIR app | video tutorials
polyGeek.com

place your ad here

Web Premium



Get Qwest High Speed Internet



Explorer for BitmapData.perlinNoise and BitmapData.noise

April 5th, 2009 . by polygeek

If you need to add some random noise to your BitmapData then you have two options:

  1. myBitmapData.perlinNoise which is sort of smooth gradiations of patterns. Sort of looks like a nebula to me, or
  2. myBitmapData.noise which is much like static, just a bunch of randomly colored dots

It is very easy to use each method but how changes in the parameters can change the output isn’t very obvious. So I created this Explorer because that’s what I do. I’m an Explorer of Actionscript. :)

view source

And now…
Now you can go out and make some noise of your own. Maybe something a little more creative than this. Be sure to drop a comment below if you have anything you would like to share.

Notes
The last parameter passed in the perlinNoise method is for an array of offsets. There’s no easy way to add user controls for editing that many possible arrays – one for each octave. Therefor I just left it out since the default is null. I also did a few experiments with adding an offset array behind the scenes without any user control but the change in visual appearance of the output was so small that I didn’t think it was worth the effort. It’s quite possible I wasn’t doing it right so you should play with it yourself.

Coding conventions
In this Explorer I experimented with changing my coding conventions for giving IDs to components. I usually just give components a descriptive ID and I don’t think about the format that much. This time I placed the type of component at the beginning of the ID string followed by an underscore and then a descriptive name. I often get to a point in an method where I need to access a component and I have to remember the name. The Outline panel is helpful but I don’t use it as much as I should. With this convention all I have to do is type in slid… to get the code hinting for all of the slider components and then just pick it out of the lineup.

What do you think of this convention?

If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.

Post to Twitter Post to Delicious Post to Facebook Post to Reddit Post to StumbleUpon


similar posts

4 Responses to “Explorer for BitmapData.perlinNoise and BitmapData.noise”


comment number 1 by: Keith Peters

comment number 2 by: polyGeek

@Keith, should have figured you would have something like that. I did a search for 'Actionscript perlinNoise' and ended up on another post of yours from about 3 years ago. I spent 10-15 minutes converting your code sample from AS2->AS3 so that I could see what it did.

I take consolation in the fact that I’m only about 3 years behind you. :)

comment number 3 by: Dave

perlinNoise is really cool ^_^


[...] the runtime visibility map I’ve used the ever amazing perlin noise effect. Since perlin noise works with a phase I can use that to animate perlin noise and apply the results [...]

   Welcome back (Change)

Leave a Reply

comment feed RSS   subscribe to this comment thread

Recent Posts

   



polyGeek.com

© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites
Local Directory for Los Angeles, CA

Better Tag Cloud