July 6th, 2007
There have been a few requests for the the source to the Fire Sphere demo I posted forever ago. I’ve finally gotten around to cleaning up the code and getting it to work with the latest rev of PV3D.
The material applied to the sphere is created using a static PNG with a DisplacementMapFilter applied to it. The DisplacementMapFilter uses a BitmapData object that has had perlin noise applied to it to give the flame effect. A lot of other effects can be created this way as well. Things like rippling water or clouds. It’s just a matter of changing the original image and tweaking the settings of the filter and the noise.
You can get the source here. It’s really quite simple. The whole thing is under 200 lines of code.
Enjoy!


July 6th, 2007 at 1:26 pm
Does the Perlin Noise makes it that slow? I just can’t take a look at the sources now
Nice liquidMetal btw!
reminds me to the end of this demo:
http://www.pouet.net/prod.php?which=26535
July 6th, 2007 at 1:32 pm
sweetness!
you should do a tutorial on diffrent types and uses of perlin noise. thanx for the source!
July 6th, 2007 at 1:35 pm
Yes, it likely is the perlin noise that makes it so processor intensive.
July 6th, 2007 at 2:26 pm
Excellent love the metal tunnel. I hope you post more often as it is always top notch stuff. I am happy to see more material work by doob and on the pv3d list. It seems that away3d has been going hard on that but pv3d is not so much in that area such as the chrome ball and some material work posted lately on http://www.away3d.com/.
July 7th, 2007 at 9:27 am
[...] Read the original post and download source here. [...]
July 7th, 2007 at 11:39 am
Whnenever I use perlin noise effects, I tend to render them once to a seperate double sized bitmap which I then scroll and loop to use for displacement etc – this is a lot less processor intensive but has the down side of increased memory consumption and doesn’t of course randomly evolve, but for most effects is sufficient.
July 7th, 2007 at 12:52 pm
[...] Recent work by actionscript architect [...]
August 31st, 2007 at 10:45 am
hi, great work. When I setup a fla in CS3 with your source I get this error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at FireSphere/::configureTexture()
at FireSphere$iinit()
any pointers? ta p;)
September 13th, 2007 at 2:18 pm
Hmm, no idea. Unfortunately I don’t have CS3 so it’s difficult for me to debug. Did you set the FireSphere class up as class that is associated with the root, the application class, or whatever it is called in CS3?
October 2nd, 2007 at 9:23 pm
Do you have an AS2 version of the fire sphere?
October 3rd, 2007 at 8:24 am
I don’t have an AS2 version. But, the code is there if you’d like to port it.
October 26th, 2007 at 6:06 pm
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at FireSphere/::configureTexture()
at FireSphere$iinit()
It is right here:
public function FireSphere()
{
this.configureTexture();
this.configureScene();
this.configureListeners();
}
configureTexture()????
i really don’t want this error to be. any ideas? i am lost
November 25th, 2007 at 10:40 am
I got the same error running the code in Flash CS3. It seems to be that CS3 objects to FireTexture being instantiated, e.g. it’s complaining that you’re trying to create an instance of a variable. Essentially, the method of creating a Class called ‘FireTexture’ based on the Embed meta-tag is invalid in Flash, but valid in Flex.
For anyone that wants to solve this, import the PNG into the library of the FLA file, and set its class to FireTexture. Remove the [Embed(source="../fire.png")] statement and the FireTexture definition below it. Then replace the two opening lines of configureTexture() with:
this.fireTexture = new FireTexture( 400, 200 );
Thanks for the example Paul