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

<channel>
	<title>Everyday 3D &#187; Away3D</title>
	<atom:link href="http://www.everyday3d.com/blog/index.php/category/3d/away3d-3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.everyday3d.com/blog</link>
	<description>3D user experience on the web. Design, technology news. A blog by Bartek Drozdz.</description>
	<lastBuildDate>Fri, 01 Jul 2011 09:12:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>A 3D racing game in Flash with Away3D</title>
		<link>http://www.everyday3d.com/blog/index.php/2009/12/11/3d-racing-game/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2009/12/11/3d-racing-game/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 16:05:52 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[News & Events]]></category>
		<category><![CDATA[Unity3d]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=832</guid>
		<description><![CDATA[I am proud to announce my latest project. It&#8217;s a 3D racing game done in Flash with Away3D. I worked on this project together with Calisto Labs and our client was Snowball Media. My task was to create the 3D game part. It was great fun to work on this project. The team at Calisto [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.everyday3d.com/works/scion/"><img src="http://www.everydayflash.com/blog-assets/scion/tunnel.jpg" alt="Scion Street Racer" border="0" width="520" height="319"/></a></p>
<p>I am proud to announce my latest project. It&#8217;s a 3D racing game done in Flash with <a href="http://www.away3d.com">Away3D</a>. I worked on this project together with <a href="http://calistolabs.com/">Calisto Labs</a> and our client was <a href="http://www.snowball-media.com/">Snowball Media</a>. My task was to create the 3D game part. It was great fun to work on this project. The team at Calisto Labs did a awesome job and everything went smoothly!</p>
<p>The project required to use my Actionscript and 3D modeling skills together on a scale like I never did before. I spent a lot of time with <a href="http://www.blender.org">Blender</a> and <a href="http://www.unity3d.com">Unity</a> in the last months, and without this experience I feel the project would be beyond my abilities. Also, having a direct comparison between Flash and Unity allowed be to see things in a larger perspective.</p>
<p><strong>Flash vs. Unity&#8230; again</strong></p>
<p>I built the game with <a href="http://www.away3d.com">Away3D FP10</a>. I must say that Flash 3D has gone a long way since I first started to play with it, and Away3D is a very solid engine. The 2K polygon limitation is a thing of the past, and the correct perspective projection in FP10 makes everything look so much better. The team also added some other crucial features to create 3D environments &#8211; ex. frustum clipping. </p>
<p>Before starting this project I was working on a <a href="http://www.everydayflash.com/unity3d/one/">Unity3D racing demo</a>, so I managed to get quite a few ideas on how to build such a thing. However, when I moved back to Flash, I was a bit desperate because I realized how much stuff I got used to in Unity is just not there in Flash. A built-in physics engine would be the most important one.</p>
<p><strong>Home-made physics and collision detection</strong></p>
<p>For physics in Flash I was tempted do use <a href="http://www.jiglibflash.com/blog/">JigLib</a> at first. But soon I found out that JigLib is way too complex, creating a realistic car behavior would be very difficult and it would probably eat too many CPU cycles. I estimated that Away3D will take around 90-95% of available processing power, so there&#8217;s no space for any other complex piece of code to run in the same time. I always think that when it comes to 3D in Flash <strong>performance is quality</strong>, and there is no excuse for poor performance, even if you want something to look &#8220;realistic&#8221;. So I ended building something very very simple.</p>
<p>Once I got the car driving around, I needed to add some collision detection. In Unity you quickly get used to the fact that any 3d object is a collider which makes collision detection a no-brainer &#8211; just implement a listener method and get a call whenever your object collides with another one. And if you need to add realistic collision response, you just make the object a rigid body and there you go! (Ok, you may need to adjust some settings, but still it&#8217;s pretty straightforward).</p>
<p>In Flash it seemed like a much more complex task. I was thinking in the lines of creating a system based on the geometry of the track. I started to study curve equations just to realize I wouldn&#8217;t make it even if I had a year to complete the project! Then I remembered, that a <strong>good way to test collision with complex shapes is a bitmap</strong>. </p>
<p>The way it works is that it takes the car&#8217;s position and checks against a map of the track that has different colors for different areas &#8211; ex. red for the road, green for the sideways and so on&#8230; Since it samples only a few pixels per frame and all it does is check their RGB values, it&#8217;s lighting fast. <strong>Truly, Flash is the art of minimal!</strong></p>
<p><strong>Scenery</strong></p>
<p>The most fun part was to create the scenery. I&#8217;ve never tried to import such a large 3D scene into Flash so I wasn&#8217;t even sure if Away3D would handle it. It turns out it did handle it pretty well. Instead of using Collada I went with <strong>Wavefront (OBJ)</strong> format for the meshes as I feel it gave me more flexibility. OBJ is a simple format which makes it a bit easier to see what&#8217;s going on while <strong>Collada is bloated</strong> and overly complex for my taste. I used <strong>Blender to model the track</strong> and the few objects that you can see around it &#8211; lampposts, houses and the tunnel. </p>
<p><strong>Lightning</strong></p>
<p>Lightning is very important in low poly scenes, <strong>because it adds a lot of detail and atmosphere to the scenery</strong>, without adding any polygons. Even thought the scenery is simple, I ended up having more that 60 lamps. Of course all those lights needs to be baked on the textures, there&#8217;s no way to run them in real-time. Blender has a very good texture baking tool and all this works fine for static objects. But what about objects that move, like the car? </p>
<p>For lightning the car, I reused the concept from collision testing. But instead of a collision map I made another one &#8211; <strong>a light map</strong>. Basically it&#8217;s a bitmap with white areas where the scenery is lit and dark ones where it&#8217;s not. By sampling a single pixel on every frame I can see if the car is passing through a lit area. Then, all I have to do is to <strong>apply a color transform on the car texture</strong> to make it brighter. Again &#8211; a minimal solution, but it works!</p>
<p>Now that you know all about it, go ahead and <a href="http://www.everyday3d.com/works/scion/">try it out!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2009/12/11/3d-racing-game/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Exploring JigLibFlash &#8211; the AS3 3D physics library</title>
		<link>http://www.everyday3d.com/blog/index.php/2009/04/23/jiglibflash-3d-physics/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2009/04/23/jiglibflash-3d-physics/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 08:38:27 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[JigLibFlash]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[physics simulation]]></category>
		<category><![CDATA[pingpong]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=204</guid>
		<description><![CDATA[JigLibFlash is a new library for 3D physics simulation in Flash. It is ported from a C++ open source engine. It&#8217;s been around for a few months now, and if you haven&#8217;t heard about it, you need to catch up! I believe physics simulation is the next step in the Flash 3D world, so I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.everydayflash.com/flash/jiglib/pingpong.html" target="_blank"><img src="http://www.everydayflash.com/flash/jiglib/pingpong.jpg" width="520" height="245" border="0" alt=""></a></p>
<p><strong>JigLibFlash</strong> is a new library for 3D physics simulation in Flash. It is ported from a <strong>C++ open source engine</strong>. It&#8217;s been around for a few months now, and if you haven&#8217;t heard about it, you need to catch up!</p>
<p>I believe physics simulation is the <strong>next step</strong> in the Flash 3D world, so I got very excited when Ringo from <a href="http://www.flashbookmarks.com/" target="_blank">FlashBookmarks</a> invited me <strong>join the JigLibFlash team</strong> a couple of months ago. One little problem: I am perfectly lame when it comes to physics&#8230; In this situation, the only logical thing to do was to join the team and learn all the stuff I need to know about it in the meantime. Sounds like a challenge! </p>
<p>Now I slowly fill my knowledge gap. However, I also managed to do some actual work on the library. Together with <a href="http://blog.reyco1.com/" target="_blank">Reyco</a> we remodeled the API. We started by making it more <strong>Flash developer</strong> friendly, less C-style and more AS-style. All the methods start with a lowercase letter now, and instead of having to set the position and rotation using vectors and matrices, the new API offers simple getter/setters for properties like x/y/z and rotationX/Y/Z just like in <a href="http://blog.papervision3d.org/" target="_blank">Papervision3D</a> or in the new Flash Player 10 API. </p>
<p>Last but not least, we also created a plugin system to <strong>easily integrate</strong> <strong>JigLibFlash </strong>with the popular 3D engines like <a href="http://blog.papervision3d.org/" target="_blank">Papervision3D</a> or <a href="http://away3d.com/" target="_blank">Away3D</a>. Now there are <strong>specialized classes</strong> to interact with those two engines and it should be pretty easy to create a plugin for another engine if one needs. If you worked with <a href="http://code.google.com/p/as3dmod/" target="_blank">AS3Dmod</a> you should notice that the concept is similar to the plugin architecture in there. <em>Update: I just saw in the sources that someone already created a plugin for Sandy3D.</em></p>
<p>To learn more about these changes you can refer to the <a href="http://code.google.com/p/jiglibflash/wiki/New_API_Very_Short_Tutorial" target="_blank">tutorial</a> I wrote which is posted on the projects wiki page. Reyco also wrote a <a href="http://blog.reyco1.com/jiglibflash-papervision3d-quick-run-through/" target="_blank">great article</a> about this on his blog.</p>
<p>The <a href="/flash/jiglib/pingpong.html" target="_blank">demo above</a> is my <strong>first little experiment</strong> with JigLibFlash and <a href="http://blog.papervision3d.org/" target="_blank">Papervision3D</a>. My idea was to integrate a <strong>Collada object with the physics system</strong> and to add some interactivity to it. I extended the <a href="http://code.google.com/p/jiglibflash/source/browse/trunk/fp9/src/jiglib/plugin/papervision3d/constraint/MouseConstraint.as" target="_blank">Mouse constraint class</a> created by Reyco to control the racket. I encountered some problems with stabilizing it in the long run. After having bounced the ball a few times the racket starts to rotate as if the constraints were broken&#8230; well, I still need to do some research on that. </p>
<p><strong>Source code</strong>. You can browse the sources for the demo <a href="http://code.google.com/p/barteksplayground/source/browse/#svn/trunk/fp10/src/com/everydayflash/jiglib/pong" target="_blank">here</a>.</p>
<p><strong>Links</strong>. Some links to get you started with JigLibFlash:</p>
<ul>
<li><a href="http://www.jiglibflash.com/blog/" target="_blank">Official blog</a>, <a href="http://code.google.com/p/jiglibflash/" target="_blank">Google code</a></li>
<li><a href="http://code.google.com/p/jiglibflash/wiki/New_API_Very_Short_Tutorial" target="_blank">Wiki tutorial on new API</a> and <a href="http://blog.reyco1.com/jiglibflash-papervision3d-quick-run-through/" target="_blank">Reyco&#8217;s article</a></li>
<li><a href="http://blog.zupko.info/?p=273" target="_blank">Really cool demo by Andy Zupko</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2009/04/23/jiglibflash-3d-physics/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>PDFBook3D, a 3D flipbook engine</title>
		<link>http://www.everyday3d.com/blog/index.php/2009/04/03/pdfbook3d-3d-flipbook-engine/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2009/04/03/pdfbook3d-3d-flipbook-engine/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 11:16:37 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[News & Events]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[flipbook]]></category>
		<category><![CDATA[flippage]]></category>
		<category><![CDATA[pdfbook]]></category>
		<category><![CDATA[powerflasher]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=118</guid>
		<description><![CDATA[PDFBook3D is a Flash application that allows to transform a PDF document into a 3D model, that later can be viewed pretty much like a real book. The product was just released by Powerflasher, and I was involved in creating the front-end 3d Flash part of it. This application belongs to the family of flipbook [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.powerflasher.de/pdfbook3d/" target="_blank"><img src="/flash/pdfbook/pdfbook3d.jpg" width="520" height="190" border="0" alt="PDFBook3d"></a></p>
<p><strong><a href="http://www.powerflasher.de/pdfbook3d/" target="_blank">PDFBook3D</a></strong> is a Flash application that allows to transform a <strong>PDF document into a 3D model</strong>, that later can be viewed pretty much like a real book. The product was just released by <a href="http://solutions.powerflasher.com/en/products/pdfbook-3d/information/" target="_blank">Powerflasher</a>, and I was involved in creating the front-end 3d Flash part of it. </p>
<p>This application belongs to the family of flipbook engines. I am sure you have seen the classic 2D version of a flipbook at least once. It is widely popular around the web! <strong>PDFBook3D</strong> replaces this classic piece with a more accurate and realistic 3D version of the effect created with <strong>AS3Dmod bend modifier</strong>. The bend modifier allows to create paper simulation in Flash, which is something I already posted about <a href="http://www.everydayflash.com/blog/index.php/2008/11/03/paper-simulation-as3dmod/">back in November</a>.</p>
<p>The application has a rich set of configurable properties, including dimensions of the book (for non typical page sizes) and a number of quality settings to get a decent framerate on slower machines as well. The Powerflasher team created an admin interface to generate 3d books on the fly. You can see it in action <a href="http://pdfbook-3d-demo.powerflasher.com/" target="_blank">here</a>. The product functionality also includes links editor and video embedding. If you are interested in more information please refer to the <a href="http://solutions.powerflasher.com/en/products/pdfbook-3d/information/" target="_blank">Powerflasher Solutions</a> site. </p>
<p>PDFBook3D is also my first commercial project made using <strong><a href="http://www.away3d.com" target="_blank">Away3D</a></strong>. There are a few features in Away3D that made me choose it, but mostly it was the curiosity to try <em>"the other"</em> engine. I must admit Away3D turned out to be pretty cool! </p>
<p>It is most famous for its advanced features like <a href="http://www.closier.nl/blog/?p=82" target="_blank">normal maps</a>, <a href="http://www.closier.nl/blog/?p=73" target="_blank">path extrudes</a> and <a href="http://www.infiniteturtles.co.uk/blog/away3d-multimario" target="_blank">bones animation</a>. However, this project does not rely on those advanced functionalities. Most of what I used in here is pretty basic, but still I was able to find some cool stuff. </p>
<p>One very useful feature is being able to assign <strong>back material</strong> to planes. It might not seem like a huge thing, but since it is used to create the flipping page, it helped me a lot. Actually any <strong>mesh in Away3D can have a back material</strong> assigned to its faces using the <code>back</code> property of the class:</p>
<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myMesh.<span style="color: #006600;">material</span> = <span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0xff0000<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// classic front-side material</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myMesh.<span style="color: #006600;">back</span> = <span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0x00ff00<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// back material </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Notice, that it is not the same thing as having a <strong>double sided material</strong> - that is, the same material used for both sides of a face. In this case - one material is used for one side, and a completely different one for the other. This is why it was perfect for creating a page of a book.</p>
<p>Another cool feature of Away3D is <strong>triangle caching</strong> - it is a built in functionality, that doesn't require any extra coding and it can give a significant <a href="http://www.infiniteturtles.co.uk/blog/awa3d-220-sierpinski-turtles" target="_blank">performance boost</a>. Thanks to triangle caching, whenever the page flip animation is on, the rest of the book that does not move at this moment is not re-rendered at each frame. A similar optimization can be achieved in Papervision3D using render layers, but it's not as easy to use. </p>
<p>Last but not least, I'd like to thank <a href="http://blog.closier.nl/" target="_blank">Fabrice Closier</a> from the Away3D team for support and feedback during the project! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2009/04/03/pdfbook3d-3d-flipbook-engine/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Making things walk in Flash 3D</title>
		<link>http://www.everyday3d.com/blog/index.php/2009/02/09/making-things-walk-in-flash-3d/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2009/02/09/making-things-walk-in-flash-3d/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 09:06:22 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[2D Animation]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[character animation]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[running]]></category>
		<category><![CDATA[walk cycle]]></category>
		<category><![CDATA[walking]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=52</guid>
		<description><![CDATA[An Actionscript-based 3D bone system is something I wanted to do for a long time, but I couldn't figure out how to approach this problem for several months. A few days ago, I finally made a breakthrough. Here's a first demo I quickly put together: a 3D walk cycle. So far the only way to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.everydayflash.com/flash/walk/" target="_blank"><img src="http://www.everydayflash.com/flash/walk/walk-cycle-3d.png" border="0" alt="Walk cycle in Papervision3D" width="520" height="220" /></a></p>
<p>An <strong>Actionscript-based 3D bone system</strong> is something I wanted to do for a long time, but I couldn't figure out how to approach this problem for several months. A few days ago, I finally made a breakthrough. Here's a first demo I quickly put together: <a href="http://www.everydayflash.com/flash/walk/" target="_blank">a 3D walk cycle</a>.</p>
<p>So far the only way to have a <strong>walking character in Flash 3D</strong> was to create an animation sequence in a 3D editor and export it as an <strong>animated DAE</strong> and/or use <a href="http://cast3d.org/" target="_blank">Cast3D</a>. For sure, this method allows to achieve <a href="http://www.bajibot.com/xmas2008/" target="_blank">awesome results</a>, but it is <strong>not nearly as flexible</strong> as being able to control the animation <strong>directly from Actionscript</strong>.</p>
<p>So, how does the above demo work? First of all I created a model of <strong>pants in Blender</strong>. This is the 4th model I ever did with Blender so it not perfect, but is good enough for the job. The important part is that both legs and the waist form a <strong>single mesh</strong>.</p>
<p>After I imported the model into <a href="http://blog.papervision3d.org/" target="_blank">Papervision3D</a> I applied several <strong>Break modifiers</strong> to the model. The <a href="http://code.google.com/p/as3dmod/source/browse/trunk/src/com/as3dmod/modifiers/Break.as" target="_blank"><strong>Break modifier</strong></a> is a new class I wrote for <a href="http://code.google.com/p/as3dmod/" target="_blank">AS3Dmod</a> and is of key importance for this demo. In brief, it allows to apply rotation only to a group of vertices while leaving the rest untouched. The resulting deformation makes the mesh look like it was broken, hence the name.</p>
<p>I created a <a href="http://code.google.com/p/as3dmod/wiki/AS3Dmod_Tutorial" target="_blank">modifier stack</a> and added <strong>4 Break modifiers</strong> to the pants. One for each tight, and one for each knee. The angle for each of them can be modified separately, which allows dynamic animation. </p>
<p>You probably wonder how I did <strong>indicate which vertices belong to which part of the mesh</strong> (waist, thigh, calf) and how I even know where those parts start or end on the code level. That is crucial in creating an armature and it is also the tricky part. Most of the 3D IDEs, like 3Dsmax or Blender have some kind of visual interface that allows the user to <strong>select vertices and attach them to a bone</strong>. In AS everything is code, so this is a challenge. I must confess that for this demo I hardcoded some values and did some assumptions to make it work, but I think there is a way to make this task <strong>relatively easy</strong> or at least possible to apprehend.</p>
<p>In the long run, it would be cool if bones could be <strong>exported from 3D IDEs</strong> and <strong>exposed as objects</strong> in Actionscript. As far as I know, there isn't anything like this available for the moment. <a href="http://www.away3d.com" target="_blank">Away3D</a> supports <a href="http://www.infiniteturtles.co.uk/blog/away3d-multimario" target="_blank">collada bone animation</a> but, despite its promising name, it serves a different purpose (correct me if I am wrong.)</p>
<p>Let's go back to the demo. Once I had the Break modifiers in place and applied to the correct areas of the mesh, the rest was rather easy. To create a proper <strong>walk cycle</strong>, I just took <a href="http://www.bit-101.com/blog/" target="_blank">Keith Peters'</a> book <a href="http://www.friendsofed.com/book.html?isbn=1590597915" target="_blank"><strong>"Making Things Move"</strong></a>, Chapter 13 on <strong>Forward Kinematics</strong>, and I adapted the code from the examples.</p>
<p>In case you don't know that book, I would strongly recommend getting it. It contains all the essential stuff you need to know, if you want to call yourself a serious AS3 developer. I never leave home without it! There is also a <a href="http://www.friendsofed.com/book.html?isbn=9781430216087" target="_blank">sequel</a>, with stuff for Flash Player 10.</p>
<p>This walk cycle is only a <strong>first step</strong> to create a bone system in AS, but I wanted to share it with you without spending another few months making it fully featured. <strong>Break modifier</strong> is available in the latest <a href="http://code.google.com/p/as3dmod/" target="_blank">AS3Dmod</a> SVN repository. I should warn you however that this is a <strong>very early version</strong>, not really usable for the moment. </p>
<p>Of course, updates are coming so <strong>stay tuned!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2009/02/09/making-things-walk-in-flash-3d/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>The AS3Dmod tutorial</title>
		<link>http://www.everyday3d.com/blog/index.php/2009/01/06/the-as3dmod-tutorial/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2009/01/06/the-as3dmod-tutorial/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 19:23:16 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[Actionscript APIs]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=49</guid>
		<description><![CDATA[I did some research in the blogs and on Twitter, and often when someone mentioned AS3Dmod, the recurring theme was the lack of documentation. Yeah... but creating proper documentation is such a difficult task! First of all, it's hard to find enough free time. Then, even if you find some, most of us, including me, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/as3dmod/wiki/AS3Dmod_Tutorial" target="_blank"><img src="/flash/as3dmod/as3dmod-tutorial.gif" width="520" height="200" border="0" alt="The AS3Dmod tutorial"></a></p>
<p>I did some research <strong>in the blogs and on Twitter</strong>, and often when someone mentioned AS3Dmod, the recurring theme was the <strong>lack of documentation</strong>. Yeah... but creating proper documentation is such a difficult task! </p>
<p>First of all, it's hard to find enough free time. Then, even if you find some, most of us, including me, will always find it more fun <strong>to write code instead</strong>. Eventually, I profited of the calmer period in the last 3 weeks and made some progress with that. The result is <a href="http://code.google.com/p/as3dmod/wiki/AS3Dmod_Tutorial" target="_blank"><strong>the AS3Dmod tutorial</strong></a>.</p>
<p>In the tutorial you will find answers to the following topics:</p>
<ul>
<li>how to integrate AS3Dmod with the Flash 3d engines</li>
<li>how the modifier stack works</li>
<li>how to create and apply modifiers</li>
<li>how to animate the modifier properties</li>
<li>how to use the <code>collapse</code> feature</li>
</ul>
<p>Beside the tutorial there are <a href="http://www.everydayflash.com/flash/as3dmod/doc/" target="_blank"><strong>API Docs</strong></a> available for some time now. </p>
<p>Another thing are simple <strong>interactive demos for each modifier</strong>. So far I created it for one: <strong>Skew</strong>. You <a href="http://www.everydayflash.com/flash/as3dmod/demo/skew.html" target="_blank">can view it here</a>. The demo allows to see all the properties and features of the modifier in action, instead of explaining it in writing. If this concept gets some positive feedback, I'll try to do more of those.</p>
<p>Hope you will find all this useful, and remember that feedback is very welcome (and much needed). And of course <strong>Happy New Year everyone!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2009/01/06/the-as3dmod-tutorial/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Texture baking is your friend</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/11/20/texture-baking-is-your-friend/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2008/11/20/texture-baking-is-your-friend/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 23:57:59 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Blender]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[alternativa3d]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[ecodazoo]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[roxik]]></category>
		<category><![CDATA[texture baking]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=45</guid>
		<description><![CDATA[Texture baking has been known to the Flash 3d community since a long time, but a quick look into Google shows us that it is not a very popular topic. I think it definitely should get more attention. In Flash performance is always an issue, and high quality is always expected by our clients. Texture [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.everydayflash.com/flash/chair/" target="_blank"><img src="http://www.everydayflash.com/flash/chair/awaychair.jpg" border="0" alt="" width="520" height="202" /></a></p>
<p><strong>Texture baking</strong> has been known to the Flash 3d community since a long time, but a quick look into Google shows us that it is not a very popular topic. I think it definitely should get more attention. <strong>In Flash performance is always an issue, and high quality is always expected</strong> by our clients. Texture baking helps to achieve this goal. </p>
<p>In short, it consists of getting all the lightning effects of a material and "burning" them directly on the material itself. After such operation, the lights cannot change anymore, but the material gets a nice effect of depth and it doesn't require any more computations at runtime.</p>
<p>Most of the available 3D software offers a texture baking function. <a href="http://www.everydayflash.com/flash/chair/" target="_blank">For the demo above</a>, I did choose <strong><a href="http://www.blender.org/" target="_blank">Blender</a></strong> because it's free (it also has a very weird user interface, but I digress). On the Flash side, it runs on <strong><a href="http://www.away3d.com" target="_blank">Away3d</a></strong>.</p>
<p>To create a model with baked textures in Flash I followed this steps:</p>
<ol>
<li><strong>Create the 3d model</strong> of the chair in Blender</li>
<li><strong>Project all the faces</strong> of the model on to an bitmap (in Blender its called UV Unwrapping)</li>
<li><strong>Paint the texture</strong> in Photoshop</li>
<li>Import the texture to Blender and <strong>apply it to back the model</strong></li>
<li><strong>Add lights and bake the texture</strong> on to another bitmap</li>
<li><strong>Export the geometry</strong> with the UV information included (<a href="http://en.wikipedia.org/wiki/COLLADA" target="_blank">Collada</a> or <a href="http://en.wikipedia.org/wiki/Obj" target="_blank">Wavefront</a>)</li>
<li><strong>Export the baked texture</strong> as a jpg</li>
<li>Import both into Flash and use your favorite 3d engine to render</li>
</ol>
<p>Each of the steps above could require a separate tutorial, so instead I published some <strong>files created in the process</strong> to give you a better idea. You can <a href="http://www.everydayflash.com/flash/chair/baked-textures.zip">get them here</a>. <em>Please note, that this is only a reference material - it is not supposed to be built or compiled or anything.</em></p>
<p>Additionally, for those of you who use Blender a nice tutorial on both <strong>UV Texture Mapping and Texture Baking</strong> is <a href="http://www.scifi-meshes.com/forums/dojo/1755-blender-faint-hearted-08-uv-texture-mapping-texture-baking.html" target="_blank">available here</a>.</p>
<p>In the current state of Flash 3D and its overall performance, texture baking is a <strong>highly useful technique</strong> that allows to achieve very good results. If you do not believe me, take look at some of the most awesome Flash 3d pieces that came out in the last few months: </p>
<ul>
<li><strong><a href="http://blog.alternativaplatform.com/ru/files/2008/04/bunker.swf" target="_blank">Bunker demo</a></strong> by Alternativa3d team (<a href="http://alternativaplatform.com/en/download/src/bunker_src_en.zip" target="_blank">sources available here</a>) </li>
<li><strong><a href="http://ecodazoo.com/" target="_blank">EcoDaZoo</a></strong> by <a href="http://www.roxik.com/" target="_blank">Roxik</a></li>
</ul>
<p>I am sure you've seen them before anyway. They both combine great visual effects with a very high performance. And guess what... in both of them, you'll find <strong>baked textures all over the place!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2008/11/20/texture-baking-is-your-friend/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Paper simulation in with AS3Dmod and Away3D</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/11/03/paper-simulation-as3dmod/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2008/11/03/paper-simulation-as3dmod/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 09:28:09 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[bend modifier]]></category>
		<category><![CDATA[declaration of independence]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[tweener]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=44</guid>
		<description><![CDATA[Since I released the bend modifier a lot of people have been asking how to bend an object not only along one of its axes, but along any angle. That was clearly a feature missing, but I also didn't have a clue ho to do that. Now, a after a good few days of struggle, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.everydayflash.com/flash/paper/" target="_blank"><img src="http://www.everydayflash.com/flash/paper/awaypaper.jpg" border="0" alt="" width="520" height="202" /></a></p>
<p>Since I released the bend modifier a lot of people have been asking how to bend an object not only along one of its axes, but <strong>along any angle</strong>. That was clearly a feature missing, but I also didn't have a clue ho to do that. Now, a after a good few days of struggle, and with a little help from my friends - <a href="http://www.everydayflash.com/flash/paper/" target="_blank">here it is</a>. </p>
<p>The Bend class now takes 3 arguments in the constructor, the third being the angle at which the bend is executed. Please mind, that this argument expects an <strong>angle in radians</strong>. In the code it looks like this:</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> mesh:Mesh = <span style="color: #66cc66;">&#91;</span>a mesh<span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> stack:ModifierStack = </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> ModifierStack<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LibraryAway3d<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, mesh<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> bend:Bend = <span style="color: #000000; font-weight: bold;">new</span> Bend<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span>, .<span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">stack.<span style="color: #006600;">addModifier</span><span style="color: #66cc66;">&#40;</span>bend<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">stack.<span style="color: #0066CC;">apply</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Of course, there is also a getter/setter for the <code>angle</code>, which allows to change the value dynamically, and to use libraries such as Tweener to animate it. </p>
<p>The Bend modifier is now part of the <strong><a href="http://code.google.com/p/as3dmod/" target="_blank">AS3Dmod library</a></strong>. Since AS3Dmod is cross-engine, the above demo was done <strong>with Away3D</strong>, but of course, <strong>the same functionality can be used with other engines</strong>, including Papervision3D. </p>
<p>For those of you who remember the <a href="http://www.everydayflash.com/blog/index.php/2008/06/11/bending-modifier-papervision3d/" target="_blank">initial bending demo</a>, I used a 100$ bill as a graphic element then. I thought it would fun to be consistent and to stay in the American theme. Therefore, <a href="http://www.everydayflash.com/flash/paper/" target="_blank">this time</a> you can play with the <a href="http://en.wikipedia.org/wiki/United_States_Declaration_of_Independence" target="_blank">Declaration of Independence</a>. Fans of <a href="http://www.imdb.com/title/tt0368891/" target="_blank">"National Treasure"</a> should be delighted.</p>
<p>As usual the sources are available and you can <a href="http://www.everydayflash.com/flash/paper/awaypaper.zip" target="_blank">get them here</a>. I hope you like the demo and that you will find the code useful. To compile it you need the latest versions of <a href="http://code.google.com/p/as3dmod/" target="_blank">AS3Dmod</a>, <a href="http://away3d.com/" target="_blank">Away3D</a> and <a href="http://code.google.com/p/tweener/"target="_blank">Tweener</a> libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2008/11/03/paper-simulation-as3dmod/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Update: what&#8217;s up with AS3Dmod?</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/09/26/update-as3dmod-1/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2008/09/26/update-as3dmod-1/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 08:15:43 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[alternativa3d]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[modifiers]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[sandy3d]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=43</guid>
		<description><![CDATA[A few weeks passed since I wrote about the AS3Dmod library and released an initial version of the code. Some new stuff has happened since, so here's an update. First of all AS3Dmod has a new team member - Makc. Makc has been involved in several AS open-source projects, most notably Sandy3D. You can read [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks passed since I wrote about the <a href="http://www.everydayflash.com/blog/index.php/2008/09/03/as3dmod/">AS3Dmod library</a> and released an initial version of the code. Some new stuff has happened since, so here's an update.</p>
<p>First of all AS3Dmod has a <strong>new team member - Makc</strong>. Makc has been involved in several AS open-source projects, most notably Sandy3D. You can read more about Makc, <a href="http://makc.coverthesky.com/FlashFX/" target="_blank">here</a>, where you will also find some cool Flash experiments.</p>
<p>The code has also evolved, and was moved to a <strong>modest 0.2 version</strong>. The most important changes are some fixes in the imports that prevented the compilation of the project so far.</p>
<p>The 0.2 version has 5 new modifiers: <strong>Bloat, Twist, Taper, Skew and a UserDefined</strong> modifier that allows to create custom vertex manipulation and easily integrate it into the stack. </p>
<p>Other then that, there is now an <strong>ANT script</strong> that allows to compile the demos for all 4 engines, and also to generate <strong>API Docs</strong>. Of course the documentation is ever evolving, but the latest version is always available <a href="http://www.everydayflash.com/flash/as3dmod/doc/">here</a>. Please note, that <strong>API docs are synchronized with the contents of the SVN repository</strong>. The zipped sources available on the project home page are there for reference, but they quickly become outdated.</p>
<p>Last but not least, there already are a few demos that use AS3Dmod. I allowed myself to gather a short list of what I found out there:</p>
<ul>
<li><a href="http://www.dehash.com/?p=203" target="_blank">Interactive demo</a> by Dehash. I think the first AS3Dmod ever made ;)</li>
<li><a href="http://www.tres-graficos.jp/away3d/elephant102_a3d/" target="_blank">Elephant demo</a> by Tres Graficos</li>
<li><a href="http://blog.r3c7.net/?p=224" target="_blank">Away3D + AS3Dmod</a> by note.x</li>
<li><a href="http://www.lamberta.org/blog/better-bend-than-break/" target="_blank">VectorVision + AS3Dmod</a> by Billy Lamberta</li>
<li><a href="http://clockmaker.jp/blog/2008/09/as3dmod/" target="_blank">Bending example with Pv3d</a> by ClockMaker</li>
</ul>
<p><strong>Thanks to everyone!</strong> We will try to put in more and more features, document the code and also create a tutorial, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2008/09/26/update-as3dmod-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>AS3Dmod, a modifier library for all Flash 3d engines</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/09/03/as3dmod/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2008/09/03/as3dmod/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 08:11:59 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[3d animation]]></category>
		<category><![CDATA[actionsript]]></category>
		<category><![CDATA[alternativa3d]]></category>
		<category><![CDATA[as3dmod]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[modifier]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[sandy3d]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=41</guid>
		<description><![CDATA[Meet AS3Dmod, a cross-engine 3d modifier library for Flash. Sounds cool? Yeah, I am sure it does! Just in case, however, let's see what it does step by step. A. Cross-engine. 3D in Flash is around here for some time now, and it resulted in quite a few engines available. Each engine has some cool [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/as3dmod/" target="_blank"><img src="http://www.everydayflash.com/flash/as3dmod/as3dmod-teaser.png" border="0" alt="" width="520" height="200" /></a></p>
<p><strong>Meet AS3Dmod</strong>, a cross-engine 3d modifier library for Flash. Sounds cool? Yeah, I am sure it does! Just in case, however, let's see what it does step by step.</p>
<p><strong>A. Cross-engine</strong>. 3D in Flash is around here for some time now, and it resulted in quite a few engines available. Each engine has some cool features of its own, and sometimes having to choose between them can result in a headache. While AS3Dmod won't solve this situation, it is an attempt to create some functionality that will be available across different engines.</p>
<p><strong>B. Modifier library</strong>. The readers of this blog probably remember the Bend modifier I wrote for PV3D. Well, it is one of many possible modifiers. Classic 3d packages come equipped with at least a dozen of them, which include: taper, twist, noise, skew, etc. Modifiers are basically functions that can be applied to a 3d object to transform it in a certain way. They can be used separately, but when combined they become a very powerful tool. In this, they are much like filters in Photoshop. </p>
<p><strong>C. Flash</strong>. Instead of explaining how modifiers work in Flash, here's a short list of some of the possible uses: <strong>a sheet of paper, a ribbon, a waving flag, water, cloth, a tree or other plant, a butterfly, a birds wing...</strong> They could also be helpful in animating a human face, and in many other situations where animations exported from 3d editors might fall short. </p>
<p><strong>Does it sound cooler now?</strong> It sounded to me when I had the idea a few days ago. As you can imagine I was not able to develop anything close to a full featured library in this short time. Nevertheless, I publish what I was able to come up so far, so that you can all see where I am heading. For the moment, here's what's in there:</p>
<p>- a framework for creating static and <strong>animated modifier stacks</strong><br />
- 3 basic modifiers: <strong>Noise</strong>, <strong>Bend</strong> and <strong>Perlin</strong><br />
- plug-ins for the most popular engines: <strong><a href="http://blog.papervision3d.org/" target="_blank">Papervision3d</a>, <a href="http://www.away3d.com/" target="_blank">Away3d</a>, <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> and <a href="http://alternativaplatform.com/en/alternativa3d/" target="_blank">Alternativa3d</a></strong><br />
- a simple demo for each engine<br />
- <del datetime="2008-09-02T19:17:27+00:00">basic documentation</del> not yet :)</p>
<p><strong>Source files</strong>. <a href="http://code.google.com/p/as3dmod/" target="_blank">The project</a> is at Google Code. You can do a checkout from SVN or download a ZIP. </p>
<p><strong>Demo</strong>. In the repository you can find <a href="http://code.google.com/p/as3dmod/source/browse/trunk#trunk/bin" target="_blank">4 demo SWFs</a>, one for each engine. It features a basic stack of 4 modifiers - Noise, Perlin and Bend x2. You can also compile the project yourself. Just follow the instructions I added <a href="http://code.google.com/p/as3dmod/source/browse/trunk/demo/DemoBase.as" target="_blank">in the document class code</a>. </p>
<p><em><strong>Notes.</strong><br />
1. There is no plug-in for FIVe3D - that is because this engine works in a quite different way and doesn't use vertices which are fundamental to modifiers.<br />
2. The Alternativa3d version works in a bit weird way. I think, it is because there's something I don't understand about this engine, but I will be figuring this out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2008/09/03/as3dmod/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>Away3d: experimenting with light and shading</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/04/26/light-shading-away3d/</link>
		<comments>http://www.everyday3d.com/blog/index.php/2008/04/26/light-shading-away3d/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 19:46:59 +0000</pubDate>
		<dc:creator>bartek drozdz</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[3d animation]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[away3d]]></category>
		<category><![CDATA[flash 3d]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[shading]]></category>

		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=19</guid>
		<description><![CDATA[A couple of weeks ago the Away3D team announced the release of version 2.0. The news was accompanied with a stunning demo called Green Planet. I was impressed, so I downloaded the source and started to play with it. From the start I was interested in checking some light and shading possibilities that Away3D offers. [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.everydayflash.com/flash/away/' target='_blank'><img src='http://www.everydayflash.com/flash/away/earth-away.jpg' width='521' height='243' alt='Click to see the demo' class='alignnone' border="0"/></a></p>
<p>A couple of weeks ago the Away3D team <a href="http://away3d.com/away3d-20-green-planet" target="_blank">announced the release</a> of version 2.0. The news was accompanied with a stunning demo called Green Planet. I was impressed, so I downloaded the source and started to play with it.</p>
<p>From the start I was interested in checking some light and shading possibilities that Away3D offers. I was not disappointed. It turns out that Away3D has some really nice features and they are easy to use. Not everything is well documented, so I had to opt for a trial-and-error technique, but it is ok, as it was released just a few days ago one cannot expect a full documentation. Click on <a href='http://www.everydayflash.com/flash/away/' target='_blank'>the image above</a> to see a demo I created. Below I share some hopefully useful tips.</p>
<p>For the light source I use the PointLight3D. It takes as initObject argument where you need to pass its x, y and z coordinates, but also some settings for the light itself. We have a brightness parameter, which is pretty self explanatory, and three others: ambient, diffuse and specular. Now, if you don't have a clue what these are, as it was the case with me, start by <a href="http://en.wikipedia.org/wiki/Phong_shading" target="_blank">reading this</a>. The exact values that those settings can take is not quite clear, but I tried different options and ended up with something like this:</p>
<div class="igBar"><span id="lactionscript-8"><a href="#" onclick="javascript:showPlainTxt('actionscript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sunLight = <span style="color: #000000; font-weight: bold;">new</span> PointLight3D<span style="color: #66cc66;">&#40;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> x:<span style="color: #cc66cc;color:#800000;">1200</span>, y:<span style="color: #cc66cc;color:#800000;">0</span>, z:-<span style="color: #cc66cc;color:#800000;">600</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; brightness:<span style="color: #cc66cc;color:#800000;">5</span>, ambient:<span style="color: #cc66cc;color:#800000;">30</span>, diffuse:<span style="color: #cc66cc;color:#800000;">500</span>, specular:<span style="color: #cc66cc;color:#800000;">180</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you want your bitmap material to react to the light, a basic BitmapMaterial won't do the job. I experimented many materials available in the package and found out that WhiteShadingBitmapMaterial works pretty well. It is straightforward in setup as it just takes a bitmapData as argument. In my code it looks like this:</p>
<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showPlainTxt('actionscript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-9">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> earthMat:WhiteShadingBitmapMaterial = </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> WhiteShadingBitmapMaterial<span style="color: #66cc66;">&#40;</span>earthBmp.<span style="color: #006600;">bitmapData</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">earth = <span style="color: #000000; font-weight: bold;">new</span> Sphere<span style="color: #66cc66;">&#40;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> material:earthMat, radius:<span style="color: #cc66cc;color:#800000;">150</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; segmentsW:<span style="color: #cc66cc;color:#800000;">32</span>, segmentsH:<span style="color: #cc66cc;color:#800000;">18</span>, y:<span style="color: #cc66cc;color:#800000;">0</span>, x:<span style="color: #cc66cc;color:#800000;">0</span>, z:<span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>earth<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The sun does not need to react to any light, for it is light itself. It also does not need any bitmap texture either, so I just use a basic ColorMaterial. But the sun needs to have a glow. And for that I found one super cool feature in Away3D, and it is called ownCanvas. It is a boolean value, and by setting it to true (default is false) you can assign filters to 3d objects exactly the same way you would assign them to regular sprites. Here's how it looks in the code:</p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> sunMat:ColorMaterial = <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #66cc66;">&#40;</span>0xffffff<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sun = <span style="color: #000000; font-weight: bold;">new</span> RegularPolygon<span style="color: #66cc66;">&#40;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> material:sunMat, radius:<span style="color: #cc66cc;color:#800000;">100</span>, sides:<span style="color: #cc66cc;color:#800000;">32</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; x:<span style="color: #cc66cc;color:#800000;">2400</span>, y:<span style="color: #cc66cc;color:#800000;">0</span>, z: -<span style="color: #cc66cc;color:#800000;">1200</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sun.<span style="color: #006600;">ownCanvas</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sun.<span style="color: #006600;">filters</span> = <span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> GlowFilter<span style="color: #66cc66;">&#40;</span>0xffffbe, <span style="color: #cc66cc;color:#800000;">1</span>, <span style="color: #cc66cc;color:#800000;">12</span>, <span style="color: #cc66cc;color:#800000;">12</span>, <span style="color: #cc66cc;color:#800000;">3</span>, <span style="color: #cc66cc;color:#800000;">3</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> GlowFilter<span style="color: #66cc66;">&#40;</span>0xffffbe, <span style="color: #cc66cc;color:#800000;">1</span>, <span style="color: #cc66cc;color:#800000;">12</span>, <span style="color: #cc66cc;color:#800000;">12</span>, <span style="color: #cc66cc;color:#800000;">3</span>, <span style="color: #cc66cc;color:#800000;">3</span>, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#93;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A final tip, and this one I found on the Away3D discussion group, is to set the stage.quality to LOW. There is no visible difference in rendering quality, but a huge one in performance. And remember, that you can always check the performance by selecting 'Away3D project stats' option from the right-click menu.</p>
<p><strong>UPDATE May 19th 2008. Source code.</strong> I was asked to post the source code of some other examples on the blog and I did it. Later on I thought there is no reason to leave this one behind. So, before anyone asks: the classes are commited to <a href="http://code.google.com/p/barteksplayground/source/browse/trunk/src/com/everydayflash/away3d/earth/EarthDemo.as" target="_blank">my Google Code</a> account, and there is also a ZIP with the code and the assets <a href="http://barteksplayground.googlecode.com/files/EarthDemoAway3D.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyday3d.com/blog/index.php/2008/04/26/light-shading-away3d/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

