<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>freakbone</title>
	<atom:link href="http://www.freakbone.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freakbone.com</link>
	<description>a flash blog</description>
	<lastBuildDate>Thu, 09 Dec 2010 02:02:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Kaleidoscope with Box2d physics</title>
		<link>http://www.freakbone.com/2010/12/box2d-kaleidoscope/</link>
		<comments>http://www.freakbone.com/2010/12/box2d-kaleidoscope/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 00:58:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Box2d]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=147</guid>
		<description><![CDATA[Move the mouse left and right over the kaleidoscope to change rotation speed. Refereshing will generate new shapes. This was just a little project to get familiar with Box2d AS3 physics engine. It creates and layers two discreet simulations of semitransparent pieces. This is what the simulation of one looks like before it is skinned [...]]]></description>
			<content:encoded><![CDATA[<p><center><embed src="http://www.freakbone.com/flash/Kaleidoscope.swf" quality="high" bgcolor="#FFFFFF" width="600" height="600" name="Kaleidoscope _01" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /><br />
Move the mouse left and right over the kaleidoscope to change rotation speed.<br />
Refereshing will generate new shapes.</center><br />
</br></br></p>
<p>This was just a little project to get familiar with <a href="http://www.box2dflash.org/">Box2d AS3</a> physics engine. It creates and layers two discreet simulations of semitransparent pieces. <a href="http://www.freakbone.com/flash/KaleidoscopeSkeleton.swf" rel="shadowbox;width=600;height=600">This</a> is what the <a href="http://www.freakbone.com/flash/KaleidoscopeSkeleton.swf" rel="shadowbox;width=600;height=600">simulation</a> of one looks like <a href="http://www.freakbone.com/flash/KaleidoscopeSkeleton.swf" rel="shadowbox;width=600;height=600">before it is skinned</a></p>
<p>The pieces are skinned using ActionScript 3.0 drawing methods. It then uses <a href="http://www.gskinner.com/blog/archives/2009/11/as3_kaleidoscop.html">Grant Skinner&#8217;s Kaleidoscope class</a> to reflect the animation 6 times.</p>
<p>I think there are some useful pieces of code in here:<br />
 &#8211; Drawing routines for graphic polygons.<br />
 &#8211; Drawing routines for Box2d polygons.<br />
 &#8211; A simple actor class that creates and manages Box2d bodies and their visible counter parts<br />
 &#8211; Circular physics container (made of boxes).</li>
<p>Download the <a href="http://www.freakbone.com/source/Box2dKaleidoscope.zip">source code here.</a><br />
The source code includes version 2.1a of <a href="http://www.box2dflash.org/">Box2d for AS3</a> and <a href="http://www.gskinner.com/blog/archives/2009/11/as3_kaleidoscop.html">Grant Skinner&#8217;s Kaleidoscope class</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2010/12/box2d-kaleidoscope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2D Metaballs</title>
		<link>http://www.freakbone.com/2010/11/2d-metaballs/</link>
		<comments>http://www.freakbone.com/2010/11/2d-metaballs/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 21:11:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=127</guid>
		<description><![CDATA[The key to this effect is that the ball&#8217;s source image is a radial gradient. When the balls overlap the intensity of the blacks are essentially added together. I do this with alphas, but it may be more efficient to use a blendmode. The image below shows the source bitmap of metaballs. Then all the [...]]]></description>
			<content:encoded><![CDATA[<p><embed src="http://www.freakbone.com/flash/Metaballs.swf" quality="high" bgcolor="#FFFFFF" width="600" height="200" name="ripple_01" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<p>The key to this effect is that the ball&#8217;s source image is a radial gradient. When the balls overlap the intensity of the blacks are essentially added together. I do this with alphas, but it may be more efficient to use a blendmode. The image below shows the source bitmap of metaballs. Then all the pixels above certain gray threshold are copied to the display bitmap. In the left most example any pixel darker than 0&#215;808080 is copied in black to the display bitmap. The other examples copy the source multiple times in different colors at different thresholds.</p>
<p><img src="http://www.freakbone.com/images/metaballs.png" alt="Displacement Map" /></p>
<p>The source code is not especially optimized or well documented but it should get you started. I use the <a href="http://www.greensock.com/tweenmax/">TweenMax API</a> found over at <a href="https://www.greensock.com/">GreenSock</a>. You will need to <a href="http://www.greensock.com/tweenmax/">download </a>it to use the examples.<br />
Download the <a href="http://www.freakbone.com/source/Metaballs.zip">source code</a>.</p>
<p><strong><a href="http://www.zekebrill.com/stuff/SpawnPool.html">Here</a> is an <a href="http://www.zekebrill.com/stuff/SpawnPool.html">example</a> of the metaballs in action: <a href="http://www.zekebrill.com/stuff/SpawnPool.html">Spawn Pool</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2010/11/2d-metaballs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Papervision 3D Atom with source</title>
		<link>http://www.freakbone.com/2010/11/simple-papervision-3d-atom-with-source/</link>
		<comments>http://www.freakbone.com/2010/11/simple-papervision-3d-atom-with-source/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 17:46:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Papervison]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=118</guid>
		<description><![CDATA[I was inspired by the tutorial here. I wanted something simpler like the atomic symbol we are all used to. I use the PaperBase.as class found at papervison2.com. The model and animation is generated with ActionScript 3.0. i.e. it is not an imported model. The eye nucleus uses a phong shader with a bitmap material. [...]]]></description>
			<content:encoded><![CDATA[<p><embed src="http://www.freakbone.com/flash/p3datom.swf" quality="high" bgcolor="#cccccc" width="400" height="400" name="ripple_01" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<p>I was inspired by the tutorial <a href="http://active.tutsplus.com/tutorials/3d/create-a-revolving-atom-in-papervision3d/">here</a>. I wanted something simpler like the atomic symbol we are all used to. I use the <a href="http://papervision2.com/3-creating-a-papervision-base-template/">PaperBase.as</a> class found at <a href="http://papervision2.com/">papervison2.com</a>. The model and animation is generated with ActionScript 3.0. i.e. it is not an imported model. The eye nucleus uses a phong shader with a bitmap material.<br />
<strong>Roll over to move the camera.</strong></p>
<p>Download the <a href="http://www.freakbone.com/source/pv3datom.zip">source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2010/11/simple-papervision-3d-atom-with-source/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Algorithmic Recursive Lightning</title>
		<link>http://www.freakbone.com/2008/09/algorithmic-recursive-lightning/</link>
		<comments>http://www.freakbone.com/2008/09/algorithmic-recursive-lightning/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 20:52:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=84</guid>
		<description><![CDATA[This makes more of a cartoony than a realistic lightning, but I like it.]]></description>
			<content:encoded><![CDATA[<p>This makes more of a cartoony than a realistic lightning, but I like it.<br />
<embed src="http://www.freakbone.com/flash/lightning_02.swf" quality="high" bgcolor="#cccccc" width="500" height="400" name="lightning_02" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2008/09/algorithmic-recursive-lightning/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Better Ripple Effect. Now with source code!</title>
		<link>http://www.freakbone.com/2008/09/a-better-ripple-effect/</link>
		<comments>http://www.freakbone.com/2008/09/a-better-ripple-effect/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 17:21:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=76</guid>
		<description><![CDATA[I wanted to make a ripple effect that distorted the image more realistically. The trick is coming up with the right displacement map. In the displacement map, one color channel controls x-axis displacement and another controls y-axis displacement. Here is an example of what I came up with. This is generated algorithmically. Download the source [...]]]></description>
			<content:encoded><![CDATA[<p><embed src="http://www.freakbone.com/flash/FlashRippler.swf" quality="high" bgcolor="#cccccc" width="500" height="400" name="ripple_01" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<p>I wanted to make a ripple effect that distorted the image more realistically. The trick is coming up with the right displacement map. In the displacement map, one color channel controls x-axis displacement and another controls y-axis displacement. Here is an example of what I came up with. This is generated algorithmically.<br />
 <img src="http://www.freakbone.com/images/displacementMap.jpg" alt="Displacement Map" /></p>
<p>Download the <a href="http://www.freakbone.com/source/RippleEffect.zip">source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2008/09/a-better-ripple-effect/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Pixelate Effect</title>
		<link>http://www.freakbone.com/2008/09/pixelate-effect/</link>
		<comments>http://www.freakbone.com/2008/09/pixelate-effect/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 06:08:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=57</guid>
		<description><![CDATA[Here&#8217;s a pretty standard Pixelate Effect made with ActionScript 3. It averages the colors of progressive sizes of squares and then draws the average using fillRect. The trick is each channel must be averaged separately before they are combined back together.]]></description>
			<content:encoded><![CDATA[<div style="float: right;  margin-left: 20px;  margin-bottom: 20px;" ><embed src="http://www.freakbone.com/flash/pixelate_02.swf" quality="high" bgcolor="#cccccc" width="200" height="300" name="pixelate_02" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></div>
<p>Here&#8217;s a pretty standard Pixelate Effect made with ActionScript 3. It averages the colors of progressive sizes of squares and then draws the average using fillRect. The trick is each channel must be averaged separately before they are combined back together.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2008/09/pixelate-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maze Generator and Solver</title>
		<link>http://www.freakbone.com/2008/08/maze-generator-and-solver-with-source/</link>
		<comments>http://www.freakbone.com/2008/08/maze-generator-and-solver-with-source/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 03:03:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://www.freakbone.com/?p=21</guid>
		<description><![CDATA[This particular algorithm generates a random maze where there is a unique path between any 2 cells. Each cell is defined with a 4 bit integer, representing the 4 walls. A fifth bit defines whether a cell has been &#8220;visited&#8221; or not. Currently there is some redundancy in that each shared wall is defined twice [...]]]></description>
			<content:encoded><![CDATA[<p><center><embed src="http://www.freakbone.com/flash/mazeDemo_02.swf" quality="high" bgcolor="#cccccc" width="600" height="400" name="mazeDemo_02" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></center><br />
<br clear = "all"/></p>
<p>This particular algorithm generates a random maze where there is a unique path between any 2 cells.<br />
Each cell is defined with a 4 bit integer, representing the 4 walls. A fifth bit defines whether a cell has been &#8220;visited&#8221; or not. Currently there is some redundancy in that each shared wall is defined twice &#8211; once in each cell.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2008/08/maze-generator-and-solver-with-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SetPixel Particle System Demo</title>
		<link>http://www.freakbone.com/2008/08/setpixel-particle-system-demo/</link>
		<comments>http://www.freakbone.com/2008/08/setpixel-particle-system-demo/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 10:27:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://freakbone.com/?p=3</guid>
		<description><![CDATA[This is a Demonstration of an AS 3.0 Particle System I am working on. Click/Drag to move the emitter. One of the ways performance is optimized is by the use of a memory pool for all the particle objects. The emitter object determines how many particles will be on screen at any time and pre-allocates [...]]]></description>
			<content:encoded><![CDATA[<p>This is a Demonstration of an AS 3.0 Particle System I am working on. Click/Drag to move the emitter.<br />
<center><embed src="http://www.freakbone.com/flash/pixelDemo_05.swf" quality="high" bgcolor="#cccccc" width="600" height="400" name="pixelDemo_05" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></center><br />
<br clear = "all"/></p>
<p>
One of the ways performance is optimized is by the use of a memory pool for all the particle objects. The emitter object determines how many particles will be on screen at any time and pre-allocates the memory needed.  All the particle objects are created and stored in a queue to be used and recycled by the emitter.  I used the Arrayed Queue class developed by Michael Baczynski over at <a href="http://lab.polygonal.de/">Polygonal Labs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakbone.com/2008/08/setpixel-particle-system-demo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

