Yesterday, I decided that the outputs from my Wander class would look better with a bit more symmetry, so I spent a couple hours building an AS3 Kaleidoscope class. I thought I’d share the results under the usual MIT license.
It’s fairly fast and robust, supporting one or more slices (not sure why I supported 1 slice, but I did), reflection, display objects or bitmapdata as a source, rotation / position offsets, and a fast mode when using a bitmapdata source without offsets for better performance. I haven’t benchmarked it against PixelBender implementations yet, but plan to do so some time this week.
I’ll post some of the more complex things I’ve been doing with it tomorrow. But here’s the simple demo that’s included with the download:
Note that a lot of the CPU use for this demo is from generating the perlin noise.
You can download the Kaleidoscope class, docs, and demo by clicking here. Have fun!
If you build something cool with this and/or Wander, feel free to share it in the comments. I’d love to see it.
cool.thanks.
Cool stuff. I have a best practice question for you (well, for everyone). I notice in your Kaleidoscope class you have some properties starting with an underscore, and some without. How are you deciding on that? I’ve been going back and forth on it myself. Thanks.
@Sean
Underscores usually denote a storage member for a getter/setter.
Jason – thanks!
underscores for all private variables