<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matt Eley &#124; Labs</title>
	<atom:link href="http://matteley.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://matteley.wordpress.com</link>
	<description>Experiments in Flash and Unity 3D</description>
	<lastBuildDate>Mon, 25 Apr 2011 13:19:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='matteley.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Eley &#124; Labs</title>
		<link>http://matteley.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://matteley.wordpress.com/osd.xml" title="Matt Eley &#124; Labs" />
	<atom:link rel='hub' href='http://matteley.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Unity 3D &#8211; Space Runner Game Demo</title>
		<link>http://matteley.wordpress.com/2010/05/04/unity-3d-space-runner-game-demo/</link>
		<comments>http://matteley.wordpress.com/2010/05/04/unity-3d-space-runner-game-demo/#comments</comments>
		<pubDate>Tue, 04 May 2010 22:35:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[Games Development]]></category>
		<category><![CDATA[Unity3D]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=372</guid>
		<description><![CDATA[This demo is my first real attempt at making something in proper 3D using Unity and follows on from the 2D Asteroids style game I made back in January. As with that earlier demo, I used C# to write all the main game scripts, while the graphics and sound effects are from downloads available from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=372&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_373" class="wp-caption alignnone" style="width: 590px"><a href="http://www.matteley.co.uk/labs/unity3d-spacerunner/" target="_blank"><img class="size-full wp-image-373    " title="Space Runner Unity Demo - Click To Play" src="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-1.jpg?w=580&#038;h=200" alt="" width="580" height="200" /></a><p class="wp-caption-text">Space Runner Unity Demo - Click To Play</p></div>
<p>This demo is my first real attempt at making something in proper 3D using Unity and follows on from the <a href="http://matteley.wordpress.com/2010/01/30/unity-3d-asteroids-style-demo/">2D Asteroids style game</a> I made back in January. As with that earlier demo, I used C# to write all the main game scripts, while the graphics and sound effects are from downloads available from the <a href="http://unity3d.com/support/resources/" target="_blank">Unity Resources</a> section of the Unity Technologies website.</p>
<p>My aim was to make something reminiscent of <a href="http://en.wikipedia.org/wiki/Category:Rail_shooters" target="_blank">classic on rails shooters</a> like <em>Starfox, Afterburner, Rez and the Panzer Dragoon series</em>. I spent quite a while looking at those games and trying to mimic the controls and camera behavior for this demo, and while it&#8217;s clearly not a patch on those games, I guess there are a few similarities in places. If you would like to play the demo please click the image above.</p>
<p><span id="more-372"></span></p>
<h3>A bit about how this demo was put together</h3>
<p>The game is split into two scenes, one for the title screen and one for the main gameplay, each scene has a controller script attached to it&#8217;s main camera which keeps an eye on everything in that scene. The game scene uses a number of prefabs for things like the starfield, the asteroids, lasers and explosions,  the controller then attaches these at runtime with a degree of randomness to make the game a bit different each time you play.</p>
<div id="attachment_387" class="wp-caption alignright" style="width: 250px"><a href="http://www.matteley.co.uk/labs/unity3d-spacerunner/"><img class="size-medium wp-image-387" title="Unity 3D Space Runner - Gameplay" src="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-2.jpg?w=240&#038;h=180" alt="" width="240" height="180" /></a><p class="wp-caption-text">Space Runner - Click To Play</p></div>
<p>The player ship is made up of a number of nested <em>GameObjects </em>to allow it to move forwards along the <em>Z axis</em>, while also freely moving on the other two axis as well as tilt and rotate to follow the users mouse position for aiming. This was probably the most complex part of the game to work out and took a lot of tweaking to get it working just right, but the outcome adds a nice floaty yet responsive feel to the craft.</p>
<p>The game&#8217;s main camera has two different modes, each controlled by a different script. The gameplay mode uses a variation of the orbit camera that comes with Unity to loosely follow the player ship. The movie mode continues to target the player ship while rotating around it at varying speeds, this mode was used for the intro and game over sequences as well as the short intermissions between each wave.</p>
<p>The music is made up of a few loops assembled in <a href="http://www.acidplanet.com/downloads/xpress/" target="_blank">Acid Xpress</a> and then imported into Unity as separate layers. Each layer is then turned on or off by the main controller at runtime allowing the soundtrack to change dynamically at key points during the game.</p>
<p>Overall the structure of this demo is much improved over the code in my previous demo, with very few uses of the <em>GameObject.Find</em> and <em>GameObject.GetComponent</em> methods to communicate between classes and much more focus on event broadcasting instead. Sure, it&#8217;s not the greatest looking game, but I&#8217;m pretty pleased with with how it plays, and while there are still a few camera bugs here and there, for the most part it works quite well.</p>
<h3>Frameworks, plugins and open source code</h3>
<p>There is now a wide range of excellent open source code available for use in your Unity projects and this demo makes use of a few of them including: the <a href="http://unity3d.com/support/resources/unity-extensions/explosion-framework" target="_blank">Detonator Framework</a>, <a href="http://www.insquare.com/itween/" target="_blank">iTween</a> and a customised version of this <a href="http://www.unifycommunity.com/wiki/index.php?title=CSharpMessenger_Extended" target="_blank">Unity C# Messenger</a> system.</p>
<div id="attachment_390" class="wp-caption alignright" style="width: 250px"><a href="http://www.matteley.co.uk/labs/unity3d-spacerunner/"><img class="size-medium  wp-image-390  " title="Unity 3D Space Runner - Gameplay 2" src="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-3.jpg?w=240&#038;h=180" alt="" width="240" height="180" /></a><p class="wp-caption-text">Space Runner - Click To Play</p></div>
<p>I&#8217;ve written about <a href="http://unity3d.com/support/resources/unity-extensions/explosion-framework" target="_blank">Detonator</a> before, so I won&#8217;t go into much detail here, but I have to say it still impresses me every time I use it. There is no easier or more flexible way to create fantastic looking explosion effects in Unity and it scales really well to run on a whole range of computers too.</p>
<p><a href="http://www.insquare.com/itween/" target="_blank">iTween</a> is a fairly recent addition to the Unity community and is basically Unity&#8217;s answer to TweenLite. In short it is brilliant. It makes simple bits of animation an absolute breeze and more complex animation sequences easy too thanks to a built in delay system. Currently you can animate a <em>GameObject&#8217;s position, scale, rotation, colour and volume</em> to or from a given value with a single line of code. Hopefully future releases will add functionality for animating coloured lighting and other non-standard GameObjects and components but for now this has to be one of the most useful Unity scripts out there.</p>
<p>I&#8217;ve been looking for a good events system for Unity for a while now a recently came across the <a href="http://www.unifycommunity.com/wiki/index.php?title=CSharpMessenger_Extended" target="_blank">C# Messenger System</a> on the Unify Wiki. After a bit of cutomisation I now have a system that is much more like the <em>ActionScript event model</em>, so rather than passing in an event as a string, you pass in an instance of an event class, helping to keep everything type checked by the compiler and avoid runtime errors, it also helps with code completion in Visual Studio which is a nice bonus. Hopefully I will get some time soon to tidy up the code for this and submit my version to the Unify Wiki.</p>
<h3>A few things I&#8217;ve learned while making this demo</h3>
<p><em>Making games in 3D can be difficult, even with Unity.</em> The maths and overall structure of even a simple 3D game project is many times more complex than what is required for a 2D game. Unity really does a great job of giving you all the tools you need to  make your game, but I found that you still need to understand some 3D  maths if you want to try something that&#8217;s not covered by the standard  camera and character controller scripts that come with the IDE. I found it really helpful to read up on the basics of general 3D games development covered by the <a href="http://unity3d.com/support/resources/tutorials/" target="_blank">official Unity tutorials</a> as well as resources aimed at other platforms like XNA, Torque and even Flash.</p>
<p><em>If you want to loop background music in your game, don&#8217;t use MP3&#8242;s.</em> Apparently MP3 meta data often adds a short amount of silence to the end of the file, meaning that when you play it back in Unity on a loop you will hear a short pop or click where the join is. There are many ways around this, but the most reliable seems to be to export your audio to WAV format and then let Unity compress it internally.</p>
<p>Hope this has been interesting reading, if you would like to try the demo, you can <a href="http://www.matteley.co.uk/labs/unity3d-spacerunner/">play it here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/372/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=372&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2010/05/04/unity-3d-space-runner-game-demo/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-1.jpg" medium="image">
			<media:title type="html">Space Runner Unity Demo - Click To Play</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-2.jpg?w=300" medium="image">
			<media:title type="html">Unity 3D Space Runner - Gameplay</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/05/unity-spacerunner-3.jpg?w=300" medium="image">
			<media:title type="html">Unity 3D Space Runner - Gameplay 2</media:title>
		</media:content>
	</item>
		<item>
		<title>Unity 3D &#8211; Asteroids Style Demo</title>
		<link>http://matteley.wordpress.com/2010/01/30/unity-3d-asteroids-style-demo/</link>
		<comments>http://matteley.wordpress.com/2010/01/30/unity-3d-asteroids-style-demo/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 20:04:01 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[Games Development]]></category>
		<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Games Engine]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=351</guid>
		<description><![CDATA[This demo is my first project in Unity, and is my take on the Atari classic Asteroids. There&#8217;s a lot to learn when you first start out using Unity, so something simple, well known and in 2D seemed a good place to begin. If you&#8217;d like to play the demo, please click the image above. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=351&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_359" class="wp-caption alignnone" style="width: 590px"><a href="http://www.matteley.co.uk/labs/unity3d-astrospace/" target="_blank"><img class="size-full wp-image-359  " title="Unity Astrospace Demo - Click to Play" src="http://matteley.files.wordpress.com/2010/01/unity-astrospace-3.jpg?w=580&#038;h=190" alt="" width="580" height="190" /></a><p class="wp-caption-text">Unity Astrospace Demo - Click to Play</p></div>
<p>This demo is my first project in <a href="http://unity3d.com/" target="_blank">Unity</a>, and is my take on the Atari classic <a href="http://www.atari.com/arcade/asteroids" target="_blank">Asteroids</a>. There&#8217;s a lot to learn when you first start out using Unity, so something simple, well known and in 2D seemed a good place to begin. If you&#8217;d like to play the demo, please click the image above.</p>
<p><span id="more-351"></span><strong>Setting up a 2.5D game in Unity</strong><br />
While Unity is mainly a 3D game engine, using it for 2D games is just a case of adding a <a href="http://unity3d.com/support/documentation/Components/class-ConfigurableJoint.html" target="_blank">Configurable Joint</a> component to each GameObject and Prefab that you want to restrict to only 2 axis and setting the corresponding <strong>X</strong>,<strong>Y</strong> or <strong>ZMotion</strong> properties to <strong>locked</strong>. This will stop those specific objects from being affected by the PhysX engine on the chosen axis while also leaving other game elements (including the Main Camera) free to move wherever you like in order to add depth the scene.</p>
<p>The best example of this I&#8217;ve seen so far is <a href="http://blurst.com/paper-moon/" target="_blank">Paper Moon</a> by Infinite Ammo, the &#8220;2D with depth&#8221; style of that game kind of reminds me of early 32bit era <a href="http://en.wikipedia.org/wiki/Category:Video_games_with_2.5D_graphics" target="_blank">2.5D platform games</a> like Bug! and Clockwork Knight as well as more modern stuff like LittleBigPlanet and Viewtiful Joe. Overall, the effect is similar to what can be achieved using <a href="http://pv3d.org/?s=box2d" target="_blank">Box2D with Papervision3D in Flash</a>, but using Unity gives you a bit more freedom to pile on the graphical effects without worrying so much about the frame rate.</p>
<p><strong>Making the demo</strong><br />
I wrote the scripts for this project in C# rather than the standard Unity JavaScript. I chose to try and learn C# after reading this post on <a href="http://www.everydayflash.com/blog/index.php/2009/07/21/c-sharp-for-unity3d/" target="_blank">EverydayFlash</a> which had recommended it. It took a little getting used to but it was definitely worth learning, especially now that <a href="http://unity3d.com/support/documentation/Manual/VisualStudioIntegration.html" target="_blank">Visual Studio C# syncs with your Unity projects</a>, as you get the bonus of using one of the best code editors out there to write your game code as well.</p>
<p>While the code was all written from scratch by me, the graphics and sounds effects are mainly from <a href="http://unity3d.com/support/resources/assets/" target="_blank">asset packs</a> and <a href="http://unity3d.com/support/resources/tutorials/" target="_blank">tutorials</a> available from the Unity Technologies website, while the music was from an old <a href="http://www.computerarts.co.uk/" target="_blank">Computer Arts</a> CD. In addition to all this I used the excellent <a href="http://unity3d.com/support/resources/unity-extensions/explosion-framework" target="_blank">Detonator Framework</a> by <a href="http://variancetheory.com/" target="_blank">Ben Throop</a> to create all the pretty explosions you see in the demo. Just like Flash, there are loads of open source frameworks and code libraries out there for Unity, and lots of great tutorials to help you get started making games.</p>
<p>Over all I&#8217;m quite pleased with how the demo turned out and very impressed with the Unity editor and how easy it is to use. I guess the one thing that can make Unity quite difficult is the need for some knowledge of a 3D modeling package, without that you kind of have to rely on ready made models as I did for this demo, this can be a bit limiting at times and does add an extra few degrees to Unity&#8217;s learning curve. Might be time to start learning Blender&#8230;</p>
<p><strong>A few things I&#8217;ve learned about Unity while making this demo:</strong></p>
<ul>
<li> <strong>Well structured code is more important than ever.</strong> At times, coding in Unity can seem a bit like Flash back in the days of AS1, you have the freedom to attach your code to almost any in game object and this can make it very easy to get in a muddle.</li>
<li><strong>Public properties are great.</strong> Making a property public in a Unity script means that you can then change its value through the editor&#8217;s inspector menu. This is useful as you can alter these values at any time without editing the script, even while the game is running in preview mode, this makes it very easy to tweak the gameplay until it&#8217;s just right.</li>
<li><strong>Preview mode doesn&#8217;t save your property settings.</strong> Following on from the previous point, be aware that when you close preview mode all those changes you just made to those public properties get reset. This can be a nightmare if you didn&#8217;t know in advance, or simply just forgot about it, thankfully <a href="http://eej.dk/angryant/general/tipsandtricks/copyinspector/" target="_blank">there is a solution</a>.</li>
<li><strong>Any script can access any other part of the current game scene.</strong> Using GameObject.Find() and GetComponent() methods can at times be Unity&#8217;s equivalent to using parent and root keywords  in Flash, with all the problems they can cause. You can end up writing very specific code when a good <a href="http://www.unifycommunity.com/wiki/index.php?title=CSharpMessenger_Extended" target="_blank">Event Messaging and Listener</a> system is probably a much better option.</li>
<li><strong>The Unity GUI system is rather quirky.</strong> Perhaps I&#8217;m just too used to Flash and Creative Suite in general, but the way Unity handles User Interface programming and design really does take some getting used too.</li>
<li><strong>If you&#8217;re from a Flash background, you will miss tweening.</strong> There are a few tweening libraries out there for Unity, the most advanced seems to be <a href="http://www.unifycommunity.com/wiki/index.php?title=AniMate" target="_blank">AniMate</a> which is written in Boo, but I couldn&#8217;t find anything that seemed to work well with C# just yet. One thing Unity really needs is a port of TweenMax for Flash.</li>
<li><strong>For all the similarities, Unity isn&#8217;t Flash in 3D.</strong> An obvious one I know, especially given everything I&#8217;ve written above, but there&#8217;s some things that Flash does that it&#8217;s very easy to take for granted. It took me ages to work out how to fade the alpha transparency of a 3D GameObject without a tweening library or a simple alpha property. Turns out fading a 2D texture was fairly simple, but a GameObject containing several 3D meshes requires you to target the alpha of the main colour of every texture within it, cue some boolean flags and a nested for loop just to make an object fade out.</li>
</ul>
<p>Anyway, that is probably enough talk for now, if you haven&#8217;t played the demo yet please check it out at the link below.</p>
<p><a href="http://www.matteley.co.uk/labs/unity3d-astrospace/" target="_blank">Click to Play Unity Astrospace Demo</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=351&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2010/01/30/unity-3d-asteroids-style-demo/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-astrospace-3.jpg" medium="image">
			<media:title type="html">Unity Astrospace Demo - Click to Play</media:title>
		</media:content>
	</item>
		<item>
		<title>Unity 3D &#8211; First Impressions</title>
		<link>http://matteley.wordpress.com/2010/01/30/unity-3d-first-impressions/</link>
		<comments>http://matteley.wordpress.com/2010/01/30/unity-3d-first-impressions/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:42:21 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Games Development]]></category>
		<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Games Engine]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=297</guid>
		<description><![CDATA[There&#8217;s been a lot of talk in the Flash community lately about Unity and the way it is transforming 3D on the web. Having read a lot about it, played a few demos and seen that Unity Indie is now available for free, I just had to take a closer look. So what follows are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=297&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of talk in the Flash community lately about <a href="http://unity3d.com/" target="_blank">Unity</a> and the way it is transforming 3D on the web. Having read a lot about it, played a few demos and seen that <a href="http://unity3d.com/company/news/unity2.6-press.html" target="_blank">Unity Indie is now available for free</a>, I just had to take a closer look. So what follows are my first impressions of the game engine and development environment, a quick look at some of the best Unity projects out there at the moment, and an overview of the resources available to new developers, especially those like me, who are from an ActionScript background.</p>
<p><strong>From Flash to Unity</strong><br />
Working with Unity is a lot like developing in the Flash IDE, in fact there are so many similarities that as a Flash developer it&#8217;s very easy to understand the basics. Lots of comparisons have been drawn between the basic building blocks in both environments: the Unity <strong>Project Panel</strong> is just like the <strong>Library</strong> in Flash, the <strong>Hierarchy</strong> is your <strong>Timeline</strong>, the Unity<strong> </strong><strong>GameObject </strong>is a bit like the base <strong>DisplayObject</strong> in Flash, while <strong>Prefabs</strong> can be instantiated at runtime just like <strong>Linked MovieClips</strong>, even the default scripting language looks very familiar.</p>
<p>What quickly becomes apparent though, is that aside from the obvious performance advantage that Unity brings to 3D graphics, this is also an engine that was built mainly for making games with rather than a platform for everything from 2D vector animations to video playback. To make a game in Flash &#8211; even with something as advanced as the <a href="http://pushbuttonengine.com/" target="_blank">PushButtonEngine</a> &#8211; is still a major piece of work, with Unity everything is there at your fingertips: <strong>3D renderer, shaders, particle effects, a physics engine, standardized player input, an optimized game loop, sound management</strong>&#8230; the list goes on. All of this means that you can focus on creating the actual game itself, rather than trying to build an engine from scratch or spend ages working out how to combine some existing code libraries or  frameworks to make a game in Flash.</p>
<p><span id="more-297"></span></p>
<div id="attachment_311" class="wp-caption alignright" style="width: 210px"><a href="http://blog.helloenjoy.com/2009/12/05/helloracer-unity/"><img class="size-full wp-image-311  " title="See the HelloRacer Unity demo from HelloEnjoy" src="http://matteley.files.wordpress.com/2010/01/unity-helloracer.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">HelloRacer Demo</p></div>
<p><strong>Some of the coolest games and demos</strong><br />
Right now there seems to be so many projects being made in Unity, with great new examples appearing almost daily on the web. Alongside Unity&#8217;s own impressive <a href="http://unity3d.com/gallery/live-demos/tropical-paradise" target="_blank">Far Cry style tech demo</a> I would have to say that my favorite right now has to be the <a href="http://blog.helloenjoy.com/2009/12/05/helloracer-unity/" target="_blank">HelloRacer demo</a> from Carlos Ulloa of HelloEnjoy and Papervision3D. The quality of the graphics and the realism and responsiveness of the handling is just amazing.</p>
<p>Another Unity project from people with a background in the Flash development scene is Infrared5&#8242;s <a href="http://rockonflash.wordpress.com/2009/11/17/star-wars-trench-run-approved/" target="_blank">Star Wars Trench Run</a> game on the iPhone. This is one example that really shows what is possible with Unity on a mobile platform, the game runs blindingly fast and has great graphics and a cool tilt-based control system.</p>
<div id="attachment_308" class="wp-caption alignleft" style="width: 210px"><a href="http://blurst.com/blush/"><img class="size-full wp-image-308 " title="Play Blush at Blurst.com" src="http://matteley.files.wordpress.com/2010/01/unity-blush.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">Blush</p></div>
<p>Another great Unity developer is Flashbang Studios, they have put out some really unique Unity powered games on their <a href="http://blurst.com/" target="_blank">Blurst</a> games site including the classic <a href="http://blurst.com/raptor-safari/" target="_blank">Off-Road Velociraptor Safari</a>, but my favorite of theirs right now has to be <a href="http://blurst.com/blush/" target="_blank">Blush</a>. With some great ambient music and lovely underwater graphics, it&#8217;s a chill out game that reminds me a lot of <a href="http://thatgamecompany.com/games/flow/" target="_blank">FlOw</a> by thatgamecompany.</p>
<p>But Unity isn&#8217;t just for iPhone and the web, the engine&#8217;s flexibility when it comes to target platforms means that you can also publish for the desktop and even the <a href="http://unity3d.com/unity/features/wii-publishing" target="_blank">Wii</a> (although I think that&#8217;s only if you happen to be a registered Nintendo developer). With the company now hiring Xbox and PlayStation programmers there are even rumors that you will soon be able to publish to HD consoles too.</p>
<div id="attachment_315" class="wp-caption alignright" style="width: 210px"><a href="http://maxandthemagicmarker.com/"><img class="size-full wp-image-315 " title="Max and the Magic Marker by Press Play" src="http://matteley.files.wordpress.com/2010/01/unity-max.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">Max and the Magic Marker</p></div>
<p>So who&#8217;s using Unity for console game development right now? Well, <a href="http://maxandthemagicmarker.com/" target="_blank">Max and the Magic Marker</a> from Press Play is one such game for the Wii, and for me it has to be the most impressive showcase of Unity I&#8217;ve seen so far, with a level of professional polish that easily puts it alongside Lostwinds and World of Goo as one of the best looking games on WiiWare. There is even a <a title="Max and the Magic Marker demo" href="http://maxandthemagicmarker.com/demo/" target="_blank">demo version</a> on the game&#8217;s website that uses the Unity web player and is definitely worth checking out.</p>
<p><strong>Beyond the core engine</strong><br />
The Unity website already does a great job of explaining the core features of the engine so I won&#8217;t repeat that here, but I would like to highlight two of my favorite extensions, both of which show how the core Unity engine can be built upon in very different ways.</p>
<div id="attachment_313" class="wp-caption alignleft" style="width: 210px"><a href="http://vimeo.com/5391896"><img class="size-full wp-image-313 " title="Unity Locomotion System - Click to view video on Vimeo" src="http://matteley.files.wordpress.com/2010/01/unity-locomotion.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">Unity Locomotion System</p></div>
<p>The <a href="http://runevision.com/multimedia/unity/locomotion/" target="_blank">Locomotion system by Rune Skovbo Johansen</a> adds high quality semi-procedural animation techniques to Unity. The framework blends your existing animation sequences and intelligently adjusts them to enable characters to convincingly navigate complex scenery such as stairs and uneven outdoor terrain. The results look very impressive and add a lot of depth and believability to the way your game characters interact with their environment.</p>
<p>The <a href="http://variancetheory.com/detonator/" target="_blank">Detonator framework by Ben Throop</a> allows you to easily create fantastic looking explosions, with particle effects, dynamic lighting and debris. All aspects of the explosions can be customised to create any number of unique effects and each one can be saved as a prefab for later use. Built on top of Unity&#8217;s standard particle system, these effects can even be plugged into your game&#8217;s physics engine so that they actually interact with other objects in the game environment.</p>
<div id="attachment_310" class="wp-caption alignright" style="width: 210px"><a href="http://vimeo.com/6596756"><img class="size-full wp-image-310 " title="Unity Detonator Framework - Click to view video on Vimeo" src="http://matteley.files.wordpress.com/2010/01/unity-detonator.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">Unity Detonator Framework</p></div>
<p>Both packages are free to download from the Unity website and show just what&#8217;s possible beyond the core engine. The quality and usefulness of these frameworks really highlights that despite already being much more of a ready made games engine than Flash, there is just as much potential for highly specialised 3rd party plugins and code libraries for Unity as there is for Flash.</p>
<p><strong>Tech Resources</strong><br />
For what is still a relatively new platform, there are a lot of <a href="http://www.reddit.com/r/unity_tutorials/" target="_blank">great resources</a> out there to help you learn the engine. While Unity is often pitched as something that anyone can learn, I think any knowledge of Flash, or experience of other consumer focused game engines or level editors such as <a href="http://www.torquepowered.com/products/torque-3d" target="_blank">Torque</a>, <a href="http://en.wikipedia.org/wiki/Sandbox_%28video_game_editor%29" target="_blank">CryEngine</a>, <a href="http://en.wikipedia.org/wiki/UnrealEd" target="_blank">UnrealED</a> or <a href="http://en.wikipedia.org/wiki/Hammer_Editor" target="_blank">Hammer</a> will give you a considerable advantage.</p>
<div id="attachment_309" class="wp-caption alignleft" style="width: 210px"><a href="http://www.packtpub.com/unity-2-5-game-development-guide/book"><img class="size-full wp-image-309  " title="Unity Game Development Essentials Book" src="http://matteley.files.wordpress.com/2010/01/unity-book.jpg?w=200&#038;h=150" alt="" width="200" height="150" /></a><p class="wp-caption-text">Unity Book</p></div>
<p>Alongside the usual online manual and scripting references on the Unity website, there are a stack of excellent official tutorial videos and even some sample projects. But if you are looking for a really well written introduction to the engine, then <a href="http://willgoldstone.com/blog/?p=468" target="_blank">Will Goldstone&#8217;s Unity Game Development Essentials</a> is the place to start. This book takes the form of one long tutorial, introducing all the most important features of the engine while guiding you through the creation of something similar to the Unity Island Demo. While the book is actually quite light on scripting, it really does explain the process of making games in Unity very clearly, and for that reason alone it is highly recommended.</p>
<p>A couple of other great resources that are worth a mention are the <a href="http://www.unifycommunity.com/wiki/index.php?title=Main_Page" target="_blank">Unify Community Wiki</a> and <a href="http://answers.unity3d.com/" target="_blank">Unity Answers</a> message board. The Wiki is a great source of code examples and project tutorials to help with learning the engine, whereas Answers is a great place to start if you get stuck on something in the middle of a project.</p>
<p><strong>Next Steps</strong><br />
So after all that, what would I recommend for a Flash developer looking to get started with Unity? How about the following steps&#8230;</p>
<ul>
<li>Install Unity and watch the <a href="http://unity3d.com/support/documentation/video/" target="_blank">official intro videos</a>, they do a great job of introducing the Unity editor.</li>
<li> Download one of the <a href="http://unity3d.com/support/resources/example-projects/" target="_blank">official sample projects</a> and have a look at how a Unity game is actually structured.</li>
<li> Watch these <a href="http://vimeo.com/user1156682/videos" target="_blank">Flash to Unity migration videos</a> from Richard Hart, they really are an excellent introduction.</li>
<li> Read Will Goldstone&#8217;s <a href="http://www.packtpub.com/unity-2-5-game-development-guide/book" target="_blank">Unity Game Development Essentials book</a>.</li>
<li> Install <a href="http://www.microsoft.com/express/Windows/" target="_blank">Visual Studio Express for C#</a>, it&#8217;s free, it now <a href="http://unity3d.com/support/documentation/Manual/VisualStudioIntegration.html" target="_blank">works with Unity</a> projects and it will help with the final step on this list.</li>
<li> Have a look at <a href="http://www.everydayflash.com/blog/index.php/2009/07/21/c-sharp-for-unity3d/" target="_blank">learning C# for Unity</a>. It&#8217;s not that different to AS3 really, and in many ways it&#8217;s much more powerful than the standard Unity JavaScript, so it will be very helpful in the long run.</li>
</ul>
<p>Hopefully this has been interesting reading. I&#8217;ve been working on a few Unity demos recently, so I&#8217;ll try and post the results here soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/297/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=297&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2010/01/30/unity-3d-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-helloracer.jpg" medium="image">
			<media:title type="html">See the HelloRacer Unity demo from HelloEnjoy</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-blush.jpg" medium="image">
			<media:title type="html">Play Blush at Blurst.com</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-max.jpg" medium="image">
			<media:title type="html">Max and the Magic Marker by Press Play</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-locomotion.jpg" medium="image">
			<media:title type="html">Unity Locomotion System - Click to view video on Vimeo</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-detonator.jpg" medium="image">
			<media:title type="html">Unity Detonator Framework - Click to view video on Vimeo</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2010/01/unity-book.jpg" medium="image">
			<media:title type="html">Unity Game Development Essentials Book</media:title>
		</media:content>
	</item>
		<item>
		<title>Stardust Particle Effects &#8211; X-Wing Demo</title>
		<link>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-x-wing-demo/</link>
		<comments>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-x-wing-demo/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 22:29:58 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Games Development]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Demos]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[Visual Effects]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash 3D]]></category>
		<category><![CDATA[Star Wars]]></category>
		<category><![CDATA[Stardust Particle Engine]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=285</guid>
		<description><![CDATA[The aim of this demo was to update John Grden&#8217;s legendary Papervision3D X-Wing model &#8211; as seen in this classic papervision demo &#8211; and really bring it to life with some nice animated 3D particle effects. The demo combines Papervision3D and the Stardust Particle Engine to add particle effects to the existing 3D model. I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=285&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.matteley.co.uk/labs/demo9-stardust-xwing/" target="_blank"><img class="alignnone size-full wp-image-286" title="Click to view the Stardust X-Wing demo" src="http://matteley.files.wordpress.com/2009/10/demo9-screenshot.jpg?w=400&#038;h=300" alt="Stardust X-Wing demo" width="400" height="300" /></a></p>
<p>The aim of this demo was to update <a href="http://rockonflash.wordpress.com/" target="_blank">John Grden&#8217;s</a> legendary Papervision3D X-Wing model &#8211; as seen in this <a href="http://rockonflash.wordpress.com/2007/03/09/first-papervision3d-game/" target="_blank">classic papervision demo</a> &#8211; and really bring it to life with some nice animated 3D particle effects.</p>
<p>The demo combines <a href="http://code.google.com/p/papervision3d/" target="_blank">Papervision3D</a> and the <a href="http://code.google.com/p/stardust-particle-engine/" target="_blank">Stardust Particle Engine</a> to add particle effects to the existing 3D model. I used Stardust&#8217;s built in Papervision extension to add the classic red glow of the X-Wing engines and then animate those engines as the ship accelerates away from camera. It&#8217;s quite a subtle effect, but if you look closely you can see a kind of red heat haze, I also  like the way the white flames fade in and out as the ship speeds up and slows down.</p>
<p>I know this kind of effect could easily be done in something like <a href="http://unity3d.com/unity/features/graphics" target="_blank">Unity</a> but I think it&#8217;s pretty cool to see it done in real-time in Flash. The original Papervision3D X-Wing demos were a real inspiration to me, and it&#8217;s amazing just how much a little effect like this can add to what is already an amazing 3D model.</p>
<p><a href="http://www.matteley.co.uk/labs/demo9-stardust-xwing/" target="_blank">Click here to view the demo and source code.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=285&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-x-wing-demo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2009/10/demo9-screenshot.jpg" medium="image">
			<media:title type="html">Click to view the Stardust X-Wing demo</media:title>
		</media:content>
	</item>
		<item>
		<title>Stardust Particle Effects &#8211; 2D Spaceship Demo</title>
		<link>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-2d-spaceship-demo/</link>
		<comments>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-2d-spaceship-demo/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 21:50:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Demos]]></category>
		<category><![CDATA[Games Development]]></category>
		<category><![CDATA[Visual Effects]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Stardust Particle Engine]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=273</guid>
		<description><![CDATA[This demo is another example of the cool effects that can be made in Flash and ActionScript 3 using the Stardust Particle Engine. By combining a simple particle effect with lots of Flash filters and some BitmapData processing, it&#8217;s possible to create some pretty abstract looking flame effects. The initial idea was to make something [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=273&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.matteley.co.uk/labs/demo8-stardust-2dspaceship/" target="_blank"><img class="alignnone size-full wp-image-275" title="demo8-stardust-2dspaceship" src="http://matteley.files.wordpress.com/2009/10/demo8-screenshot.jpg?w=400&#038;h=300" alt="demo8-screenshot" width="400" height="300" /></a></p>
<p>This demo is another example of the cool effects that can be made in Flash and ActionScript 3 using the <a href="http://code.google.com/p/stardust-particle-engine/" target="_blank">Stardust Particle Engine</a>.</p>
<p>By combining a simple particle effect with lots of Flash filters and some BitmapData processing, it&#8217;s possible to create some pretty abstract looking flame effects. The initial idea was to make something similar to the neon particle systems seen in games like <a href="http://www.bizarrecreations.com/games/geometry_wars_retro_evolved/" target="_blank">Geometry Wars</a> and <a href="http://www.llamasoft.co.uk/grr_LoRes.php" target="_blank">Grid Runner</a>, but after playing around with the Flash bitmap filters for a while I ended up with this cool looking flame effect instead.</p>
<p>The code is actually fairly similar to my earlier tutorial on using the Stardust engine, but this time I&#8217;m setting the velocity of the particles based on the speed and direction of the spaceship to create a nice engine flame effect that reacts to the ship&#8217;s movement.</p>
<p><a href="http://www.matteley.co.uk/labs/demo8-stardust-2dspaceship/" target="_blank">Click here to view the demo and download the source code.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/273/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=273&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/21/stardust-particle-effects-2d-spaceship-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2009/10/demo8-screenshot.jpg" medium="image">
			<media:title type="html">demo8-stardust-2dspaceship</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating a simple particle effect using the Stardust Particle Engine</title>
		<link>http://matteley.wordpress.com/2009/10/17/creating-a-simple-particle-effect-using-the-stardust-particle-engine/</link>
		<comments>http://matteley.wordpress.com/2009/10/17/creating-a-simple-particle-effect-using-the-stardust-particle-engine/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 22:36:27 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Visual Effects]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Stardust Particle Engine]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=232</guid>
		<description><![CDATA[The Stardust Particle Engine is a great new addition to that long list of open source AS3 projects out there on the web. While Stardust can look like a fairly complex system to get started with, this tutorial will hopefully show you how to setup a simple particle effect using the library and give you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=232&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://code.google.com/p/stardust-particle-engine/" target="_blank">Stardust Particle Engine</a> is a great new addition to that long list of open source AS3 projects out there on the web. While Stardust can look like a fairly complex system to get started with, this tutorial will hopefully show you how to setup a simple particle effect using the library and give you enough understanding of how it works to start making your own effects as well.</p>
<p>Stardust has a lot of cool features, and much of its structure and functionality will be familiar to people who have already used the <a href="http://flintparticles.org/" target="_blank">Flint</a> particle effects library or the <a href="http://box2dflash.sourceforge.net/" target="_blank">Box2DFlash</a> physics engine.</p>
<p>What makes this engine different is the way it brings all these features together in a  modular and well designed package. It supports 2D and 3D particle effects (via its own internal 3D engine and through plugins for Papervision3D, ZedBox or ND3D), particle masking to help create more complex logic, and even the option to configure your effects using external XML files.</p>
<p>In addition to this great list of features is an excellent set of <a href="http://stardust-particle-engine.googlecode.com/svn/trunk/docs/index.html" target="_blank">documentation</a>, a nice introductory user guide, lots of really good code examples and even some FlashDevelop class templates that make it much easier to extend the core classes for your own effects. All of these extras are available from the links on the <a href="http://code.google.com/p/stardust-particle-engine/" target="_blank">Stardust project home page</a>.</p>
<p>So anyway, on with the tutorial, what we&#8217;re going to do is create a very simple multi-coloured smoke effect that will follow the mouse around the screen. It&#8217;s nothing too amazing I guess, but hopefully it will work as an intro on how to get started using the Stardust particle effects engine.</p>
<p><span id="more-232"></span></p>
<p>After downloading the Stardust source code from Google Code, start a new project in your favorite Flash / ActionScript IDE, set the background colour to black, the frame rate to 30 fps and make sure the Stardust class package or SWC is added to your new project&#8217;s class path.</p>
<p>First off, open your project&#8217;s main document class and import the following classes, it may look like a lot of code, but this is mainly due to the object oriented structure that makes Stardust so great at creating complex effects.</p>
<pre class="brush: jscript;">
import flash.display.Sprite;
import flash.events.Event;
import idv.cjcat.stardust.twoD.initializers.DisplayObjectClass;
import idv.cjcat.stardust.twoD.initializers.Position;
import idv.cjcat.stardust.twoD.initializers.Velocity;
import idv.cjcat.stardust.twoD.renderers.DisplayObjectRenderer;
import idv.cjcat.stardust.twoD.emitters.Emitter2D;
import idv.cjcat.stardust.twoD.actions.Move;
import idv.cjcat.stardust.twoD.zones.CircleZone;
import idv.cjcat.stardust.twoD.zones.SinglePoint;
import idv.cjcat.stardust.common.clocks.SteadyClock;
import idv.cjcat.stardust.common.actions.Age;
import idv.cjcat.stardust.common.actions.DeathLife;
import idv.cjcat.stardust.common.initializers.Life;
import idv.cjcat.stardust.common.math.UniformRandom;
</pre>
<p>Next we need to add a few class properties to the document class. First is the <strong>emitter</strong>, this is the part of the particle engine that creates the particles, next is the <strong>renderer</strong> which actually draws the particles on to the display list, lastly there is an instance of <strong>SinglePoint</strong>, which is just a reference that we will be using  to determine where the particles should appear on screen.</p>
<pre class="brush: jscript;">
private var emitter:Emitter2D;
private var renderer:DisplayObjectRenderer;
private var point:SinglePoint;
</pre>
<p>Next in the document class constructor add the following lines of code, we will go through them a couple of lines at a time.</p>
<pre class="brush: jscript;">
emitter = new Emitter2D(new SteadyClock(4));
</pre>
<p>This creates a new particle emitter and tells it to add new particles to the system at a steady rate of 4 particles each time the <strong>emitter.step()</strong> method is called.</p>
<pre class="brush: jscript;">
emitter.addInitializer(new DisplayObjectClass(DemoParticle));
emitter.addInitializer(new Velocity(new CircleZone(0,0,4)));
emitter.addInitializer(new Life(new UniformRandom(20,60)));
</pre>
<p>These lines add some initial settings that will be applied to every particle that is created by the  emitter. The first line sets what graphics to use for the particles, in this case it is a class called <strong>DemoParticle</strong> which we will look at a bit later on towards the end of this tutorial.</p>
<p>The next line sets the starting velocity of each particle and the third line sets the life time that each particle will have. It&#8217;s important to note here that the two classes used for the <strong>Velocity</strong> and <strong>Life</strong> settings (<strong>CircleZone</strong> and <strong>UniformRandom</strong> respectively), are actually ways of describing a range of possible values rather than one specific value. This is a core part of how this particle system works, building up complex effects using random values chosen from within a specified range.</p>
<pre class="brush: jscript;">
point = new SinglePoint(mouseX, mouseY);
emitter.addInitializer(new Position(point));
</pre>
<p>Here we create an instance of the <strong>SinglePoint</strong> class and use it to store a reference to the location of the particle emitter. We will update this value later on every frame to make the particle effect follow the mouse.</p>
<p>Now we add some actions. While the initializers above declared the initial settings that each particle will use when first created, these actions will determine how those initial settings are  changed over time.</p>
<pre class="brush: jscript;">
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(new DeathLife());
</pre>
<p>The <strong>Age</strong> action reduces the life of the particle over time, the <strong>Move</strong> action makes the particle move based on its velocity and the <strong>DeathLife</strong> action tells the engine to remove each particle from the display list after its lifetime has completed.</p>
<p>Next we create a renderer, then add the emitter to it and tell it to draw the graphics for the particle effect into a container DisplayObject. In this case we are using the document class as the container but you could use any Sprite or MovieClip you like.</p>
<pre class="brush: jscript;">
renderer = new DisplayObjectRenderer(this);
renderer.addEmitter(emitter);
</pre>
<p>Finally we need to add a listener for the <strong>ENTER_FRAME</strong> event and create a function to handle the event called <strong>renderLoop</strong>.</p>
<pre class="brush: jscript;">
addEventListener(Event.ENTER_FRAME, renderLoop);
</pre>
<p>Inside the <strong>renderLoop</strong> function we add the following code.</p>
<pre class="brush: jscript;">
point.x = mouseX;
point.y = mouseY;
emitter.step();
</pre>
<p>This code does two things, first it sets the x and y properties of the <strong>SinglePoint</strong> instance to match the current mouse position, this will automatically update the position of the particle effect. Then it tells the engine to update the particle effect based on all the settings we set up in the code above by calling the <strong>step()</strong> method.</p>
<p>Now that&#8217;s all the code needed for this class, but there is one last thing we need to do, if you remember earlier on we told the particle system to use a class called <strong>DemoParticle</strong> to draw the graphics of each particle, so now we have to write that class.</p>
<p>Add a new ActionScript file to the same directory as your document class, save it as <strong>DemoParticle.as</strong> and paste the following code into it. This class simply draws a small blurred circle using a random colour and size. This will be used to provide the graphics for each new particle that is drawn by the particle engine.</p>
<pre class="brush: jscript;">
package
{
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.filters.BlurFilter;
  public class DemoParticle extends Sprite
  {
    private static const COLOURS:Array = [0x9F67FE, 0x6B6BFE, 0x5BBAFF];
    public function DemoParticle()
    {
      this.filters = [new BlurFilter(32,32,3)];
      graphics.beginFill(COLOURS[Math.floor(Math.random()*COLOURS.length)]);
      graphics.drawCircle(0, 0, 8 + Math.floor(8*Math.random()));
      graphics.endFill();
    }
  }
}
</pre>
<p>And that&#8217;s it, this is all that is needed to make a simple particle effect using the Stardust engine. Sure this is a very simple effect, but the aim of this tutorial is to understand the basics of how the engine works, from there you can start to create more complex effects using the whole range of complex actions and initializers available in Stardust combined with the built in filters and effects of the Flash Player.</p>
<p>To see the finished particle effect click on the link below, it doesn&#8217;t look all that much in the static screen shot below (these kind of effects rarely do), but it is actually a pretty cool smoke effect when you see it in motion. The full source code for this tutorial is also available to download from the demo page at the link below.</p>
<p><a href="http://www.matteley.co.uk/labs/demo7-stardust/" target="_blank"><img class="alignnone size-full wp-image-264" title="demo7-stardust-particle-effect" src="http://matteley.files.wordpress.com/2009/10/demo7-screengrab-v2.jpg?w=400&#038;h=300" alt="demo7-stardust-particle-effect" width="400" height="300" /></a></p>
<p><a href="http://www.matteley.co.uk/labs/demo7-stardust/" target="_blank">Click here to view the demo and download source code.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=232&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/17/creating-a-simple-particle-effect-using-the-stardust-particle-engine/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2009/10/demo7-screengrab-v2.jpg" medium="image">
			<media:title type="html">demo7-stardust-particle-effect</media:title>
		</media:content>
	</item>
		<item>
		<title>AS3 Quick Guides &#8211; Frameworks and Toolkits</title>
		<link>http://matteley.wordpress.com/2009/10/17/as3-quick-guides-frameworks-and-toolkits/</link>
		<comments>http://matteley.wordpress.com/2009/10/17/as3-quick-guides-frameworks-and-toolkits/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 21:49:33 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[AS3 Quick Guides]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code Frameworks]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=242</guid>
		<description><![CDATA[As part of my series of quick guides to open source AS3 projects I thought it would be interesting to look at the range of code frameworks and toolkits that are currently available for Flash website development. If you&#8217;ve ever tried developing a website completely in Flash then you will know just how much work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=242&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As part of my series of <a href="http://matteley.wordpress.com/category/as3-quick-guides/" target="_blank">quick guides</a> to open source AS3 projects I thought it would be interesting to look at the range of code frameworks and toolkits that are currently available for Flash website development.</p>
<p>If you&#8217;ve ever tried developing a website completely in Flash then you will know just how much work it can take to setup the initial project structure and make Flash behave in a similar way to a standard HTML website. From asset loading and memory management to deep linking and browser history support, chances are that there is a site framework or code toolkit that makes building websites in AS3 that little bit easier.</p>
<p><span id="more-242"></span></p>
<p><strong>Gaia Flash Framework</strong> &#8211; <a href="http://www.gaiaflashframework.com/" target="_blank">http://www.gaiaflashframework.com/</a><br />
This is an excellent framework for Flash that really does make developing websites a breeze. It&#8217;s an open source ActionScript framework that comes with  a Flash IDE component panel that helps you quickly setup a project automatically creating the files you need for each page of your site.  This automated &#8216;scaffolding&#8217; provides a solid foundation from which to build a &#8216;traditional&#8217; page based website in Flash,  and ensures that all Gaia projects include browser back / forward button support and deep linking (thanks to built in SWFaddress integration), as well as a standardized page and asset loading system.</p>
<p>Once you have planned out the overall structure of your site, splitting it into a number of distinct sections or pages, you write this structure into Gaia&#8217;s <a href="http://www.gaiaflashframework.com/wiki/index.php?title=Site_XML" target="_blank">site.xml config file</a>, pass it to the scaffolding engine in the Gaia component panel and let the framework do the rest. Beyond this initial scaffolding and the common page based structure, it&#8217;s completely up to you what you do and how you code it, and that really is the best part of Gaia. It is a framework that gives you a fantastic set of tools as the starting point for every project, but then lets you do your own thing, because that freedom is what makes Flash sites so unique.</p>
<p>All that and I haven&#8217;t even mentioned the great level of support or the incredibly well written and regularly updated documentation. If you want to find out more, I&#8217;d recommend taking a look at some of the sites featured in the gallery on the <a href="http://www.gaiaflashframework.com/" target="_blank">project&#8217;s home page</a> as well as this <a href="http://www.tmrw.co.uk/blog/gaia-framework-demo-site/" target="_blank">demo website</a> which offers a good example of to how build a site using the framework.</p>
<p><strong>CasaLib</strong> &#8211; <a href="http://casalib.org/" target="_blank">http://casalib.org/</a><br />
Perhaps you don&#8217;t need a full framework that structures a whole website for you, maybe all you need is an excellent set of classes that streamline the kind of common tasks required in most AS3 projects, if so then CasaLib is just what you need. From helping you load lots of external assets at once, to solving memory management issues or calculating the scaling ratios required for full screen websites, this library seems to have everything covered.</p>
<p>The toolkit is well documented with many examples in the main class <a href="http://as3.casalib.org/docs/">documentation</a> as well as on the project&#8217;s <a href="http://casalib.org/blog/" target="_blank">blog</a>. The only real problem is remembering all the things it can help with, quite a few times I&#8217;ve been working on a project using CasaLib and written lots of code myself  only to find out later on that the toolkit already has a class to do just what I needed, oh well never mind.</p>
<p><strong>Polygonal Labs Data Structures</strong> &#8211; <a href="http://lab.polygonal.de/ds/" target="_blank">http://lab.polygonal.de/ds/</a><br />
A great set of utility classes that build extra functionality on top of the existing core ActionScript data classes. I think these &#8216;data structures&#8217; were originally intended for use in Flash games, but I&#8217;ve found them very helpful for all sorts of projects.</p>
<p>For an example of the library&#8217;s effectiveness, see <a href="http://pv3d.org/2009/01/31/flover-cow-aka-cover-flow-knockoff/" target="_blank">this post by John Lindquist</a> where an iTunes style cover flow effect is put together with only a few lines of code. I remember writing a similar effect a while ago for work using a much earlier version of Papervision3D, and can definitely say it took a lot more code than that, if only I&#8217;d known about these AS3 data structures back then.</p>
<p><strong>PureMVC</strong> &#8211; <a href="http://trac.puremvc.org/PureMVC_AS3/" target="_blank">http://trac.puremvc.org/PureMVC_AS3/</a><br />
Described as a lightweight framework for structuring your projects using the classic Model View Controller design pattern, PureMVC looks to be a great way to ensure that your code remains modular and reusable. Those of us who have tried to code within the MVC pattern before will know know that despite the best of intentions things can often go astray, this framework aims to address that issue by providing a great standardized structure to work within.</p>
<p>I haven&#8217;t used PureMVC on a project yet, but there seems to be two main points of view about it. One argues that it can be quite  restrictive, forcing you to work within a strict MVC design pattern for even the most simple of tasks. The other view notes that this focus on structure does ensure that you code is far more stable, logical and reusable than is usually the case. For me, as someone who is always trying to write more elegant and reusable code, it may well be worth a try.</p>
<p><strong>AS Hive</strong> &#8211; <a href="http://code.google.com/p/as-hive/" target="_blank">http://code.google.com/p/as-hive/</a><br />
AS-Hive is a state based framework which seems to share a very similar approach to website development as the Gaia Framework, sitting in the background, part way between something that determines the structure of your application and a toolbox you can dip into as and when you need.</p>
<p>Both of these frameworks have a similar focus on application flow, in particular they are structured around managing transitions between the different states of you application by creating sequences of animation and asset loading to move from one screen to the next. This kind of thing is so intrinsic to projects built in Flash which often have a strong focus on animation, but is too often overlooked by frameworks and design patterns based on code from other languages.</p>
<p>I have yet to work on a project using Hive, but it does look very promising and could be a very good alternative to the Gaia Framework, especially if you&#8217;re working on an AS3 only project using the Flex SDK rather than the Flash IDE. In fact, while Gaia may remain the best solution for page based websites in Flash, Hive might provide a bit more freedom in the way it can be used for a much wider variety of projects such as games and social media tools.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=242&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/17/as3-quick-guides-frameworks-and-toolkits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>
	</item>
		<item>
		<title>AS3 Quick Guides &#8211; Open Source 3D Engines</title>
		<link>http://matteley.wordpress.com/2009/10/11/as3-quick-guides-open-source-3d-engines/</link>
		<comments>http://matteley.wordpress.com/2009/10/11/as3-quick-guides-open-source-3d-engines/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 19:08:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[AS3 Quick Guides]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash 3D]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=201</guid>
		<description><![CDATA[This post is the first in a series of quick guides for programmers new to Flash and ActionScript development. While much of what is covered will probably be familiar ground to many ActionScript developers, for Flash newbies these guides will hopefully offer a good introduction to the code libraries available for use in your projects. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=201&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is the first in a series of quick guides for programmers new to Flash and ActionScript development.</p>
<p>While much of what is covered will probably be familiar ground to many ActionScript developers, for Flash newbies these guides will hopefully offer a good introduction to the code libraries available for use in your projects. This one will focus on the range of 3D engines that are now available for Flash,   highlighting the key features of each engine and hopefully help make it a little bit easier to choose one to use.</p>
<p><span id="more-201"></span></p>
<p><strong>Papervision3D</strong> &#8211; <a href="http://blog.papervision3d.org/" target="_blank">http://blog.papervision3d.org/</a><br />
The most popular and widely used of the current 3D engines for Flash is also the first one to have a <a href="http://www.paultondeur.com/2009/09/03/papervision3d-essentials-out-now/" target="_blank">book released</a> about it.  I&#8217;ve used it on a couple of projects now, and have always found it very simple and easy to use. It may not have all the advanced features and effects of some of the other engines featured here, but it does provide a smoother learning curve for those that are new to 3D, with a logical and well structured API, excellent documentation and an abundance of tutorials. Papervision also has a great development community, with a real focus on helping those who are just starting out with 3D in Flash. To see the range of  projects that already use this engine take a look at the <a href="http://www.papervisionshowcase.com/" target="_blank">Papervision Showcase</a> site, for some great demos and tutorials check out <a href="http://pv3d.org/" target="_blank">pv3d.org</a>.</p>
<p><strong>Away3D</strong> &#8211; <a href="http://away3d.com/">http://away3d.com/</a><br />
Some would say that Away3D has a better feature set and is much more powerful than any other open source AS3 3D engine currently available, and that may well be the case judging by the amazing demos that get featured on the project&#8217;s home page. Another plus is it&#8217;s great level of Flash Player 10 support, which not only provides a major speed increase but also some new features like <a href="http://away3d.com/away3d-3-4-2-pixelbender-to-the-max" target="_blank">Pixel Shader support</a> and <a href="http://away3d.com/away3d-33-flash-10-version-update" target="_blank">HDR lighting</a>. However, with all these extra features comes larger file sizes, a more complex API, and  a much steeper learning curve, although some of this is now being addressed by the very impressive <a href="http://away3d.com/away3d-lite-v1-0-fastest-and-smallest-3d-engine-in-flash" target="_blank">Away3DLite</a> project.</p>
<p><strong>Sandy3D</strong> &#8211; <a href="http://www.flashsandy.org/" target="_blank">http://www.flashsandy.org/</a><br />
Another great 3D engine for Flash, this time with added support for both AS2 and AS3, as well as a <a href="http://haxe.org/doc/intro" target="_blank">HaXe</a> version. It also offers unique features like integration with the WOW physics engine and some rather nice <a href="http://www.flashsandy.org/demos/light_explorer" target="_blank">colored lighting effects</a> that remind me of Quake 2 and the early days of 3DFX video cards.</p>
<p><strong>Alternativa3D</strong><strong> </strong>- <a href="http://alternativaplatform.com/en/alternativa3d/" target="_blank">http://alternativaplatform.com/en/alternativa3d/</a><br />
This engine looks to be very much geared towards high quality visuals and seems to have been heavily optimized for use as a first person perspective engine. It has some truly amazing first person demos which showcase its advanced rendering features, but until recently I&#8217;d only seen the demos rather than finished sites. However this stunning new <a href="http://www.golf-gti-tracks.com/" target="_blank">Golf GTI racing game</a> really proves Alternativa3D to be an excellent platform for 3D Flash development.</p>
<p><strong>Five3D</strong> &#8211; <a href="http://five3d.mathieu-badimon.com/" target="_blank">http://five3d.mathieu-badimon.com/</a><br />
An excellent lightweight vector based alternative to the 3D engines above. I&#8217;ve used it on a couple of projects at work and have found it very easy to use as it builds upon existing AS3 classes like Sprite in much the same way as the new 3D API does in Flash Player 10. If you just want to add some 3D perspective and animation to shapes created with the 2D drawing API then this is the 3D library to use.</p>
<p><strong>ND3D</strong> &#8211; <a href="http://www.nulldesign.de/projects/nd3d-as3-3d-engine/" target="_blank">http://www.nulldesign.de/projects/nd3d-as3-3d-engine/</a><br />
With a compiled size of around 10k, this engine is aimed at speed and simplicity in a similar way to Five3D and Away3DLite. It also has some great built in features that you can use straight out of the box including: depth of field effects, additive blending and interactive meshes. Check out the demos on the project home page to see what it can do, this is definitely one to watch in the near future.</p>
<p><strong>ZedBox</strong> &#8211; <a href="http://code.google.com/p/zedbox/" target="_blank">http://code.google.com/p/zedbox/</a><br />
This new engine addresses the limitations of Flash Player 10&#8242;s native 3D rendering -mainly the pixel aliasing issues caused by bitmap caching  when 3D transforms are used &#8211; by offering a lightweight alternative. It only features flat &#8216;billboard&#8217; style graphics, but it runs fast and appears to be very easy to use.</p>
<p><strong>Yogurt3D</strong> &#8211; <a href="http://www.yogurt3d.com" target="_blank">http://www.yogurt3d.com</a><br />
Yogurt3D is a new engine primarily aimed at making 3D games in Flash. Not that much is known about the engine right now, but the website says that it will which feature a core API named &#8216;SwiftGL&#8217; that should be familiar to developers who already know OpenGL.</p>
<p><strong>Other Options</strong><br />
So apart from using one of these excellent open source libraries, what else could you do to get 3D graphics running in your Flash websites and games? Well there&#8217;s always Flash Player 10 and it&#8217;s built in 3D support. I&#8217;ve recently been trying out <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo" target="_blank">Flex 4</a> and had a go at using the new 3D features  such as  drawTriangles, and while it is definitely simple and easy to,  requiring very little maths, the visual quality wasn&#8217;t quite what I&#8217;d hoped for when compared to Papervision3D and Five3D. Saying that, the real potential of native 3D in Flash Player 10 is in the new 3D utility classes, which along with pixel bender and alchemy are being used to improve many of the current Flash 9 3D engines.</p>
<p>Of course, there&#8217;s always the option of making your own 3D engine using the standard drawing API and a bit of maths, or even trying something a bit more ambitious like ray tracing or voxels, it&#8217;s all possible in AS3. One great example of this &#8216;home made&#8217; approach is the incredibly fast <a href="http://temp.roxik.com/index.html" target="_blank">Sharikura3D</a> engine by Roxik. This engine was used for <a href="http://ecodazoo.com/" target="_blank">Eco Zoo</a>, which won the FWA 2008 Site of the Year award, and has some of the best graphics and the smoothest frame rate I&#8217;ve seen in any 3D Flash website.</p>
<p><strong>Next Steps</strong><br />
If any of this has inspired you to find out more about writing your own 3D engine in AS3, then Keith Peters legendary book -  <a href="http://www.friendsofed.com/book.html?isbn=9781590597910" target="_blank">Foundation AS3 Animation: Making Things Move</a> &#8211; is definitely the place to start. The book covers the basics of setting up a vector based 3D engine in AS3 and includes shading, backface culling and 3D meshes, along with loads of other graphics and animation concepts. In fact, even if you&#8217;ve no intention of writing a 3D engine from scratch, it is still well worth a read as it really helps you understand the basics of how 3D in Flash actually works.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/201/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=201&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/11/as3-quick-guides-open-source-3d-engines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>
	</item>
		<item>
		<title>3D Ribbon class for Flash Player 10</title>
		<link>http://matteley.wordpress.com/2009/10/04/3d-ribbon-class-for-flash-player-10/</link>
		<comments>http://matteley.wordpress.com/2009/10/04/3d-ribbon-class-for-flash-player-10/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 22:57:02 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Demos]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=179</guid>
		<description><![CDATA[Following on from my previous post about the new 3D features of Flash Player 10, I decided to take a look at a more advanced way of drawing 3D graphics in AS3, using the new drawTriangles method of the updated Graphics class. This demo was my attempt at creating a version of Soulwire&#8217;s Papervision3D Ribbon [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=179&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following on from my previous post about the new 3D features of Flash Player 10, I decided to take a look at a more advanced way of  drawing 3D graphics in AS3, using the new <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Graphics.html#drawTriangles%28%29" target="_blank">drawTriangles</a> method of the updated Graphics class.</p>
<p>This demo was my attempt at creating a version of <a href="http://blog.soulwire.co.uk/flash/actionscript-3/papervision3d/pv3d-ribbon3d-class/" target="_blank">Soulwire&#8217;s Papervision3D Ribbon class</a> using native Flash Player 10 code, and while the demo doesn&#8217;t support the more advanced features of the Papervision version, the final result does look quite similar. In fact, if you take a look at the code you&#8217;ll see just how simple 3D can be when using Flash 10.</p>
<p>Using drawTriangles to render 3D graphics is fairly straight forward, requiring you to pass in a number of different Vectors to describe the geometry of a 3D mesh. A <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html" target="_blank">Vector</a> is Flash 10&#8242;s new typed array class, and is very useful for making sure that an array contains only one type of data. The drawTriangles method accepts four parameters, three of them Vectors, but I won&#8217;t go into this in detail here as there are many good articles that explain it far better than I can, such as this <a href="http://www.boostworthy.com/blog/?p=242" target="_blank">excellent introduction to drawTriangles</a> by Ryan Taylor.</p>
<p>What I will note is that from my tests and what what I have read, it seems that drawTriangles (while very useful) is best suited to quick and simple 3D effects. If you&#8217;re looking to render light sourced materials with proper z-sorting, or more than one texture map per object, then you will probably need to write your own classes to do just that, much as this post by <a href="http://www.neuroproductions.be/experiments/basic-3d-shading-test/" target="_blank"> Neuro Productions</a> explains.</p>
<p>In fact, what really makes 3D in Flash 10 shine are the new utility classes such as Matrix3D, Vector3D and Utils3D. If you look at the code for the demo below you will see that there is really not much complex maths being used, instead it is mostly taken care of with these new classes.  And it is these classes which new engines like PapervisionX or Away3DLite will most likely be using to boost speed and improve visual quality in Flash Player 10.</p>
<p><a href="http://www.matteley.co.uk/labs/demo6-ribbons3d/" target="_blank"><img class="alignnone size-full wp-image-181" title="demo6-screengrab" src="http://matteley.files.wordpress.com/2009/10/demo6-screengrab.jpg?w=400&#038;h=300" alt="demo6-ribbons3d" width="400" height="300" /></a></p>
<p><a href="http://www.matteley.co.uk/labs/demo6-ribbons3d/" target="_blank">Click here to view the demo and source code</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=179&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/04/3d-ribbon-class-for-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2009/10/demo6-screengrab.jpg" medium="image">
			<media:title type="html">demo6-screengrab</media:title>
		</media:content>
	</item>
		<item>
		<title>Music Visualizer with Flash 10 3D effects</title>
		<link>http://matteley.wordpress.com/2009/10/03/music-visualizer-with-flash-10-3d-effects/</link>
		<comments>http://matteley.wordpress.com/2009/10/03/music-visualizer-with-flash-10-3d-effects/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 22:32:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Demos]]></category>
		<category><![CDATA[Visual Effects]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Music Visualiser]]></category>

		<guid isPermaLink="false">http://matteley.wordpress.com/?p=157</guid>
		<description><![CDATA[So I finally got around to setting up Flex 4 with FlashDevelop 3 and thought I would have a go at making another music visualizer, this time using some of the new features in Flash Player 10. Setting up Flex 4 turned out to be much easier than I expected (was just a case of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=157&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I finally got around to setting up Flex 4 with FlashDevelop 3 and thought I would have a go at making another music visualizer, this time using some of the new features in Flash Player 10.</p>
<p>Setting up Flex 4  turned out to be much easier than I expected (was just a case of swapping it for Flex 3 in the FlashDevelop compile settings), and while you don&#8217;t get code completion for the new Flash 10 classes everything else runs fine.</p>
<p>While there&#8217;s lots of great new features in Flash 10, the one thing I wanted to try out was the new built in 3D transforms and drawing API. So I set about trying to make some kind of 3D sound tunnel, the aim was to get something that looked like an old <a href="http://www.llamasoft.co.uk/softography.php" target="_blank">Llamasoft game</a>, although I&#8217;m not sure quite how successful that was.</p>
<p>Anyway, the code turned out to be surprisingly easy to write, it seems that Adobe have gone to some real effort to make sure that the new 3D effects in Flash 10 are as easy to use as possible. In many ways it&#8217;s actually quite similar to how <a href="http://five3d.mathieu-badimon.com/" target="_blank">Five3D</a> works, you can rotate any display object on any axis, move the vanishing point of the scene and even adjust things like camera focus and field of view, although as far as I know you cannot actually move the camera itself.</p>
<p>While this is all great, there are a few limitations to these new 3D effects as Keith Peters has pointed out in his posts about the <a href="http://www.bit-101.com/blog/?p=1674" target="_blank">visual quality of  3D in Flash 10</a> and the effect this has on  <a href="http://www.bit-101.com/blog/?p=2391" target="_blank">nested display objects with 3D transforms</a>. Some of this, such as the lack of anti-aliasing, you will be able to see in the demo below.</p>
<p>Despite these issues, I think the Flash 10 3D effects will come in very useful on some future project where low file sizes and simple code might be more important than higher visual quality.</p>
<p>Check out the demo and source code below, as usual the music (or you could just call it noise) was made using the <a href="http://www.hobnox.com/noxtools.902.en.html" target="_blank">Hobnox AudioTool</a> ToneMatrix, which is their version of the <a href="http://en.wikipedia.org/wiki/Tenori-on" target="_blank">Yamaha Tenori-On</a>.</p>
<p><a href="http://www.matteley.co.uk/labs/demo5-soundvisualizer/" target="_blank"><img class="alignnone size-full wp-image-162" title="demo5-soundvisualizer" src="http://matteley.files.wordpress.com/2009/10/demo5-screengrab.jpg?w=400&#038;h=300" alt="demo5-soundvisualizer" width="400" height="300" /></a></p>
<p><a href="http://www.matteley.co.uk/labs/demo5-soundvisualizer/" target="_blank">Click here for demo and source code</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matteley.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matteley.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matteley.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matteley.wordpress.com&amp;blog=7966345&amp;post=157&amp;subd=matteley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matteley.wordpress.com/2009/10/03/music-visualizer-with-flash-10-3d-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1a15a8c922162f69c987377950dceaf?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">matteley</media:title>
		</media:content>

		<media:content url="http://matteley.files.wordpress.com/2009/10/demo5-screengrab.jpg" medium="image">
			<media:title type="html">demo5-soundvisualizer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
