<?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>FUNCTION &#187; Flash</title>
	<atom:link href="http://www.functionblog.com/?feed=rss2&#038;tag=flash" rel="self" type="application/rss+xml" />
	<link>http://www.functionblog.com</link>
	<description>blog about AS3, PHP &#039;n tech</description>
	<lastBuildDate>Mon, 01 Feb 2010 17:37:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Little progress update!</title>
		<link>http://www.functionblog.com/?p=161</link>
		<comments>http://www.functionblog.com/?p=161#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:35:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.functionblog.com/?p=161</guid>
		<description><![CDATA[Between times full of study and work I found some time again to work on a few projects. But first I want to apologize to the people who commented on articles here in the period of about May &#8211; December 2009, due to the crapload of spam I recieved in the comments I wasn&#8217;t able [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Verlet Physics Engine" src="http://www.functionblog.com/flash/verlet/verlet.jpg" alt="" width="266" height="109" />Between times full of study and work I found some time again to work on a few projects. But first I want to apologize to the people who commented on articles here in the period of about May &#8211; December 2009, due to the crapload of spam I recieved in the comments I wasn&#8217;t able to filter out spam from my readers. And have thus removed all the pending comments from that period. Now back to where I started, the projects I&#8217;m working on at the moment&#8230; Recently I made a mock up for a collaberative <strong>multi user chat/drawing application</strong> meant for sharing ideas, sketches, links and possibly files. Unfortunately I can&#8217;t share this with you now for technical and financial reasons. What I can share with you is the progress I made when I recently returned to my particle and constraint engine! Having learned a few more fundamental mathematical skills I found it worth looking at Thomas Jakobsen&#8217;s article<a title="Advanced Character Physics" href="http://www.teknikus.dk/tj/gdc2001.htm" target="_blank"> &#8216;Advanced Character Physics&#8217;</a> again. And a few day&#8217;s later we have the beginnings of a very scalable and probably efficient <strong>physics engine</strong> (see it in action after the read more link). In the coming weeks I will refine the engine, <strong>rewrite ponstructor</strong>, release ponstructor and possibly the physics engine as well!</p>
<p>There were a few people impressed and interested in the 3D engine, currently it is not high on my to do-list since there are many better and more efficient offerings out there like Papervision 3D, Away 3D and Sandy. But as soon as I release Ponstructor and the physics engine I might find time to revisit the 3D engine since there is room for a lot of improvement and rewriting.</p>
<p><span id="more-161"></span></p>
<p><object id="test" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="flash/verlet/test.swf" /><param name="allowfullscreen" value="false" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/verlet/test.swf" bgcolor="#ffffff" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ponstructor beta release!</title>
		<link>http://www.functionblog.com/?p=151</link>
		<comments>http://www.functionblog.com/?p=151#comments</comments>
		<pubDate>Sun, 11 Jan 2009 19:11:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[LOL]]></category>
		<category><![CDATA[Released]]></category>

		<guid isPermaLink="false">http://www.functionblog.com/?p=151</guid>
		<description><![CDATA[Since the last post I&#8217;ve been quietly working on a real good version of the bridge builder game for flash.  Take a look at the result after the &#8216;Continue Reading&#8217; link and tell me what you think, (or if you spotted a bug) in the comments.


]]></description>
			<content:encoded><![CDATA[<p>Since the last post I&#8217;ve been quietly working on a real good version of the bridge builder game for flash.  Take a look at the result after the &#8216;Continue Reading&#8217; link and tell me what you think, (or if you spotted a bug) in the comments.</p>
<p><span id="more-151"></span></p>
<p><embed src="http://games.mochiads.com/c/g/ponstructor/ponstructor.swf" width="550" height="500"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Bridge Builder Game! (Concept)</title>
		<link>http://www.functionblog.com/?p=142</link>
		<comments>http://www.functionblog.com/?p=142#comments</comments>
		<pubDate>Sun, 28 Dec 2008 15:39:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Proof of concepts]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Proof of concept]]></category>
		<category><![CDATA[Rigid Body]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=142</guid>
		<description><![CDATA[
Some of you might remember a game called pontifex or bridge builder if you don&#8217;t; it&#8217;s a game in which you construct a bridge with beams and than let a train or car drive over it to see whether it holds. It is really fun and quite educational at the same time (equals morally appropriate [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div id="attachment_144" class="wp-caption aligncenter" style="width: 453px"><img class="size-full wp-image-144" title="bridge" src="http://www.gamitude.nl/wp-content/uploads/2008/12/bridge.jpg" alt="Constraint based bridge simulator" width="443" height="71" /><p class="wp-caption-text">Constraint based bridge simulator</p></div>
<p>Some of you might remember a game called pontifex or bridge builder if you don&#8217;t; it&#8217;s a game in which you construct a bridge with beams and than let a train or car drive over it to see whether it holds. It is really fun and quite educational at the same time (equals morally appropriate right?). After some more research into rigid body constraints I found out that pontifex probably used the same stuff like I used in the <a href="http://www.gamitude.nl/?p=134" target="_blank">2D constraint based rope</a>. So with some minor modifications it was easy to create a bridge simulator and with a littlebit more code even a bridge builder. It is still far from a game suitable for release and profit but it is definatly a playable minigame. Take a look at the working example by clicking the  &#8216;Continue Reading&#8217; link.</p>
<p><span id="more-142"></span></p>
<p>You can build beams by first selecting a particle and than clicking somewhere else (within the &#8216;build length&#8217;) to place a particle to connect it with. To connect two particles with each other select one, and than hover over the other to make it blue and click. To simulate the whether the bridge will hold you need to click the &#8216;Simulate&#8217; button. Press &#8216;Stop&#8217; to stop the simulation and return to the old state. In the simulation you can remove beams by clicking on them.</p>
<p style="text-align: center;"><object width="550" height="300" data="flash/bridgeBuilder/builder.swf" type="application/x-shockwave-flash"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="flash/bridgeBuilder/builder.swf" /><param name="allowfullscreen" value="false" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=142</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2D Constraint based rope</title>
		<link>http://www.functionblog.com/?p=134</link>
		<comments>http://www.functionblog.com/?p=134#comments</comments>
		<pubDate>Fri, 26 Dec 2008 16:24:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Rigid Body]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=134</guid>
		<description><![CDATA[So I was looking into some cool stuff to do with my 3D engine when I came across this. I&#8217;ve always been a fan of physics simulation based realism so I began to work this out in 2D. The first demo was using elastic constraints between particles but that made a very instable system. It [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_133" class="wp-caption alignright" style="width: 135px"><img class="size-full wp-image-133" title="Constraint based rope" src="http://www.gamitude.nl/wp-content/uploads/2008/12/constraintrope.jpg" alt="Constraint based rope simulation" width="125" height="130" /><p class="wp-caption-text">Constraint based rope simulation</p></div>
<p>So I was looking into some cool stuff to do with my 3D engine when I came across <a href="http://seraf.mediabox.fr/wow-engine/wow-engine-technical-advanced-demo-cloth-demo-01/">this</a>. I&#8217;ve always been a fan of physics simulation based realism so I began to work this out in 2D. The first demo was using elastic constraints between particles but that made a very instable system. It can be improved with better integrators like RK4 but that still didn&#8217;t result in the desired result. I might have other plans for these elastic constraints later though. You can read more about elastic constraints <a title="Gaffer's Spring Physics" href="http://gafferongames.wordpress.com/game-physics/spring-physics/" target="_blank">here [Gaffer's tutorial on spring physics]</a> and <a title="Gamasutra's 'Exploring Spring models' tutorial" href="http://www.gamasutra.com/features/20011005/oliveira_01.htm" target="_blank">here [Gamasutra's "Exploring spring models"]</a>. So I went on with inelastic infinitely &#8217;stiff&#8217; constraints which were mentioned in <a title="Advanced Character Physics by Thomas Jakobsen" href="http://www.teknikus.dk/tj/gdc2001.htm" target="_blank">this ["Advanced Character Physics" by Thomas Jakobsen]</a> great resource on computer physics simulation. The result worked out pretty well and will be easy to port to 3D. Which will happen when I&#8217;m done with a little (very interesting) side project using the same code. More about that later&#8230; Check out the working demo after the &#8216;Continue Reading&#8217; link.  <span id="more-134"></span></p>
<p>Below is the working simulation, use your mouse to move the rope. The simulation uses quite a lightweight rope with little friction. Combinations of elastic and inelastic constraints can be used to simulate a lot of different interesting stuff like pudding, crashing cars, stresses on buildings and cloth. Expect more examples soon.</p>
<p style="text-align: center;"><object id="test" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="flash/rope/stick.swf" /><param name="allowfullscreen" value="false" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/rope/stick.swf" bgcolor="#ffffff" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p><a title="Constraint based rope source code" href="http://www.functionblog.com/wp-content/uploads/2009/07/Constraint.zip" target="_blank">Download source code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>3D Graphing in flash</title>
		<link>http://www.functionblog.com/?p=95</link>
		<comments>http://www.functionblog.com/?p=95#comments</comments>
		<pubDate>Sun, 02 Nov 2008 17:06:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Proof of concepts]]></category>
		<category><![CDATA[3D engine]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=95</guid>
		<description><![CDATA[Made a few quick mock ups for simple graphing programs using my 3D engine in Flash. Currently there is still a lot of room for improvement in speed, light angles and (invisible) shadows are being calculated which is unnecessary. Check out the applications in realtime at the read link;

The first graph is a one variable [...]]]></description>
			<content:encoded><![CDATA[<p>Made a few quick mock ups for simple graphing programs using my 3D engine in Flash. Currently there is still a lot of room for improvement in speed, light angles and (invisible) shadows are being calculated which is unnecessary. Check out the applications in realtime at the read link;</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="One dimensional graph in 3D" src="http://www.gamitude.nl/flash/graphing/1dgraph.jpg" alt="One dimensional graph in 3D" width="500" height="350" /><p class="wp-caption-text">One variable graph in 3D</p></div>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Two dimensional graph in 3D" src="http://www.gamitude.nl/flash/graphing/2dgraph.jpg" alt="Two dimensional graph in 3D" width="500" height="350" /><p class="wp-caption-text">Two variable graph in 3D</p></div>
<p><span id="more-95"></span></p>
<p>The first graph is a one variable parameterized function, displaying the following formula;</p>
<p><img src="http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&amp;eq=x%20%3D%20t" alt="x parameter" align="left" /><br />
<img src="http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&amp;eq=y%20%3D%20%5Csin(t%5Cfrac%7B%5Cpi%7D%7B45%7D)" alt="y parameter" align="center" /> <img src="http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&amp;eq=z%20%3D%20%5Ccos(t%5Cfrac%7B%5Cpi%7D%7B45%7D)" alt="z parameter" align="right" /></p>
<p>The second graph is a two variable surface graph of a modified sinc function. Two realtime examples below, move your mouse over them to rotate around the graph.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="src" value="flash/graphing/1dgraph.swf" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/graphing/1dgraph.swf" bgcolor="#000000" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="src" value="flash/graphing/2dgraph.swf" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/graphing/2dgraph.swf" bgcolor="#000000" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>Having multiple tabs open in your browser will significantly impact performance, so view in one tab before criticizing the frame rate! Once I get the dynamic text at points done there can be scales and titles for the axisses as well. And prepare for a few more very interesting demos soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>V0.65 &#8211; Shadows in 3D!</title>
		<link>http://www.functionblog.com/?p=90</link>
		<comments>http://www.functionblog.com/?p=90#comments</comments>
		<pubDate>Sat, 01 Nov 2008 11:17:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[3D engine]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=90</guid>
		<description><![CDATA[Made a great lot of very usefull changes in this version. First and most basic being the addition of line and dot primitives in the rewritten frame loop. This allows for some really cool stuff you will see soon (3D graphs!). And the rewriting of the frame loop added a lot more possibilities for the [...]]]></description>
			<content:encoded><![CDATA[<p>Made a great lot of very usefull changes in this version. First and most basic being the addition of line and dot primitives in the rewritten frame loop. This allows for some really cool stuff you will see soon (3D graphs!). And the rewriting of the frame loop added a lot more possibilities for the future as well, with respect to light, shadows and glows. Checkout a realtime demo of the action after the read link.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Shadows in V0.65" src="http://www.gamitude.nl/flash/3DEngine/V065/shadow.jpg" alt="A demo of the AS3 3D Engine doing shadows, realtime demo after the read link." width="550" height="398" /><p class="wp-caption-text">A demo of the AS3 3D Engine doing shadows, realtime demo after the read link.</p></div>
<p><span id="more-90"></span></p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="src" value="flash/3DEngine/V065/test.swf" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/3DEngine/V065/test.swf" bgcolor="#000000" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>Bugfixes:</p>
<ul>
<li>Changed the frame loop to accept non-polygonal 3D objects (like lines and dots) in a better way.</li>
</ul>
<p>Known bugs:</p>
<ul>
<li>Not all rotation and translation functions for objects, rotate the vector normals and/or translate the object midpoints yet.</li>
<li>Sometimes undefined shadow faces are added to mShadowFaces, the error is now catched but still visible from time to time.</li>
<li>Some polygons are still incorrectly culled, have discovered the issue though.</li>
<li>Problem in the Z-buffering effecting relatively big differences in face sizes.</li>
<li>Cone shadows are incorrect.</li>
</ul>
<p>New features:</p>
<ul>
<li>Line primitive</li>
<li>Dot primitive (currently the size is not effected by distance)</li>
<li>Cull parameter for faces that should not be culled (planes for example)</li>
<li>Added object rotation, surface normals not yet rotating perfectly.</li>
<li>View frustum culling (very basic, still some work to be done)</li>
<li>Shadows</li>
</ul>
<p>Upcoming features:</p>
<ul>
<li>Textfields at 3D points</li>
<li>Performance increase</li>
<li>Object/face glow</li>
<li>Directional light and light with different colours</li>
<li>Roll camera movement</li>
<li>Texture perspective correction</li>
<li>Multiple cameras</li>
<li>Reflections!</li>
<li>2D primitives; planes, circles, etc.</li>
</ul>
<p>But before the next big changes I will probably upload a few nice examples of the 3D engine at work (games and graphing!). And if someone can help me understand the <a href="http://nyatla.jp/nyartoolkit/wiki/index.php?FLARToolKit" target="_blank">FLARtoolkit</a>, we might see some augmented reality with this 3D engine in flash as well! The source will be released when I feel the engine is stable enough to be released, check out earlier posts for credits to classes used with the 3D engine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=90</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>3D Engine V0.52</title>
		<link>http://www.functionblog.com/?p=77</link>
		<comments>http://www.functionblog.com/?p=77#comments</comments>
		<pubDate>Sat, 20 Sep 2008 09:05:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[3D engine]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=77</guid>
		<description><![CDATA[Made a huge leap forward the last few weeks, this version of the engine is actually quite usefull and easy for most simple 3D things. But I&#8217;m not quite ready to release source code yet there are still a few things to do, to make it more of a complete engine. Below is a demo [...]]]></description>
			<content:encoded><![CDATA[<p>Made a huge leap forward the last few weeks, this version of the engine is actually quite usefull and easy for most simple 3D things. But I&#8217;m not quite ready to release source code yet there are still a few things to do, to make it more of a complete engine. Below is a demo of what it is capable of right now;</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="src" value="flash/3DEngine/V052/test.swf" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/3DEngine/V052/test.swf" bgcolor="#000000" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>Bugfixes:</p>
<ul>
<li>Altered the 3D camera translation function to something that also works when looking down on an object.</li>
</ul>
<p>Known bugs:</p>
<ul>
<li>The triangular polygons are now textured with only two triangles, this can still be increased&#8230;</li>
<li>Focal point singularity, some 3D points that are in the focal point of the camera move to an infinite distance.</li>
<li>Some polygons are incorrectly culled.</li>
</ul>
<p>New features:</p>
<ul>
<li>Added a cylinder primitive</li>
<li>Added a cone primitive</li>
<li>Added UV mapping for all primitves; cube, sphere, cylinder and cone</li>
<li>Added 3D lighting, for the moment it will support multiple light entities with only white light</li>
<li>Added ambient lighting</li>
<li>Added 3D surface normals</li>
<li>Added colouring and texturing support for triangular polygons</li>
</ul>
<p>Upcoming features:</p>
<ul>
<li>View frustum culling</li>
<li>Performance increase</li>
<li>Directional light and light with different colours</li>
<li>Roll camera movement</li>
<li>Object rotation</li>
<li>Texture perspective correction</li>
<li>3D particles!</li>
</ul>
<p>Maybe phong shading will also be possible one day with gradients but it&#8217;s not uber important. And I thought about doing shadows with the new bitmapfilter api, but that is all still very experimental. What matters the most at the moment is creating a finished version of which I will release all the source code for free. Soon I will also post about the inner workings of a 3D engine, something that I couldn&#8217;t find (as in all info being on one page) on the interwebs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=77</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Engine V0.3</title>
		<link>http://www.functionblog.com/?p=45</link>
		<comments>http://www.functionblog.com/?p=45#comments</comments>
		<pubDate>Sat, 30 Aug 2008 09:44:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[3D engine]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=45</guid>
		<description><![CDATA[Made quite some progress lately. Got the constructSphere function up quite quickly, the UV mapping and copyPixels took a little longer but in the end really paid off:

Currently the UV mapping only works with spheres, but it will be easy to implement it into other models later. I&#8217;m quite pleased already with the performance; the [...]]]></description>
			<content:encoded><![CDATA[<p>Made quite some progress lately. Got the constructSphere function up quite quickly, the UV mapping and copyPixels took a little longer but in the end really paid off:</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="test" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="flash/3DEngine/V03/wtest.swf" /><embed id="test" type="application/x-shockwave-flash" width="550" height="400" src="flash/3DEngine/V03/wtest.swf" bgcolor="#ffffff" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>Currently the UV mapping only works with spheres, but it will be easy to implement it into other models later. I&#8217;m quite pleased already with the performance; the demo above renders 529 polygons with a high resolution texture (1350&#215;675 pixels). However there is still room for lots of improvement;</p>
<p>Bugfixes:</p>
<ul>
<li> Added function moveObject, wich if drawing faces should be used instead of moveGroup. (Otherwise the midPoints don&#8217;t move and thus making the z-sorting work incorrectly.)</li>
<li> Reversed the y transformation in the process of making 2D points from 3D coordinates, because in the flash coordinate system the y axis is reversed</li>
</ul>
<p>Known bugs:</p>
<ul>
<li>For some reason transparent bitmaps don&#8217;t work yet, I&#8217;ll have to look into the different copyPixels and beginBitmapFill functions for this one&#8230;</li>
<li>For some reason looking down from above gives a distorted and unreallistic view, I&#8217;m not sure where this problem came from.</li>
<li>Faces that have one, two or three points behind the camera are rendered ackwardly, but this will be fixed in the next version with view frustum culling.</li>
<li>The backface culling function is not perfect yet, the top of the sphere shows about 3 faces beeing culled that shouldn&#8217;t be culled.</li>
<li>The edges of UV faces are visible sometimes, this is due to the repeat parameter I use to create parts of the bitmap fill might be able to fix this with a bit of a different matrix algorithm.</li>
</ul>
<p>New features:</p>
<ul>
<li> Textures from images</li>
<li> The function moveObject to move objects</li>
<li> A debug mode</li>
<li>The sphere primitive</li>
<li>UV mapping for spheres</li>
<li>Backface culling</li>
</ul>
<p>Upcoming features:</p>
<ul>
<li> Phong shading</li>
<li> More primitives</li>
<li> View frustum culling</li>
<li> Lighting and shadows</li>
<li>Performance improvements</li>
<li>Rotate object functions</li>
<li> And a few more&#8230;</li>
</ul>
<p>The navigation is still somewhat ackward for the sake of simplicity;</p>
<ul>
<li>W,S let you move along the z-axis</li>
<li>A,D let you move along the x-axis</li>
<li>Numpad 2 and 8 let you move along the y-axis</li>
<li>Left and right arrow keys let you rotate left and right</li>
<li>Up and down arrow keys let you rotate up and down</li>
</ul>
<p>Thanks to Senocular and Lifeztream for these two classes;<br />
<a title="keyObject class" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.senocular.com');" href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/KeyObject.as">Senocular’s keyObject class &#8211; for detecting multiple keyboard presses at once</a><br />
<a title="AS3 FPS monitor" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.lifeztream.com');" href="http://www.lifeztream.com/blog/?p=97&amp;language=en">Lifeztream’s FPS class &#8211; for displaying the 3D engine performance</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Queue loader items in an AS3 class</title>
		<link>http://www.functionblog.com/?p=47</link>
		<comments>http://www.functionblog.com/?p=47#comments</comments>
		<pubDate>Mon, 25 Aug 2008 19:58:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=47</guid>
		<description><![CDATA[I wrote a class lately to queue loader items in AS3. I use it to load textures for my 3D engine but you can use it without modification for the loading of other files. The class is very simple, and doesn&#8217;t give any information about the loading progress apart from when it finishes loading all [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a class lately to queue loader items in AS3. I use it to load textures for my 3D engine but you can use it without modification for the loading of other files. The class is very simple, and doesn&#8217;t give any information about the loading progress apart from when it finishes loading all files. The class comes in handy when trying to load multiple files and have one event listener when all files are loaded. Below an example of the implementation:</p>
<p>[sourcecode language='actionscript']import qLoader; // You can change the package to for example com.input.qLoader;<br />
var loader:qLoader = new qLoader();<br />
// You can add relative file locations, but SWF&#8217;s online will likely<br />
// only accept url&#8217;s on the same domain.<br />
// You can activate debug traces by enabling the debug mode once the<br />
// class has been created by uncommenting the following line:<br />
// loader.mDebug = true;<br />
loader.addLoad(&#8221;textures/stone.jpg&#8221;);<br />
loader.addLoad(&#8221;textures/stone2.jpg&#8221;);<br />
loader.addLoad(&#8221;textures/stone3.jpg&#8221;);<br />
loader.addLoad(&#8221;textures/stone4.jpg&#8221;);<br />
loader.addLoad(&#8221;textures/stone5.jpg&#8221;);<br />
loader.addEventListener(&#8221;completeQ&#8221;,onLoaded);<br />
// Initiate the loader<br />
loader.initiate();</p>
<p>function onLoaded(evt:Event):void {<br />
// In this example I create a bitmapData object<br />
var bm:BitmapData = new BitmapData(loader.mFinishedItems["textures/stone.jpg"].width,loader.mFinishedItems["textures/stone.jpg"].height,false);<br />
bm.draw(loader.mFinishedItems["textures/stone.jpg"],new Matrix());<br />
}[/sourcecode]</p>
<p>The class needs to be an extension on the EventDispatcher class to work (otherwise it cannot dispatch events). I might update the class with progress info (like 100/4555Kb) or something and the loadNext() and loadItems() functions are the same but I&#8217;m too lazy for that now.</p>
<p><a title="qLoader.as" href="http://www.gamitude.nl/flash/qLoader/qLoader.as" target="_blank">qLoader.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=47</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bitmap skewing class</title>
		<link>http://www.functionblog.com/?p=39</link>
		<comments>http://www.functionblog.com/?p=39#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Proof of concepts]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[POCs]]></category>
		<category><![CDATA[Proof of concept]]></category>

		<guid isPermaLink="false">http://www.gamitude.nl/?p=39</guid>
		<description><![CDATA[Finally, after two days of trial and error, I got my bitmap skewing class working. The class is based upon Flash and Math&#8217;s work, especially the algorithm for &#8216;triangulating&#8217; (I know this is not the right word) distorted quadrilaterals. The class is quite complete there might be another function for simply rendering textures onto triangles [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, after two days of trial and error, I got my bitmap skewing class working. The class is based upon <a title="Flash and Math's bitmapTransformer class" href="http://www.flashandmath.com/advanced/menu3d/transformer.html" target="_blank">Flash and Math&#8217;s</a> work, especially the algorithm for &#8216;triangulating&#8217; (I know this is not the right word) distorted quadrilaterals. The class is quite complete there might be another function for simply rendering textures onto triangles instead of quadrilaterals. See the class in action below, adjust the &#8220;AA&#8221; level (I know it&#8217;s not really the same, but couldn&#8217;t think of a nicer term) to increase or decrease the level of precision. The higher the AA level the better it looks. Lower AA levels increase performance. The same counts for the noise reduction, which decreases the performance when turned on.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="skewConcept1" /><param name="bgcolor" value="#ffffff" /><param name="align" value="middle" /><param name="src" value="flash/skew/skew.swf" /><embed type="application/x-shockwave-flash" width="550" height="400" src="flash/skew/skew.swf" align="middle" bgcolor="#ffffff" name="skewConcept1"></embed></object></p>
<p>Download <a title="skew.as class" href="http://www.gamitude.nl/flash/skew/skew.as" target="_blank">the skew.as class</a></p>
<p>The usage is fairly simple;</p>
<p>[sourcecode language='actionscript']import com.skew;<br />
// First boolean is for noise reduction the second for debug mode<br />
var sk:skew = new skew(false,false);<br />
// For skews with a greater precision than 1<br />
sk.AASkew(a,b,c,d,bitmap,sp,AAh,AAv);<br />
// For skews with a precision of 1<br />
sk.transformer(a,b,c,d,bitmap,sp,AAh,AAv);<br />
// With a,b,c,d being arrays containing 2 dimensional points e.g. a = [10,10];<br />
// And bitmap being a bitmapData object<br />
// sp being a sprite or shape<br />
// AAh and AAv respectively being the horizontal and vertical &#8220;AA&#8221; levels[/sourcecode]</p>
<p>The sk.transformer function is quite an increase in performance from the sk.AASkew function because it doesn&#8217;t require mapping the non distorted bitmap.</p>
<p>EDIT: Updated the skew class with a better variable name for the smoothing parameter and corrected the skew functions to smooth both halves. Thanks to Banana.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.functionblog.com/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
