<?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>UnitZeroOne &#187; Uncategorized</title>
	<atom:link href="http://unitzeroone.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitzeroone.com/blog</link>
	<description>by Ralph Hauwert, Creative Developer, Consultant</description>
	<lastBuildDate>Mon, 21 Nov 2011 09:31:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WebP decoder for Flash.</title>
		<link>http://unitzeroone.com/blog/2011/11/20/webp-decoder-for-flash/</link>
		<comments>http://unitzeroone.com/blog/2011/11/20/webp-decoder-for-flash/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 14:58:45 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unitzeroone.com/blog/?p=609</guid>
		<description><![CDATA[Nothing much here, but I thought I&#8217;d share a handy little library to decode WebP in Flash. Here&#8217;s two demo&#8217;s : Lena and V for Vendetta, both encoded using the webp binaries provided here. It&#8217;s a small wrapper around the &#8230; <a href="http://unitzeroone.com/blog/2011/11/20/webp-decoder-for-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://unitzeroone.com/blog/wp-content/uploads/webplogo.jpg"><img class="alignnone size-full wp-image-616" title="webplogo" src="http://unitzeroone.com/blog/wp-content/uploads/webplogo.jpg" alt="" width="640" height="227" /></a></p>
<p>Nothing much here, but I thought I&#8217;d share a handy little library to decode WebP in Flash. Here&#8217;s two demo&#8217;s : <a href="http://unitzeroone.com/labs/webp/index.html">Lena</a> and <a href="http://unitzeroone.com/labs/webp/index.html?file=V.webp">V for Vendetta</a>, both encoded using the webp binaries provided <a href="http://code.google.com/speed/webp/download.html">here</a>.</p>
<p>It&#8217;s a small wrapper around the <a href="http://git.chromium.org/gitweb/?p=webm/libwebp.git">WebP library</a> ported with Alchemy. The port is pretty easy to do using <a href="http://labs.adobe.com/technologies/alchemy/">Alchemy</a>, aside from some issues with the Alchemy toolchain pretending to be a normal gcc toolchain; it enables some x86 asm code for cpu identification in the webp code, which obviously won&#8217;t work in Flash. After those issues are resolved getting up and running is easy.</p>
<p>However, I&#8217;d figure I&#8217;d post this as I have seen several requests for making webp work in Flash.</p>
<p>Although webp decoding isn&#8217;t there natively om the FlashPlayer, this should help you a long way. Read further for an example on usage and download of the swc.</p>
<p>As for this blog; due to time constraints I find myself not being able to update it regularly, even though I want to. Also, as I do a lot more tech then just Flash these days, I&#8217;m looking for a way to post experiments in other technologies, without the daunting task of making a full scale blogpost about it&#8230;.more on that when I figured it out.</p>
<p><span id="more-609"></span></p>
<p>Download <a title="WebPLib download" href="http://www.unitzeroone.com/download/WebPLib.swc" target="_blank">webplib.swc</a>.</p>
<pre class="brush: as3; title: ; notranslate">
public class Main extends Sprite
{
	[Embed(source=&quot;V.webp&quot;, mimeType=&quot;application/octet-stream&quot;)]
	private const WebPImageClass:Class;

	public function Main()
	{
		stage.scaleMode = StageScaleMode.NO_SCALE;
		stage.align = StageAlign.TOP_LEFT;
		init();
	}

	private function init():void
	{
		WebPLib.init();//Only needs to be called once.
		var bitmapData:BitmapData = WebPLib.decode(new WebPImageClass() as ByteArray);
		addChild(new Bitmap(bitmapData));
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2011/11/20/webp-decoder-for-flash/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Unity3D &amp; Flash</title>
		<link>http://unitzeroone.com/blog/2011/09/01/unity3d-flash/</link>
		<comments>http://unitzeroone.com/blog/2011/09/01/unity3d-flash/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 21:39:40 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unitzeroone.com/blog/?p=593</guid>
		<description><![CDATA[If you wonder why it&#8217;s silent in here again; same old, same old; I&#8217;ve been busy. So many things happened this year, most of them very good. Workwise, I have joined the brilliant minds at Unity Technologies to work on &#8230; <a href="http://unitzeroone.com/blog/2011/09/01/unity3d-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_597" class="wp-caption aligncenter" style="width: 650px"><a href="http://unitzeroone.com/blog/wp-content/uploads/shadowgun-20110620010221042_640w.jpeg"><img src="http://unitzeroone.com/blog/wp-content/uploads/shadowgun-20110620010221042_640w.jpeg" alt="shadowgun in game" title="shadowgun in game" width="640" height="426" class="size-full wp-image-597" /></a><p class="wp-caption-text">An image of ShadowGun a game made by Madfingers, using Unity.</p></div>
<p>If you wonder why it&#8217;s silent in here again; same old, same old; I&#8217;ve been busy. So many things happened this year, most of them very good. Workwise, I have joined the brilliant minds at <a href="http://unity3d.com/">Unity Technologies</a> to work on further expanding the reach of Unity. Today is exiting, because <a href="http://blogs.unity3d.com/2011/09/01/unity-and-flash-a-sneak-peek/">over on the Unity blog</a>, there is a first public sneak peek of our progress. Let us know what you think !</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2011/09/01/unity3d-flash/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Jump Flood Voronoi for WebGL</title>
		<link>http://unitzeroone.com/blog/2011/03/22/jump-flood-voronoi-for-webgl/</link>
		<comments>http://unitzeroone.com/blog/2011/03/22/jump-flood-voronoi-for-webgl/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 14:21:55 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unitzeroone.com/blog/?p=579</guid>
		<description><![CDATA[A small experiment to familiarize myself a bit more with webgl&#38;canvas and a quick post to show a this experimental WebGL toy. Video here and on the full post, Live demo for newer WebGL enabled browsers here. Code isn&#8217;t exactly &#8230; <a href="http://unitzeroone.com/blog/2011/03/22/jump-flood-voronoi-for-webgl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://unitzeroone.com/blog/wp-content/uploads/lenavoronoi.jpg"><img class="aligncenter size-full wp-image-580" title="Lena Voronized" src="http://unitzeroone.com/blog/wp-content/uploads/lenavoronoi.jpg" alt="" width="640" height="429" /></a>A small experiment to familiarize myself a bit more with webgl&amp;canvas and a quick post to show a this experimental WebGL toy. <a href="http://vimeo.com/21343002" target="_blank">Video here</a> and on the full post, <a href="http://unitzeroone.com/labs/jfavoronoi/" target="_blank">Live demo</a> for newer WebGL enabled browsers <a href="http://unitzeroone.com/labs/jfavoronoi/" target="_blank">here</a>. Code isn&#8217;t exactly production ready. Comments and compatibility notices welcome!</p>
<p><a href="http://www.comp.nus.edu.sg/~tants/jfa.html" target="_blank">JFA Voronoi Paper by Guodong Rong and Tiow-Seng Tan.</a></p>
<p><span id="more-579"></span></p>
<p><iframe src="http://player.vimeo.com/video/21343002" width="640" height="480" frameborder="0"></iframe>
<p><a href="http://vimeo.com/21343002">WebGL / Canvas &#8211; Jump Flood Voronoi Experiment.</a> from <a href="http://vimeo.com/unitzeroone">Ralph Hauwert</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2011/03/22/jump-flood-voronoi-for-webgl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Demo Video of WebM being decoded by Flash.</title>
		<link>http://unitzeroone.com/blog/2011/01/21/demo-video-of-webm-being-decoded-by-flash/</link>
		<comments>http://unitzeroone.com/blog/2011/01/21/demo-video-of-webm-being-decoded-by-flash/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 18:18:40 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unitzeroone.com/blog/?p=565</guid>
		<description><![CDATA[Demo Video of WebM being decoded by Flash. from Ralph Hauwert on Vimeo. This is a little side project I have been playing with. I&#8217;m porting google&#8217;s libvpx using Adobe Alchemy to run WebM in Flash Player 10, which doesn&#8217;t &#8230; <a href="http://unitzeroone.com/blog/2011/01/21/demo-video-of-webm-being-decoded-by-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/19037862" width="640" height="475" frameborder="0"></iframe></p>
<p><a href="http://vimeo.com/19037862">Demo Video of WebM being decoded by Flash.</a> from <a href="http://vimeo.com/unitzeroone">Ralph Hauwert</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><strong> </strong>This is a little side project I have been playing with. I&#8217;m porting google&#8217;s libvpx using Adobe Alchemy to run WebM in Flash Player 10, which doesn&#8217;t support the format natively yet. Because it&#8217;s not much more then a small and experimental side project, I quickly made a video to show it&#8217;s progress up until now. Monday the new part in <a href="http://unitzeroone.com/blog/2011/01/16/the-particle-sessions-part-one-is-this-it/">the Particle Sessions</a> will appear.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2011/01/21/demo-video-of-webm-being-decoded-by-flash/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Particle Sessions : Part One, Is this it ?</title>
		<link>http://unitzeroone.com/blog/2011/01/16/the-particle-sessions-part-one-is-this-it/</link>
		<comments>http://unitzeroone.com/blog/2011/01/16/the-particle-sessions-part-one-is-this-it/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 21:03:03 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[particles]]></category>
		<category><![CDATA[pixelbender]]></category>

		<guid isPermaLink="false">http://unitzeroone.com/blog/?p=437</guid>
		<description><![CDATA[Part One of the Particle Session kicks off with looking at a system similar, but simpler then this Bloom particle experiment (music made for it by the fantastic artist Rich Bologna, thank you again for it, Rich!). We&#8217;ll be taking slow steps &#8230; <a href="http://unitzeroone.com/blog/2011/01/16/the-particle-sessions-part-one-is-this-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://unitzeroone.com/blog/wp-content/uploads/thestrokes.jpg"><img class="alignnone size-full wp-image-442" title="The Strokes - Is This It" src="http://unitzeroone.com/blog/wp-content/uploads/thestrokes.jpg" alt="" width="640" height="379" /></a></p>
<p>Part One of the Particle Session kicks off with looking at a system similar, but simpler then <a href="http://unitzeroone.com/labs/bloom/">this Bloom particle experiment</a> (music made for it by the fantastic artist <a href="http://www.richbologna.com/">Rich Bologna</a>, thank you again for it, Rich!). We&#8217;ll be taking slow steps of optimizations and at the end have a get prepared for the next level. To be able to get up to speed with the working of the <a href="http://unitzeroone.com/labs/particleVideo/" target="_blank">video particles</a>, we&#8217;ll start from the beginning and work our way up. For that reason, we&#8217;ll start very simple and look at a basic unoptimized particle system with next to zero functionality, and modify the code for performance.</p>
<p><span id="more-437"></span></p>
<p><strong>Basis : The Particle</strong></p>
<p>The opening picture of this post is the album cover of <a href="http://www.youtube.com/watch?v=f1vvUec71v8" target="_blank">The Strokes &#8211; Is This It</a>. It being one of my favorite albums, I have listened to it many times, but never noticed what the <a href="http://www.google.com/images?q=particle+collision&amp;um=1&amp;ie=UTF-8&amp;source=og&amp;sa=N&amp;hl=en&amp;tab=wi&amp;biw=1267&amp;bih=1103">cover really was</a>. It&#8217;s amazing &amp; inspiring what imagery one can get from science. Now put on your headphones and listen to that album while reading this post.</p>
<p>Over the last years I&#8217;ve more and more started enjoying introductory books about theoretical physics. In complete honesty, it wasn&#8217;t even that long ago that I didn&#8217;t know that the <a href="http://en.wikipedia.org/wiki/Boson">Boson</a> in the <a href="http://en.wikipedia.org/wiki/Higgs_boson">Higgs Boson</a> wasn&#8217;t the other guy discovering it, next to <a href="http://en.wikipedia.org/wiki/Peter_Higgs">Mr.Higgs</a>. You know, like the <a href="http://en.wikipedia.org/wiki/Comet_Hale-Bopp">Hale-Bopp comet</a> was discovered by <a href="http://en.wikipedia.org/wiki/Alan_Hale_(astronomer)">Hale</a> &amp; <a href="http://en.wikipedia.org/wiki/Thomas_Bopp">Bopp</a>.</p>
<p>Luckily for us and this post, we don&#8217;t need to deal with <a href="http://en.wikipedia.org/wiki/Wave%E2%80%93particle_duality">wave particle duality</a> and <a href="http://en.wikipedia.org/wiki/Quantum_entanglement">quantum entanglement</a>, but we can achieve seeming complexity by using simplicity.</p>
<p><strong>Getting started : Simplicity &amp; Complexity</strong></p>
<p>The simple core particle we will be using in this session get its complexity from its display of large numbers of them, not from per instance properties. To illustrate that, let&#8217;s start off with a simple particle object in AS3</p>
<pre class="brush: as3; title: ; notranslate">
package com.unitzeroone.particlesessions
{
	import flash.display.BitmapData;

	public class Particle {
		public var x:Number;
		public var y:Number;
		public var velX:Number;
		public var velY:Number;

		public function Particle(x:Number, y:Number, velX:Number, velY:Number) {
			this.x = x;
			this.y = y;
			this.velX = velX;
			this.velY = velY;
		}
	}
}
</pre>
<p>As you can see, this particle object is pretty simple, and it contains the core properties we really need to make them move. Its position stored in x and y, and its velocity stored in velX and velY. For the case of this post it&#8217;s more then enough to do what we want.</p>
<p>I do want to point out two things about the simplicity of this. First of all, we express all values in absolute x and y. For the positions, this would be called a <a href="http://en.wikipedia.org/wiki/Cartesian_coordinate_system">cartesian system</a>. In some cases it might be handier to express velocity as a <a href="http://en.wikipedia.org/wiki/Polar_coordinate_system">polar coordinates</a>, but performance reasons we&#8217;ll keep them like this.</p>
<p><strong>OOP (s)</strong></p>
<p>It&#8217;s very common within the AS3 industry to &#8220;objectify&#8221; everything in nicely wrapped classes first and think about performance later. In the case of our particle and a classic &#8220;update&#8221; loop as seen in game engines, the most natural feeling way to implement the particle&#8217;s moving behaviour for the particle is as follows.</p>
<pre class="brush: as3; title: ; notranslate">
package com.unitzeroone.particlesessions
{
	import flash.display.BitmapData;

	public class Particle {
		public var x:Number;
		public var y:Number;
		public var velX:Number;
		public var velY:Number;

		public function Particle(x:Number, y:Number, velX:Number, velY:Number) {
			this.x = x;
			this.y = y;
			this.velX = velX;
			this.velY = velY;
		}

		public function updateAndDraw(toBitmapData:BitmapData):void
		{
			this.x += velX;
			this.y += velY;
			toBitmapData.setPixel(this.x,this.y,0xFFFFFF);
		}
	}
}
</pre>
<p>This is a very logical thing to do and is suitable for most things, especially in larger code bases, it certainly helps in readability. It also matches many things you&#8217;ll see in OOP and AS3 books. Like car.drive() or lasership.shoot() or avatar.updatePosition(). From a pure OO perspective, it makes sense. From a performance perspective, this isn&#8217;t as good though. We&#8217;ll tackle that in a bit.</p>
<p><strong>Main</strong></p>
<p>Now, let&#8217;s say we&#8217;d have a very simple Main class to run this system, as such :</p>
<pre class="brush: as3; title: ; notranslate">
package {

import flash.display.StageScaleMode;
import flash.display.StageAlign;
import com.unitzeroone.particlesessions.Particle;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;

	public class MainOne extends Sprite {
		private var bitmap : Bitmap;
		private var bitmapData : BitmapData;
		private var particles:Array;

		public function MainOne(){
			init();
		}

		private function init():void
		{

			//Create a canvas to draw too
			bitmapData = new BitmapData(500,400,false,0x000000);
			bitmap = new Bitmap(bitmapData);
			addChild(bitmap);

			//Create a set of random particles with a random velocity
			particles = new Array();
			for(var i:int = 0; i&lt;=1000; i++){
				particles.push(new Particle(Math.random()*500,Math.random()*400,Math.random()*2-1,Math.random()*2-1));
			}
			//Wait to be added to stage
			addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
		}

		private function onEnterFrame(event : Event) : void
		{
			//Clear the stage
			bitmapData.fillRect(bitmapData.rect,0x000000);

			//Lock the bitmapdata, while we are updating it.
			bitmapData.lock();

			//Draw particles
			var p:Particle;
			var l : int = particles.length;
			for(var i:int = 0; i&lt;l; i++){
				p = particles[i];
				p.updateAndDraw(bitmapData);
			}

			//We are done updating, unlock the bitmapdata
			bitmapData.unlock();
		}

		private function onAddedToStage(event : Event) : void
		{
			//If added to stage, set stage properties and start listening to the global enterframe.
			stage.frameRate = 30;
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}
	}
}
</pre>
<p>For clarity sake I&#8217;ve omitted a couple of things, but this code runs. If you run it, you&#8217;ll see bunch of particles moving at a constant speed, moving offscreen. Our simplest of simple particle system works, so now we can start looking at performance and why we need to change the structure for performance.</p>
<p><strong>Performance, the small issues</strong></p>
<p>If you aware of performance caveats within Flash, you&#8217;ll immediately notice a couple of things, amongst which the lesser problems like for instance;</p>
<pre class="brush: as3; title: ; notranslate">bitmapData.fillRect(bitmapData.rect,0x000000);</pre>
<p>A lesser known fact about this piece of code is that the property rect of the bitmapdata is not a static read-only rect, but that every time you query this property a new rect is instantiated. Instantiation is rather expensive in the AVM2, but in this case, it&#8217;s called once per frame, thus not a major issue. Still it&#8217;s unneeded. Keep this in mind when you do many things per frame with bitmapdata.rect. In general, keep in mind that instantiation &amp; allocation is expensive.</p>
<p>If you ever had one of those swf&#8217;s which seemed to hickup every now and then, chances are that it is the garbage collector kicking in. It doesn&#8217;t have to be one specific place where you are instancing to many objects, it might be more then one. So keep things clean from the beginning. Also keep in mind that many small performance losses will result in one big one.</p>
<p><strong>The larger performance costs</strong></p>
<p>There&#8217;s multiple things we can optimize in this piece of code. For now let&#8217;s keep it a bit simple and look at the larger issues, where we get the most gain. One of the main issues is how we store and access the individual particles.</p>
<pre class="brush: as3; title: ; notranslate">particles = new Array();</pre>
<p>We currently store them in an (as always in ActionScript) untyped array. If we&#8217;d like to keep the &#8220;storage&#8221; an array like structure, we would be better off using a Vector for storage, but we can get it even a bit faster by using a <a href="http://en.wikipedia.org/wiki/Linked_list">linked list</a> instead. For the purposes of this simple particle system, that data structure is enough, as we are only going to linearly iterate over the particle set in one direction. This is called a singly linked list.</p>
<p>Let&#8217;s have a look at how that works.</p>
<p><strong>Linked List</strong></p>
<p>First, we modify our Particle class, to contain a link to the next particle in the list, by adding this to its properties.</p>
<pre class="brush: as3; title: ; notranslate">public var next:Particle;</pre>
<p>Then we modify the Main class to instanciated the particles like this :</p>
<pre class="brush: as3; title: ; notranslate">
var particle:Particle;
var previousParticle:Particle;
for(var i:int = 0; i&lt;=1000;i++){
	particle = new Particle(Math.random() * 550, Math.random() * 400, Math.random() * 2 - 1, Math.random() * 2 - 1);
	particle.next = previousParticle;
	previousParticle = particle;
}
firstParticle = particle;
</pre>
<p>For every particle we create we store a reference to the previous particle in that particle. Then when we are done with the loop we keep a reference to the last created particle. That particle refers to the particle created before that, and so on, until we reach the first particle which has no reference to any particle.</p>
<p>We now update the drawloop to do the following;</p>
<pre class="brush: as3; title: ; notranslate">
var p : Particle = firstParticle;
while (p) {
	p.updateAndDraw(bitmapData);
	p = p.next;
}
</pre>
<p><strong>Final(ly) ?</strong><br />
Using a linked list instead of an Array helped, but we can even more performance for free, by adding the “final” keyword to the particle class.</p>
<pre class="brush: as3; title: ; notranslate">final public class Particle {</pre>
<p>You would use the final keyword normally to prevent classes from being subclassed, but there is an interesting piece about final in <a href="http://onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf">Flash AS3 and AVM2 performance tuning</a>, which by now is an aged document. In this case it indicates that sealing classes using the final keyword helps the AVM because the properties are already resolved and bound.</p>
<p>I find that in Flash Player 10.1 the advantage is less noticable then 10 and before, but it still has a slight performance gain on my machine, although I&#8217;ve heard it been debated more then one time. It seems to me also that some platforms/architectures benefit more then others. My naive way of thinking about it is that if you&#8217;re not going to subclass it anyway, you might as well finalize it. Simplicity.</p>
<p><strong>Function calling</strong><br />
It may seem obvious to call a method of an object (like with car.drive()), but if you want maximum performance you should avoid function calls. With this in mind, let’s take another look at our draw loop :</p>
<pre class="brush: as3; title: ; notranslate">
var p : Particle = firstParticle;
while (p) {
	p.updateAndDraw(bitmapData);
	p = p.next;
}
</pre>
<p>The updateAndDraw call here is the costliest thing in the main loop. Not because what it does, but because it is a function. In general, function calling is always going to have some form of overhead, but in the case of Flash / AVM2 / AS3, the cost is exceptionally high. Although this situation has improved with Flash 10.1, the overall hit of just calling a function inside the loop is way to high to be acceptable if we want to achieve high numbers of particles.</p>
<p><strong>Inlining</strong></p>
<p><a href="http://en.wikipedia.org/wiki/Inline_expansion">Inlining</a> is something a compiler does for for you to replace a method call with the actual functionality in place of the function call.</p>
<p>AS3 does not have an inline keyword natively, and the compiler wouldn&#8217;t know what to do with it. <a href="http://blog.joa-ebert.com/">Joa Ebert&#8217;s</a> <a href="http://code.google.com/p/apparat/">Apparat tool suite</a>, written in <a href="http://www.scala-lang.org/">Scala</a>,provides amongst other incredibly handy things a way <a href="http://blog.joa-ebert.com/2010/05/26/new-apparat-example/">to do inlining in AS3</a>. I highly recommend using it for larger projects where code style and performance are important. I actually also would highly recommend it for any project where performance is a priority. For this instance though, let&#8217;s go to a simpler solution first.</p>
<p>We&#8217;ll remove the updateAndDraw method from the particle class and make our main loop look like this.</p>
<pre class="brush: as3; title: ; notranslate">
var p : Particle = firstParticle;
while (p) {
	p.x += p.velX;
	p.y += p.velY;
	bitmapData.setPixel(p.x,p.y,0xFFFFFF);
	p = p.next;
}
</pre>
<p>Yay. For now you&#8217;ll have to take my word for it, but this is faster. (later on in this series will prove this with benchmark tests, I wanted to avoid this post just being a bunch of charts and performance graphs).</p>
<p><strong>Yet another function call.</strong></p>
<p>While looking at this new snippet, immediately you&#8217;ll notice another function call in our mainloop.</p>
<pre class="brush: as3; title: ; notranslate">bitmapData.setPixel(p.x,p.y,0xFFFFFF);</pre>
<p>The bitmapData.setPixel is yet another function call being called as many times as there are particles. What&#8217;s important to note though is that Flash native API calls are faster then calls to methods in non &#8220;api&#8221; classes. So although the bitmapdata.setpixel call is costing us more then it should, it still not costs as much as calling a method on one of your objects.</p>
<p>Still, there is cost associated to this function call, and we can avoid it by inlining the method again. setPixel() is an incredibly handy utility function though, so we need to replace its functionality by a piece of code which mimicks its behaviour. Also, we need to write to the bitmapdata&#8217;s data by hand.</p>
<p>I&#8217;m not going to jump into using Alchemy / FastMemory just yet, so for now we&#8217;re going to use the next fastest accessible type that is available in AS3. Vector.</p>
<p><strong>Drawing to a Vector instead</strong></p>
<p>One can avoid drawing to a bitmap using setPixel and use a faster way to do so using a Vector object. While certainly not the fastest way to write to a bitmapdata, it&#8217;s probably the fastest way to do it in pure actionscript without any external tools. In comparison to using setPixel in our main loop, it should be a very good performance improvement.</p>
<p>One of the things setPixel did for us was bounds checking. Since we won&#8217;t use it anymore, we need to do it ourselves, so that we don&#8217;t write to a position in the vector that is outside of the bounds of the vector. At the same time, we&#8217;ll use this to resolve another issue. The particles were randomly flying offscreen. Instead of that we&#8217;ll respawn them at their starting position. We&#8217;ll add these properties to the particle class.</p>
<pre class="brush: as3; title: ; notranslate">
final public class Particle  {

		public var x:Number;
		public var y:Number;
		public var velX:Number;
		public var velY:Number;
		public var spawnX:Number;
		public var spawnY:Number;
		public var next:Particle;

		public function Particle(x:Number, y:Number, velX:Number, velY:Number) {
			this.spawnX = this.x = x;
			this.spawnY = this.y = y;
			this.velX = velX;
			this.velY = velY;
		}
}
</pre>
<p>And here is our main renderloop :</p>
<pre class="brush: as3; title: ; notranslate">
private function onEnterFrame(event : Event) : void
		{
			// Clear the stage
			bitmapData.lock();
			bitmapData.fillRect(bitmapRect, 0x000000);
			var vec:Vector.&lt;uint&gt; = bitmapData.getVector(bitmapRect);

			var w : int = bitmapRect.width;
			var h : int = bitmapRect.height;
			// Access particles and draw them
			var p : Particle = firstParticle;
			while (p) {
				p.x += p.velX;
				p.y += p.velY;
				if(p.x &gt; w || p.x &lt; 0){
					p.x = p.spawnX;
				}
				if (p.y &gt; h || p.y &lt; 0) {
					p.y = p.spawnY;
				}
				vec[int(w*int(p.y) + int(p.x))] = 0xFFFFFFFF;
				p = p.next;
			}
			bitmapData.setVector(bitmapRect, vec);
			bitmapData.unlock();
		}
</pre>
<p>While this setup is still far from optimal from a performance perspective, we&#8217;ve got a reasonably fast way to render 10 to 20k particles to screen.</p>
<p>One note here is the bitmapData.getVector and setVector.<br />
This still isn’t that optimized &#8211; the function call “BitmapData.getVector” creates a new Vector object every time we call it, and as you know, creating objects takes CPU and memory allocation. Ideally the function should allow us to pass it a pre-existing vector object for it to populate with data. There are a couple of examples of this throughout the Flash API&#8217;s, and I truly hope Adobe will address these in future versions of the Flash Player. The benefit here of using getVector is that we can quickly clear the entire vector. Or if you would play around with this, you could not fillrect the bitmapdata and blur it slightly every frame.</p>
<p>For reference, what we have now looks like this, and can be download as source here: <a class="downloadlink" href="http://unitzeroone.com/blog/wp-content/plugins/download-monitor/download.php?id=1" title="Version1 downloaded 576 times" >MainOneVersionOne (576)</a></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="MainOne" width="640" height="400" align="center" name="MainOne">
      <param name="movie" value="http://unitzeroone.com/blog/wp-content/uploads/MainOne1.swf" />
      <param name="align" value="center" />
      <param name="name" value="MainOne" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://unitzeroone.com/blog/wp-content/uploads/MainOne1.swf" width="640" height="400" align="center" name="MainOne">
      <!--<![endif]-->
        </p>
<p>What, you don\&#8217;t have Flash ? And you are still reading my blog ? Kudos to you!</p>
<p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><strong>So far, simple enough, right ?</strong></p>
<p><span style="color: #000000;">I&#8217;ve kept everything quite simple so far to illustrate a couple of mostly obvious performance hints, and to set a frame of reference for the follow up article, part two. Technically this solution is far from the optimal solution to run particles. But for experimenting with moving the particles in a more interesting fashion, its good enough for Part One of this series. The benefit is that we can still express all the code in ActionScript. We&#8217;ll add a little bit of PixelBender in the mix to get comfortable with it and use it as an example of manipulating data with PixelBender.</span></p>
<p><span style="color: #000000;"><strong>Velocity Field ?</strong></span></p>
<p><span style="color: #000000;">Visually this example is completely boring, so let&#8217;s make it a bit more interesting. We&#8217;ll start by making the particles move to a background pattern. We&#8217;ll use some perlin noise and pixelbender to generate a <a href="http://en.wikipedia.org/wiki/Vector_field" target="_blank">vector field</a> for the particles to read from.</span></p>
<p><span style="color: #000000;">We&#8217;ll use a vector similar to the vector we are using to draw to the bitmapdata we did earlier, and mix in some perlin noise to convert grayscale perlin noise to velocities to be quickly looked up by the particles. We start by adding some code to the Main class, let&#8217;s start with the init method.</span></p>
<p><span style="color: #000000;"> </span></p>
<pre class="brush: as3; title: ; notranslate">
private function init():void
{
	//Get some perlin noise in grayscale to read in our pixelbender filter.
	var perlinMap:BitmapData = new BitmapData(WIDTH, HEIGHT, false, 0x000000);
	perlinMap.perlinNoise(128, 128, 6, 123456, true, false,7,true);

	//Load the embedded shader bytearray into a new shader.
	var velocityConverterShader : Shader = new Shader(new VelocityConverter() as ByteArray);
	var velocityConverterFilter : ShaderFilter = new ShaderFilter(velocityConverterShader);

	//Create a new temporary bitmapdata to write the filter result too.
	var perlinVelocityMap : BitmapData = perlinMap.clone();
	perlinVelocityMap.applyFilter(perlinMap, perlinMap.rect, perlinMap.rect.topLeft, velocityConverterFilter);

	// And get the result into a fastly readable vector
	velocityVector = perlinVelocityMap.getVector(perlinVelocityMap.rect);

	//Nicely dispose of the memory used by the two bitmapdata's.
	perlinVelocityMap.dispose();
	perlinMap.dispose();

	//Create a canvas to draw too
	bitmapData = new BitmapData(WIDTH, HEIGHT, false, 0x000000);
	bitmapRect = bitmapData.rect;
	bitmap = new Bitmap(bitmapData);
	addChild(bitmap);

	//Initialize the particles and keep them as a linked list.
	var particle:Particle;
	var previousParticle:Particle;
	for(var i:int = 0; i&lt;=1000;i++){
		particle = new Particle(Math.random() * WIDTH, Math.random() * HEIGHT, Math.random() * 2 - 1, Math.random() * 2 - 1);
		particle.next = previousParticle;
		previousParticle = particle;
	}
	firstParticle = particle;

	//Wait to be added to stage
	addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
</pre>
<p><span style="color: #000000;">As you can see we added some code and a new property to our mainclass, to hold a reference to a &#8220;velocity vector&#8221;. This Vector will contain values much like colors. There&#8217;s many ways to get pixelbender to output data. To be able to read the data quickly in our mainloop, we need a vector again. So the easiest way to get a vector with uint&#8217;s from a pixelbender is to actually let it render to a bitmapdata. </span></p>
<p><span style="color: #000000;">The reason we are using 2 bitmapdata&#8217;s is that it&#8217;s significantly cheaper to instanciate them yourself and pass them, then to pass 1 bitmapdata for pixelbender to use as input and output, as it will allocate a block of memory for the output in any case. This way it&#8217;s faster and we have more control.</span></p>
<p>After the pixelbender filter has done it processing, we simple do a getVector on the bitmapdata to get the result into a Vector.&lt;uint&gt;.</p>
<p><strong>A tiny bit of pixelbending</strong></p>
<p>To get familiar with pixelbender kernels, we&#8217;re going to use one to calculate the data in our velocity field with. The pixelbender filter is one of a very simple kind, let&#8217;s have a look at it. It only has one input and it samples four pixels for every pixel it evaluates. Sampling from data within the Pixelbender is quite heavy, but for now we will only run this filter during the initialization of our swf. It might be fast enough to run every frame even.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;languageVersion : 1.0;&gt;

kernel VelocityConverter
&lt;   namespace : &quot;com.unitzeroone&quot;;
    vendor : &quot;UnitZeroOne&quot;;
    version : 1;
&gt;
{
    input image4 src;
    output pixel4 dst;

    void
    evaluatePixel()
    {
        const float halve = 0.5;
        const float3 offsets = float3(0.0,1.0,-1.0);//We'll swizzle these around in our sampling.
        float4 left = sampleNearest(src,outCoord()-offsets.zx);
        float4 right = sampleNearest(src,outCoord()-offsets.yx);
        float4 top = sampleNearest(src,outCoord()-offsets.xz);
        float4 bottom  = sampleNearest(src,outCoord()-offsets.xy);

        //We'll store the slopes in green and blue, the two lower bytes in the vector.
        dst.r = 0.0;// We don't need to set r, but on some older flash players this caused bugs.
        dst.g = ((left.b-right.b)*halve)+halve;//Get the slope value between left and right, and normalize to 0-1
        dst.b = ((top.b - bottom.b)*halve)+halve;//Get the slope value between top and bottom and normalize to 0-1
        dst.a = 1.0;//We're using four channels, because we use shaderfilter.

    }
}
</pre>
<p>What this filter does is that it calculates the so called <a href="http://en.wikipedia.org/wiki/Finite_difference" target="_blank">central difference</a> for every pixel, using its connecting neighbours and store them back into the color channels. Let&#8217;s look at its input and output to have a visual reference before discussing it further.</p>
<p>The input &amp; output.</p>
<p><a href="http://unitzeroone.com/blog/wp-content/uploads/input.jpg"><img class="aligncenter size-full wp-image-517" title="Perlin Noise Input" src="http://unitzeroone.com/blog/wp-content/uploads/input.jpg" alt="" width="640" height="480" /></a><a href="http://unitzeroone.com/blog/wp-content/uploads/output.jpg"></a></p>
<p><a href="http://unitzeroone.com/blog/wp-content/uploads/output.jpg"><img class="aligncenter size-full wp-image-518" title="output" src="http://unitzeroone.com/blog/wp-content/uploads/output.jpg" alt="" width="640" height="480" /></a></p>
<p><span style="color: #000000;">Although that wikipedia page about the central difference might have scared you off, all in all what it does is very simple. For every pixel you look at the connecting neighbours in both directions and you look at the difference between that and store that. Note that we are normalizing the value, so that the maximum negative value of -1 and the maximum value of +1 fit in a range 0 to 1. This way we can read these values later on in our mainloop. We store the result for the difference on the horizontal axis in the green channel and the result for the vertical axis in the blue channel, hence the blue green teint of the image.</span></p>
<p><span style="color: #000000;">It&#8217;s good to note that PixelBender really makes these types of image calculations fast and simple. Long before PixelBender we had to do this using combinations of filters and copy channels to do this quickly enough. <a href="http://unitzeroone.com/flashexamples/bumpMapping/" target="_blank">My first experiment with fast bumpmapping</a> from a <a href="http://unitzeroone.com/blog/2006/03/28/flash-8-example-3d-bumpmapping-using-filters-source-included/" target="_blank">long, long time ago</a> used that way of doing it. When I started working on Papervision3D it resulted in <a href="http://unitzeroone.com/papervision/paperPlanet/Main.html" target="_blank">this experiment</a>.</span></p>
<p><span style="color: #000000;"><strong>Making things move</strong></span></p>
<p><span style="color: #000000;">Now that we have this new set of data, how do we make our particles dance to it ? The reason we wrote too a vector uint is so that we can read from it quickly. But we store the data in two different channels, being blue and green. Let&#8217;s take that data out and manipulate our particles velocities using it.</span></p>
<p><span style="color: #000000;">Our main loop will look something like this;</span></p>
<pre class="brush: as3; title: ; notranslate">
while (p) {
	//Add the current velocity to the particle position
	p.x += p.velX;
	p.y += p.velY;

	//Keep the particles in bounds
	if(p.x &gt; w || p.x &lt; 0){
		p.x = p.spawnX;
	}
	if (p.y &gt; h || p.y &lt; 0) {
		p.y = p.spawnY;
	}

	//Calculate the new position index;
	pos = (w*int(p.y) + int(p.x));

	//Draw the pixel
	vec[pos] = 0xFFFFFFFF;

	// Read the velocityfield at the new particles position
	var velocities : int = velocityVector[pos];
	var velXU : int = ((velocities&gt;&gt;8)&amp;0xFF)-127.5;
	var velYU : int = ((velocities)&amp;0xFF)-127.5;

	//Add a fraction of the position velocity to the current velocity
	p.velX += velXU*.073;
	p.velY += velYU*.073;

	// Dampen the current particle velocity
	p.velX = p.velX*.99;
	p.velY = p.velY*.99;

	p = p.next;
}
</pre>
<p>This bit of actionscript :</p>
<pre class="brush: as3; title: ; notranslate">
var velXU : int = ((velocities&gt;&gt;8)&amp;0xFF)-127.5;
var velYU : int = ((velocities)&amp;0xFF)-127.5;
</pre>
<p>If your unfamilar with <a href="http://en.wikipedia.org/wiki/Mask_(computing)" target="_blank">masking</a> and <a href="http://en.wikipedia.org/wiki/Bitwise_operation" target="_blank">bitwise operations</a>, this might look slightly strange. But if you have worked with colors using setPixel before, you might be familiar with the pattern here. Basically we extract the &#8220;color&#8221; as output by PixelBender from the green and blue channel. I put color in quotes there, because it&#8217;s not what we use it for. We simple use the byte packing into uint&#8217;s as a way to quickly access one value in a vector (which is the heaviest), and then unpack it into two of its components. A uint in Flash is 32 bit, so it contains 4 bytes. In theory we have 2 bytes left for storing other data. More on that in part two.</p>
<p>And it does almost exactly the opposite of what this did in the pixelbender loop :</p>
<pre class="brush: plain; title: ; notranslate">
dst.g = ((left.b-right.b)*0.5)+0.5;
dst.b = ((top.b - bottom.b)*0.5)+0.5;
</pre>
<p>The only difference is that pixelbender treats the color value as a range between 0-1 and that our actionscript values will now be filled with a value between -127.5 and 127.5. We handle putting the particle velocities to reasonable values by multiplying them by a rather small value. Play around with the values if you like.</p>
<p>To assure that the particles don&#8217;t pick up an infinite speed we dampen it by multiplying by a value near to one, as to only slightly lower it every loop.</p>
<pre class="brush: as3; title: ; notranslate">
p.velX = p.velX*.99;
p.velY = p.velY*.99;
</pre>
<p><strong>So is it magical yet ? </strong></p>
<p>If we look at what it looks like now with a thousand particles, we see this:</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="MainOneTwo" width="640" height="480" name="MainOneTwo">
      <param name="movie" value="http://unitzeroone.com/blog/wp-content/uploads/MainOne2.swf" />
      <param name="name" value="MainOneTwo" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://unitzeroone.com/blog/wp-content/uploads/MainOne2.swf" width="640" height="480" name="MainOneTwo">
      <!--<![endif]-->
        Still here without Flash huh ? You\&#8217;re persistent ! 
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>So, no it&#8217;s still rather uninteresting. Although our particles do seem to have to taken up a life on their own.</p>
<p><strong>Adding complexity by adding the numbers</strong></p>
<p>The particles seem to settle in areas, and the randomness of their movement and location is worsened by the fact that they are moving over perlin noise, where the noise part of that implies it&#8217;s somewhat random.</p>
<p>As I said at the beginning of this post, part of the percieved complexity of a particle system is in its numbers. What happens if we replace the perlin noise by a picture and add a lot more particles, let&#8217;s say 20.000 ? And then tweak the values a bit ?</p>
<p><a href="http://www.unitzeroone.com/particlesessions/pSessionsOne/" target="_blank">Click here</a> to see what that looks like.</p>
<p>Get the source here : <a class="downloadlink" href="http://unitzeroone.com/blog/wp-content/plugins/download-monitor/download.php?id=3" title=" downloaded 665 times" >Session One Final Source (665)</a></p>
<p><strong>Closing and what will follow</strong></p>
<p><span style="color: #000000;">The length of this simple introductory Session One already got way out of hand, so it&#8217;s time to close for this session, which means that unfortunately Alchemy is saved for next week. We&#8217;ve covered the basics of a reasonably performant particle system in pure, directly compilable AS3.</span></p>
<p><span style="color: #000000;">To continue this series and make the example code do a lot more then it does now, we need to start diving much deeper in PixelBender and the Alchemy-memory within Flash Player. We&#8217;ll be able to increase the number of particles to a much higher count then 20.000 of them using these techniques and hopefully be able to fully understand why and how. Along the way we&#8217;ll be able to look at how these technologies function inside the Flash Player.</span></p>
<p><span style="color: #000000;">Hopefully, we&#8217;ll polish up this example to a point where it&#8217;s starting to become interesting to look at. You&#8217;d be surprised to see how close we are to achieving something like the <a href="http://unitzeroone.com/labs/particlehd/" target="_blank">Particle Reactor</a> with the current source code. But to be able to fully explain ways of using PixelBender and Alchemy, we need about another time the length of this post. </span></p>
<p><span style="color: #000000;">Until then, I would love to see your experiments based upon the source code above. If you do happen to do anything with it, please send it over and if there is enough response, maybe we&#8217;ll add it to next the post. I&#8217;ll give you some hints; dynamic vector fields, colors, trails.</span></p>
<p>I would like to thank <a href="http://sebleedelisle.com/" target="_blank">Seb Lee-Delisle</a> for reviewing this post and helping me to get it cleaner, better and more to the point. Another big thank you to <a href="http://techblog.floorplanner.com/" target="_blank">Tim Knip</a> for reading and pointing out the missing explanations.</p>
<p>I would also greatly appreciate any feedback on this article from you. I&#8217;m new to writing large articles / tutorials like this, and would love to hear what you think and what you would like to see.</p>
<p><span style="color: #000000;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2011/01/16/the-particle-sessions-part-one-is-this-it/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Bloom</title>
		<link>http://unitzeroone.com/blog/2009/12/01/bloom/</link>
		<comments>http://unitzeroone.com/blog/2009/12/01/bloom/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 14:12:05 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bloom]]></category>

		<guid isPermaLink="false">http://www.unitzeroone.com/blog/?p=307</guid>
		<description><![CDATA[(people who want to know more would refresh after seeing the pieces in full)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.letitbloom.com/#ralph"><img class="alignnone" title="Bloom" src="http://www.unitzeroone.com/images/bloomScreen.jpg" alt="" width="430" height="231" /></a></p>
<p>(people who want to know more would refresh after seeing the pieces in full)</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2009/12/01/bloom/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Triangle3D : Small Flash 10 3D demo.</title>
		<link>http://unitzeroone.com/blog/2009/11/17/triangle3d-small-flash-10-3d-demo/</link>
		<comments>http://unitzeroone.com/blog/2009/11/17/triangle3d-small-flash-10-3d-demo/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 17:23:10 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[User Groups]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash3d]]></category>
		<category><![CDATA[triangle3d]]></category>

		<guid isPermaLink="false">http://www.unitzeroone.com/blog/?p=298</guid>
		<description><![CDATA[Over the last days I&#8217;ve spent some time twittering back and forth with Eugene. His supershape demo is very cool and we spent some time &#8216;tweeting&#8217; about shaders. This lead me to upload and twitter one of my experiments which &#8230; <a href="http://unitzeroone.com/blog/2009/11/17/triangle3d-small-flash-10-3d-demo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<dl class="wp-caption alignnone" style="width: 440px;">
<dt class="wp-caption-dt"><a href="http://www.unitzeroone.com/labs/Triangle3DOld/Alt.html"><img title="Triangle3DMorph" src="http://www.unitzeroone.com/images/Triangle3DMorph.jpg" alt="Screenshot from the realtime Flash3D demo." width="430" height="234" /></a></dt>
</dl>
</div>
<p><a href="http://www.unitzeroone.com/labs/Triangle3DOld/"><img class="alignnone" src="http://www.unitzeroone.com/images/Triangle3DMorphOriginal.jpg" alt="" width="430" height="195" /></a></p>
<p>Over the last days I&#8217;ve spent some time <a href="http://www.twitter.com/UnitZeroOne" target="_blank"><strong>twittering</strong></a> back and forth with <a href="http://blog.inspirit.ru" target="_blank"><strong>Eugene</strong></a>. His <strong><a href="http://blog.inspirit.ru/?p=364" target="_blank">supershape demo</a></strong> is very cool and we spent some time &#8216;tweeting&#8217; about shaders. This lead me to upload and twitter one of my experiments which I used as part of my FOTB / MAX presentation. Judging by the huge number of retweets it seems people enjoyed it a lot, so I figured that it was worth a blog post. I started working on this experiment a while back after toying around with OpenGL, OpenFrameworks and audio reactive shapes and that inspired me to do something similar in Flash. This is an unfinished demo as it lead me to pursue something else, at which point I stopped working on it.</p>
<p>In the session where this came from, specifically this part, I shared information about the path of yet another demo, where this experiment led me too. Some of you who attended Flash on the Beach, might recall it from the Adobe keynote, where it was aptly named &#8220;milky ball&#8221;.  I&#8217;ll present on it one more time on the 3rd of December at the <strong><a href="http://www.adobeusergroupxl.nl" target="_blank">AUG XL event</a></strong>, in Amsterdam. I&#8217;ll post more of the session&#8217;s demos with explanation, when I have the time.</p>
<p>I do want to clarify that the code base I&#8217;ve created for this, which I currently call Triangle3D, is not to be a new Papervision3D, Away3D, Alternativa3D, Infinity3D, Sandy3D, Null3D or Yogurt3D (I&#8217;m probably missing a couple, sorry, have your way in the comments). It&#8217;s my experimental playground of classes to play around, with no care for architecture restrictions or a generalized API. It&#8217;s all about me playing and enjoying. Pure experimentation of what can be achieved with Flash 3D and hoping to find something beautiful in it.</p>
<p><a href="http://www.unitzeroone.com/labs/Triangle3DOld/" target="_blank"><strong>Orignal unfinished demo</strong></a></p>
<p><a href="http://www.unitzeroone.com/labs/Triangle3DOld/Alt.html" target="_blank"><strong>Demo with adjusted lightmaps from my new mirrorball.</strong></a></p>
<p><a href="http://www.flickr.com/photos/unitzeroone/4102372725/" target="_blank"><strong>(here&#8217;s the shot of the mirrorball, on flickr).</strong></a></p>
<p>The music track is Sixtyten by Boards of Canada.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2009/11/17/triangle3d-small-flash-10-3d-demo/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Adobe User Group NL XL</title>
		<link>http://unitzeroone.com/blog/2009/10/28/adobe-user-group-nl-xl/</link>
		<comments>http://unitzeroone.com/blog/2009/10/28/adobe-user-group-nl-xl/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 14:41:33 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.unitzeroone.com/blog/?p=295</guid>
		<description><![CDATA[My favorite Adobe User Group does it again! And how! At the threshold of end of the year, on the 3rd December, the dutch AUG in co-operation with Adobe presents to you a full XL event. With the popularity of &#8230; <a href="http://unitzeroone.com/blog/2009/10/28/adobe-user-group-nl-xl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://adobeusergroupxl.nl/"><img class="alignnone" title="Adobe Usergroup XL" src="http://www.unitzeroone.com/images/augxl.jpg" alt="" width="430" height="121" /></a></p>
<p>My favorite Adobe User Group does it again! And how! At the threshold of end of the year, on the 3rd December, the dutch AUG in co-operation with Adobe presents to <strong><a href="http://adobeusergroupxl.nl/" target="_blank">you a full XL event</a></strong>. With the popularity of the normal meetings rising and rising and these event being of an exceptional level for any type of usergroup, this time, the lid is fully blown off!</p>
<p>The XL event will bring some great national and international speakers to the stage; Dave August of <a href="http://www.ooo-ii.com/"><strong>OOOii</strong></a> will talk about his use of Flash in JJ Abram&#8217;s Star Trek, as well as his creative input to movies such as Fast &amp; Furious. Tobias Mannewitz of <a href="http://karakterconcept.com/" target="_blank"><strong>Karakter</strong></a> will be there and with work on projects for Spellbound, EA Games and SCEE this promises to be a session not to miss! Anita and Geoff from <a href="http://www.champagnevalentine.com/" target="_blank"><strong>Champagne Valentine</strong></a> will amongst other great things talk about an interactive music video they created for Placebo.  Adobe will give you insights in their products and tooling with such international renowned speakers / evangelists as <a href="http://www.sergejespers.com"><strong>Serge Jespers</strong></a>, <a href="http://blogs.adobe.com/jlevmedia" target="_blank"><strong>Jason Levine</strong></a> and <a href="http://www.mad.com.au/" target="_blank"><strong>Paul Burnett</strong></a>. If that&#8217;s not enough, Niko Stumpo of <a href="http://www.hanazuki.com" target="_blank"><strong>Hanazuki </strong></a>will be talking about the studio&#8217;s new work together with Mark Barzinski of <a href="http://www.barcinski-jeanjean.com" target="_blank"><strong>Barzinski and Jean Jean</strong></a>. Dirk Groten of <a href="http://www.layar.com" target="_blank"><strong>Layar</strong></a> fame will be talking about the Layar platform, something I&#8217;m looking forward to find out more about. Last but hopefully not least, I was honored to get an invitation to speak, and I will be talking about my latest forays into realtime flash.</p>
<p><span id="more-295"></span></p>
<p>This lineup is already stellar, with more names to come and be added to the list! Combine that with the friendly atmosphere and a great place to extend your network, learn and enjoy, this is an event not to be missed. Even if this is run by the <strong>dutch </strong>usergroup, I wouldn&#8217;t be surprised if people come in from all over, as this XL event truly is XL. Be there! And if you do, make sure you say hi!</p>
<p>Get more information at the <a href="http://adobeusergroupxl.nl/" target="_blank"><strong>XL webpage</strong></a>, <a href="http://twitter.com/adobeusergroup" target="_blank"><strong>follow the AUG on twitter</strong></a>, and order the <a href="http://adobeusergroupxl.nl/tickets" target="_blank"><strong>insanely low priced tickets here</strong></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2009/10/28/adobe-user-group-nl-xl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Source : Better Flash 10 3D interaction : ArcBall</title>
		<link>http://unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/</link>
		<comments>http://unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:15:04 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.5d]]></category>
		<category><![CDATA[arbcall]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.unitzeroone.com/blog/?p=269</guid>
		<description><![CDATA[With the addition of the 2.5d API in Flash 10, lot&#8217;s of developers now have even easier access to basic 2.5D environments. But with those new capabilities and API&#8217;s new challenges for developers arise. Famously, Flash 10 doesn&#8217;t do the &#8230; <a href="http://unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="My artistic rendering." src="http://www.unitzeroone.com/images/ArcBallPostImage.jpg" alt="" width="430" height="430" /></p>
<p>With the addition of the 2.5d API in Flash 10, lot&#8217;s of developers now have even easier access to basic 2.5D environments. But with those new capabilities and API&#8217;s new challenges for developers arise. Famously, Flash 10 doesn&#8217;t do the Z-Sorting natively. When <a href="http://theflashblog.com/" target="_blank"><strong>Lee Brimelow</strong></a> asked me if I could send him an easy solution for that, I sent him the <a href="http://theflashblog.com/?p=470" target="_blank"><strong>SimpleZSorter</strong></a>. Which he in turn used to paste my profile picture on as much as possible planes, but more significantly, <a href="http://gotoandlearn.com/play?id=92" target="_blank"><strong>use for this tutorial</strong></a>.</p>
<p>Althought the name Simple would imply something a bit away from a PerfectZSorter (which, technically, has some challenges considering the 2.5D API and the player performance, don&#8217;t ask), the thing which astounded me was the amount of feedback. Sure, more people had asked me for such a solution and this simple little tool did it for them most of the time.</p>
<p>But considering the simplicity of the SimpleZSorter and the amount of feedback I got on it (even if I didn&#8217;t publish on it myself) made clear that although the 2.5D API of Flash 10 opened up loads of opportunities for developers and designers a like, some of the simpler issues aren&#8217;t addressed by it, whist there is clearly a need for it. That need can be addressed and with this post I&#8217;m hoping to do a another small part.</p>
<p><strong>The ArcBall</strong></p>
<p>One of the questions which people have been asking me about for in relation to using the 2.5D API, is (loosely combined) &#8220;How do I rotate things in 3D correctly with the mouse&#8221;.As this question came more and more, I&#8217;ve also realized how fundamental this is to our community. With Flash 10 we have native realtime (2.5D) 3D, but with realtime comes interactivity. And what use is it for users to have a 3D interface, while the controls are not intuitive ? At that point 3D becomes a worse experience, rather then a better. While this solution won&#8217;t address every issue with that, it most certainly addresses one, 3D rotation dragging.</p>
<p><span id="more-269"></span>Native 3D interaction might be new to Flash, but it certainly isn&#8217;t new to Flash 3D, or 3D in general for that matter. And the problem of having a user rotate an object with a mouse has been addressed before in numerous different ways. So luckily the wheel doesn&#8217;t need any inventing. The wheel I chose for to address this problem is called an <strong><a title="ArcBall Paper" href="http://portal.acm.org/citation.cfm?id=155312" target="_blank">ArcBall</a></strong>, first proposed by Ken Shoemake.  Now if you want to read that paper go ahead, but let me define this in flashers <span style="text-decoration: line-through;">layman</span> terms.</p>
<p><strong>The Problem</strong></p>
<p>Let&#8217;s first have a look at the problem as I&#8217;ve seen examples of code of people and derived it to this &#8220;problem&#8221; example. Drag the cube to rotate it.</p>
<p>[kml_flashembed publishmethod="static" fversion="10.0.0" useexpressinstall="true" movie="http://www.unitzeroone.com/labs/arcball/wrong/example/Main.swf" width="430" height="430" targetclass="flashmovie"]<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
<p>[/kml_flashembed]</p>
<p>Although the mouse dragging does offer some feeling of control, you&#8217;ll find it difficult to rotate it in a natural intuitive way, to let&#8217;s say to the front of one of those colored planes. Here&#8217;s what&#8217;s happening here in that code, and what I&#8217;ve been seeing most.</p>
<pre lang="actionscript">if(isDragging){
boxSprite.rotationX = mouseY;
boxSprite.rotationY = mouseX;
}</pre>
<p>This is example is the most common and is responsible for the example above. Now, the problem here is that it doesn&#8217;t take into account the local object transformation, as well as the dragging coordinates. As the object rotates around it&#8217;s axis, so do it&#8217;s axis change. Also, as the dragging goes on, we don&#8217;t take into account the 2D coordinate versus it&#8217;s 3D transformation dragging start and final output. All in all it ends up being a bit messy.</p>
<p><strong>The Solution</strong></p>
<p>Here&#8217;s the solution using the ArcBall class. Drag to rotate.<br />
[kml_flashembed publishmethod="static" fversion="10.0.0" movie="http://www.unitzeroone.com/labs/arcball/correct/example/Main.swf" width="430" height="430" targetclass="flashmovie"]</p>
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
<p>[/kml_flashembed]</p>
<p><strong>The solution, the complex part<br />
</strong></p>
<p>As you can see / feel, object rotations now feel much more direct and natural. But what is this magic ? First off all, the class is fully Flash 10, and uses it&#8217;s native methods and features, where available for this solution. To explain it as simple as possible, as you click and start dragging on the cube, a sphere is established. This virtual sphere, around the object is then used to establish a point in 3D space on the sphere. As you are dragging, your actually rotating other points on the sphere. From these angular differences on the sphere, we can derive a new transform matrix for the object.</p>
<p>The hard part is in the establishing the rotational angles from those 2 coordinates on a sphere. A well proven way to do that (and the only form I have seen in ArcBall implementations, so far), is using <strong><a title="Quaternions are scary" href="http://en.wikipedia.org/wiki/Quaternion" target="_blank">Quaternions (go ahead, read it now, all of it, I dare you)</a></strong>. Quaternions are complex things (pun intended). Now Quaternions are a bit daunting to start at and at this point I would be lying if I said I fully understand them. I&#8217;m not the only one who finds them scary, quoting <strong><a title="Keith is scared" href="http://www.bit-101.com/blog/?p=2339#comments" target="_blank">Keith Peters / Bit-101</a></strong> ; &#8220;<em>Oh no. Vector3D’s w is the second most scary w in the world.</em>&#8221; (I wonder what the first is, Keith ?).</p>
<p><strong>Quaternions and Flash 10</strong></p>
<p>If you are looking for the clearcut solution and implementation of my class for it, skip this part, otherwise, read on, enjoy.</p>
<p>The reference to the <em>w</em> in that quote is also a reference to the <span style="text-decoration: line-through;">complex component</span> real component of the quaternion, where the xyz are complex numbers. <a href="http://en.wikipedia.org/wiki/Complex_number" target="_blank"><strong>Yes, complex numbers (I dare you again)</strong></a> and their appliance is where stuff does get scary for most of us. The great thing about the Flash 10 3D and geom API is that there is a partial native support for quaternions, next to having a vector with x,y,z and w components. For instance, this:</p>
<pre lang="actionscript">matrix3D.decompose(OrientationStyle.QUATERNION);</pre>
<p>Which will return a Vector of 3 Vector3D&#8217;s, which are in order translation, rotation, and scale. When using the quaternion orientation style, the rotation will be filled with a Vector3D with it&#8217;s x,y,z,w values nicely filled; a quaternion. While this is something we could have handled ourselves (decomposing a matrix to it&#8217;s components using quaternions), it&#8217;s great Flash 10 has it. Less code, less size and it&#8217;s faster then doing it with your own defined functions.</p>
<p>This ArcBall implementation relies heavily on that piece of code and some added code to do some additional stuff with the quaternions (multiply doesn&#8217;t seem to be available native). Now while I&#8217;m not enough of an authority to try and explain quaternions, the applications for them in 3D rotation are numerous, most famously, the first thing which will get mentioned when talking about the topic of <a href="http://en.wikipedia.org/wiki/Gimbal_lock" target="_blank"><strong>Gimbal lock</strong></a>, which is a problem most encountered by astronauts and people developing 3D applications (see! us developers <strong>do</strong> have something in common with astronauts, we&#8217;re now doing rocket science!).</p>
<p>That being said, on a wider look on Quaternions, for example, Both <a href="http://blog.zupko.info/?p=150" target="_blank"><strong>Andy Zupko</strong></a> and <a href="http://pv3d.org/2008/12/29/quaternion-explorer/" target="_blank"><strong>John Lindquist</strong></a> have done some nice articles on the subject and it&#8217;s appliances in <a href="http://blog.papervision3d.org" target="_blank"><strong>Papervision3D</strong></a>. Papervision3D, running from Flash 9 and higher, has it&#8217;s own Quaternion implementation, as Flash 9 doesn&#8217;t support it natively.</p>
<p><strong>Deriving an easy solution for all</strong></p>
<p>While the solution to ArcBalls using Quaternions isn&#8217;t even that hard, I still felt the problem should be abstracted a bit more, with an easy one stop solution for all. After all, the reason I got that much feedback on the SimpleZSorter, is clearly because people actually use it. Why do people use it ? My estimate is, it addresses a real problem and it&#8217;s simple to implement. And while that might cause a little overhead, and make it less flexible, it works for people looking for a simple solution. Here&#8217;s how that was implemented.</p>
<pre lang="actionscript">SimpleZSorter.sortClips(boxSprite,true);</pre>
<p>Simple enough right ? So for the abstraction of the ArcBall something similar made sense.<br />
Using the ArcBall class (and getting your correct dragging rotations up and running in no time) works like this.</p>
<pre lang="actionscript">arcBall = new ArcBall(boxSprite);</pre>
<p>Now you can drag this object, and get nice, intuive rotations from it. There are a bunch of options to use;</p>
<pre lang="actionscript">arcBall = new ArcBall(boxSprite, useRadius, radius);</pre>
<p>If you set the useRadius argument to true, and set radius to a specific value for that object (think about a sphere which completely encapsulates the object you have, it&#8217;s bounding sphere, see my beautiful artistic rendering at the top of this post), the bounding sphere used per dragging action is the same size. When that option is left set to false, the point on the sphere is derived from the click in 3D space on that object and thus speed might vary, depending where the user start the drag.</p>
<p>Because the ArcBall class automatically adds listeners to the object, and automatically enables dragging on it, you need a way to switch it off when it&#8217;s not wanted.</p>
<pre lang="actionscript">arcBall.enabled = false;
//To enable it again
arcBall.enabled = true;</pre>
<p>So, that&#8217;s it. I hope it helps you in getting a better experience for the end user. Since this is an abstraction for ease of use and much more can be done, the entire code base for both examples and the ArcBall under the <strong><a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a></strong>; essentially, do with it what you want, if it breaks anything, it&#8217;s not my fault. Let me know what you think.</p>
<p>Lastly a mention of sources which helped me with getting this right; <a href="http://rainwarrior.thenoos.net/dragon/arcball.html" target="_blank"><strong>rainwarrior</strong></a>, <a href="http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=48"><strong>NeHe</strong></a>, <a href="http://processing.org/hacks/hacks:arcball" target="_blank"><strong>processing</strong></a>. Sharing works!</p>
<p><strong>Sources</strong></p>
<p><a href="http://www.unitzeroone.com/labs/arcball/arcball.zip"><strong>ArcBall (just the sources for use).</strong></a></p>
<p><a href="http://www.unitzeroone.com/labs/arcball/RotationWrong.zip"><strong>RotationWrong (sources for the first example, incorrect drag rotation)</strong></a></p>
<p><a href="http://www.unitzeroone.com/labs/arcball/RotationArcBall.zip"><strong>RotationArcBall (sources for the second example, correct dragging using the ArcBall class)</strong></a></p>
<p>[Update 8/9/2009]</p>
<p>Little update on the quaternion explanation.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>A PV3D book : Papervision3D Essentials</title>
		<link>http://unitzeroone.com/blog/2009/09/03/papervision3d-essentials/</link>
		<comments>http://unitzeroone.com/blog/2009/09/03/papervision3d-essentials/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 16:23:47 +0000</pubDate>
		<dc:creator>UnitZeroOne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.unitzeroone.com/blog/?p=261</guid>
		<description><![CDATA[I normally don&#8217;t delve into book reviews or endorsements; and I won&#8217;t go there just yet with this post. But I do want to get your attention for the first released Papervision3D book; Papervision3D Essentials. Written by Jeff Winder and &#8230; <a href="http://unitzeroone.com/blog/2009/09/03/papervision3d-essentials/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Papervision3D essentials" src="http://www.unitzeroone.com/images/bookCover.jpg" alt="" width="430" height="230" /></p>
<p>I normally don&#8217;t delve into book reviews or endorsements; and I won&#8217;t go there just yet with this post. But I do want to get your attention for the <a title="Order the book" href="http://www.packtpub.com/papervision3d-essentials/book" target="_blank"><strong>first released Papervision3D book; Papervision3D Essentials</strong></a>.</p>
<p>Written by <strong><a title="Jeff Winder's blog" href="http://jeffwinder.blogspot.com/" target="_blank">Jeff Winder</a></strong> and <a title="Paul Tondeur's blog" href="http://www.paultondeur.com/" target="_blank"><strong>Paul Tondeur</strong></a>, this elaborate, 13 chapter book looks great for anyone wanting to learn or deepen their knowledge of the Papervision3D API and Engine. Congratulations to both authors for getting it released! Great job!</p>
<p>Although I haven&#8217;t recieved my (<em>[total disclosure]</em> free, thank you guys), copy for review yet, the book looks promising, if you can judge it by these two free online chapters, about <strong><a title="Lines3D chapter" href="http://www.packtpub.com/article/3d-vector-drawing-and-text-papervision3d-part2?utm_source=sl_papervision_abr1_0809&amp;utm_medium=content&amp;utm_campaign=sanjiv" target="_blank">Lines3D</a></strong> and <a title="VectorVision Chapter" href="http://www.packtpub.com/article/3d-vector-drawing-and-text-papervision3d-part1" target="_blank"><strong>VectorVision</strong></a>.</p>
<p>As one of the core members of <a title="Papervision3D" href="http://blog.papervision3d.org" target="_blank"><strong>Papervision3D</strong></a> and having architectured and written rather large portions of the Papervision 2 Engine, for me personally it&#8217;s amazing to see a project like this. It&#8217;s documenting code that the team has been writing over the years and getting it on paper, along with an explanation and examples is something huge to me, as well as being huge for people wanting to start or already experienced with the engine! Having recieved multiple mails full of questions and additional bug fixes (as have other members of the team) from Paul and Jeff, I can assure they have been thorough in reviewing &amp; examplifying the Papervision code base.</p>
<p>In a way, that&#8217;s a very odd feeling; an obscure function which might have been thought up and written at 2pm at night (which during the initial dev of Papervision3D 1.7, 1.9 and 2.0 was rule, rather then exception), might now have gotten an explanation in the book.</p>
<p>One thing the project has been lacking the most though, was a paper resource to look things up; and that has now arrived!</p>
<p>I will blog a more thorough review after having recieved and read the book. Can&#8217;t wait to see this book as a piece of tangible material and actually hold it!</p>
<p>[UPDATE]</p>
<p>Another free chapter <strong><a title="external models chapter" href="http://www.packtpub.com/files/5722-papervision-3d-sample-chapter-8-external-models.pdf" target="_blank">has emerged as PDF</a></strong>. Chapter 8; modelling and importing to Papervision3D.</p>
]]></content:encoded>
			<wfw:commentRss>http://unitzeroone.com/blog/2009/09/03/papervision3d-essentials/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

