<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Mikko Haapoja's Blog</title>
	
	<link>http://www.mikkoh.com/blog</link>
	<description />
	<lastBuildDate>Wed, 31 Mar 2010 16:22:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MikkoHaapoja" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="mikkohaapoja" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Jam3 R&amp;D and FITC Toronto</title>
		<link>http://www.mikkoh.com/blog/2010/03/jam3-rd-and-fitc-toronto/</link>
		<comments>http://www.mikkoh.com/blog/2010/03/jam3-rd-and-fitc-toronto/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 16:16:14 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=428</guid>
		<description><![CDATA[I just realized I had made no mention of it here, but for the past few months the guys here at Jam3 have allowed me to go on a research period.
During that time the Voxel Engine/Fancy Engine has grown in leaps and bounds. I&#8217;ve been documenting the process at: http://labs.jam3.ca/
Here&#8217;s a quick video of something [...]]]></description>
			<content:encoded><![CDATA[<p>I just realized I had made no mention of it here, but for the past few months the guys here at <strong>Jam3</strong> have allowed me to go on a <strong>research period</strong>.</p>
<p>During that time the <strong>Voxel Engine/Fancy Engine</strong> has grown in leaps and bounds. I&#8217;ve been documenting the process at: <a href="http://labs.jam3.ca/" target="_blank"><strong>http://labs.jam3.ca</strong>/</a></p>
<p>Here&#8217;s a quick video of something I&#8217;ve made with the Fancy Engine:<br />
<object width="420" height="236"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9866422&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9866422&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="420" height="236"></embed></object></p>
<p>If you want to see more stuff like that video go and check out: <a href="http://labs.jam3.ca/" target="_blank"><strong>http://labs.jam3.ca/</strong></a></p>
<p>On another note I&#8217;ve been invited to speak at <a href="http://www.fitc.ca/events/about/?event=102"><strong>FITC Toronto</strong></a> during the <a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=102&#038;presentation_id=1183" target="_blank"><strong>&#8220;Cool Shit Hour&#8221;</strong></a>. I&#8217;m stoked to show off some stuff that hasn&#8217;t been shown yet there.</p>
<p>Also I got some great news saying I&#8217;m a finalist for <strong>Best Canadian Developer</strong> at the FITC awards. The crazy thing is I have no idea who nominated me but thanks to whoever did.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/p3vTTr1bJx4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2010/03/jam3-rd-and-fitc-toronto/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2010!!!</title>
		<link>http://www.mikkoh.com/blog/2010/01/2010/</link>
		<comments>http://www.mikkoh.com/blog/2010/01/2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:28:20 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=415</guid>
		<description><![CDATA[Well 2010 rolled around and I decided to update wordpress. Lost some posts but looks like I got them up again. Phiew!!! I had lost all my posts from 2009.
On another note I want to show you some &#8220;real work&#8221; I&#8217;ve done in 2009:
AUTOTOPSY- CLICK HERE TO VISIT THE SITE
Autotopsy was an interesting project. I [...]]]></description>
			<content:encoded><![CDATA[<p>Well 2010 rolled around and I decided to update wordpress. Lost some posts but looks like I got them up again. Phiew!!! I had lost all my posts from 2009.</p>
<p><strong>On another note I want to show you some &#8220;real work&#8221; I&#8217;ve done in 2009:</strong></p>
<p><a href="http://crash-and-burn.com/autotopsy.html"><strong>AUTOTOPSY- CLICK HERE TO VISIT THE SITE</strong></a><br />
<strong>Autotopsy</strong> was an interesting project. I think it&#8217;s the first website I&#8217;ve completed and haven&#8217;t <strong>hated</strong> when I finished. It generally takes me about three to four months to like a site I&#8217;ve built after I&#8217;m done building it. I guess when you look at something day in day out after awhile all the <strong>problems/issues</strong> with a site start bugging you. This wasn&#8217;t the case with this site. I just wanted to keep on <strong>improving</strong> it. We literally launched the site and then for a few weeks I was updating and improving the site.</p>
<p>Some things to look out for in this site are the <strong>tracked buttons</strong> with the movie. I actually wrote a parser for After Effects data that reads in tracking data and positions the buttons accordingly. Also check out the <strong>Papervision 3d map</strong>. The map has quite a bit of <strong>2d/3d trickery</strong> going on.</p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyPreloader.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Autotopsy Preloader" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyPreloader.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyTruck.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Trucker" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyTruck.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyMap.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Papervision Map" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/autoTopsyMap.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://waterlife.nfb.ca/"><strong>WATERLIFE- CLICK HERE TO VISIT THE SITE</strong></a><br />
<strong>Waterlife</strong> was a huge undertaking. In the begining of the project it was me and<strong> Aaron Morris</strong> working on this site. (I was working on the main core of the site and Aaron was working on the content pages) I think by the end of the project almost everyone here at <strong>Jam3</strong> had, had their hand in this project. The hard work paid off since Waterlife has won a <strong>LOT of awards</strong> and got some <strong>great feedback</strong> from everyone. We also presented this site with <strong>Adrian</strong> and <strong>Pablo</strong> at <strong>FlashInTo</strong> (local Flash usergroup). It was my first time talking about my work and I&#8217;d have to say I enjoyed it.</p>
<p>Some things to watch for in this site are the <strong>Papervision Particle effects</strong> and the <strong>wave nav</strong>.</p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifePreloader.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Waterlife Preloader" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifePreloader.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeMap.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Waterlife Map" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeMap.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeSkull.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Skull Particle" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeSkull.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeBeluga.jpg" target="_blank"><img class="alignnone size-medium wp-image-367" title="Beluga Content Page" src="http://www.mikkoh.com/blog/wp-content/uploads/2009/12/waterLifeBeluga.jpg" alt="pixelbenderparticles" width="550" height="265" /></a></p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/E10OCK0YhLY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2010/01/2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>House Of Cards</title>
		<link>http://www.mikkoh.com/blog/2009/09/house-of-cards/</link>
		<comments>http://www.mikkoh.com/blog/2009/09/house-of-cards/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 03:15:43 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Code Libraries]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=385</guid>
		<description><![CDATA[<script type="text/javascript" src="http://www.mikkoh.com/blog/wp-includes/js/jquery/jquery.js"></script><script type="text/javascript" src="http://www.mikkoh.com/blog/wp-content/plugins/pb-embedflash/js/sbadapter/shadowbox-jquery.js"></script><script type="text/javascript" src="http://www.mikkoh.com/blog/wp-content/plugins/pb-embedflash/js/shadowbox.js"></script><script type="text/javascript"><!--
window.onload = function() {var options ={assetURL:'',loadingImage:'http://www.mikkoh.com/blog/wp-content/plugins/pb-embedflash/css/images/loading.gif',flvPlayer:'http://www.mikkoh.com/blog/wp-content/plugins/pb-embedflash/swf/mediaplayer.swf',animate:true,animSequence:'wh',overlayColor:'#000',overlayOpacity:0.85,overlayBgImage:'http://www.mikkoh.com/blog/wp-content/plugins/pb-embedflash/css/images/overlay-85.png',listenOverlay:true,autoplayMovies:true,showMovieControls:true,resizeDuration:0.35,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:'default',viewportPadding:20,handleLgImages:'resize',initialHeight:160,initialWidth:320,enableKeys:true,keysClose:['c', 'q', 27],keysPrev:['p', 37],keysNext:['n', 39],handleUnsupported:'',text: {cancel:'Cancel',loading: 'loading',close:'<span class="shortcut">C</span>lose',next:'<span class="shortcut">N</span>ext',prev:'<span class="shortcut">P</span>revious',errors:{single: 'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared: 'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either: 'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}}};Shadowbox.init(options);}
--></script>(Please open the article to see the flash file or player.)
Ok&#8230; So I wanted to post the animation from the House of Cards video running through my voxel engine but then I realized the data was way too huge for someone to wait to download.
I&#8217;ll maybe optimize the file size of the data and put [...]]]></description>
			<content:encoded><![CDATA[<p><small>(Please open the article to see the flash file or player.)</small></p>
<p>Ok&#8230; So I wanted to post the animation from the <b>House of Cards</b> video running through my voxel engine but then I realized the data was way too huge for someone to wait to download.</p>
<p>I&#8217;ll maybe optimize the file size of the data and put it up later. I have it running locally at 30fps on my Mac. (which I got maybe a month ago) 30fps per second is not too bad. </p>
<p>But for now since I couldn&#8217;t post the animation I figured the next best thing would be to post one frame. However I didn&#8217;t want to just show one frame and that&#8217;s it. I&#8217;m also going to show off something I wrote over the weekend&#8230; I added in a <b>Point Light</b> into the Voxel Engine. The light is calculated by <b>Pixel bender</b>. Pixel bender was a perfect option for this considering the amount of points in these models.</p>
<p>Oh yeah if you&#8217;re wondering the red light flickers because I&#8217;m randomizing it&#8217;s &#8220;strength&#8221; every frame.</p>
<p>Hope you enjoy this and soon hopefully I can post some source code here.</p>
<p>I just want to have the source code nice and neat and commented before I put something up.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/FiKP-Ro36Dk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/09/house-of-cards/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Voxels In Flash Continued</title>
		<link>http://www.mikkoh.com/blog/2009/07/voxels-in-flash-continued/</link>
		<comments>http://www.mikkoh.com/blog/2009/07/voxels-in-flash-continued/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 21:26:34 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Code Libraries]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=347</guid>
		<description><![CDATA[(Please open the article to see the flash file or player.)
Click on the image to preview the experiment
Ok let me try to explain what that above is. Basically the above thing is actually 22,977 3D particles forming a 3d model of Noodle From the Gorillaz. So instead of using vertices and tri&#8217;s instead this entire [...]]]></description>
			<content:encoded><![CDATA[<p><small>(Please open the article to see the flash file or player.)</small><br />
Click on the image to preview the experiment</p>
<p>Ok let me try to explain what that above is. Basically the above thing is actually <b>22,977 3D particles</b> forming a 3d model of Noodle From the Gorillaz. So instead of using vertices and tri&#8217;s instead this entire model is being built by pixels.<span id="more-347"></span></p>
<p><b>Inspiration</b><br />
I was goofing around a bit with Pixel Bender just seeing what it can do with particles. Through some experimentation I came up with this.</p>
<p><small>(Please open the article to see the flash file or player.)</small></p>
<p>The above is <strong>30,000 particles</strong>. The particles are stagnant however I pass in 6 points into a <strong>Pixel Bender Shader</strong> that affect these particles. Basically those points are just pushing and pulling particles. One of the points being your mouse. The area that is green is actually the particles being affected by your mouse however the particles under your mouse also get affected by the 5 other points moving around on the screen therefore the green area is rarely under your mouse.</p>
<p>Ok so enough about that experiment. I looked at that and I just thought it looked beautiful in the areas where a lot of particles were clumping up. It brought back memories of previous experiments I had done with 3d Particles.</p>
<p>Immediately I started thinking I wonder if there are &#8220;Voxel Modelers&#8221; out there that could give me a map of how to lay out these 3d Pixels to form a larger model.</p>
<p><b>Tools</b><br />
I actually did find a few voxel modelers but they were all paid apps. I was looking for something that was free and could spit out an XML file representing a Voxel Model.</p>
<p>I eventually did find a neat set of tools created by <a href="http://advsys.net/ken/download.htm"><b>Ken Silverman</b></a>.</p>
<p>To be honest when I hit his site I almost got discouraged thinking I wouldn&#8217;t find anything there since the site looked so outdated. <img src='http://www.mikkoh.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  But if there&#8217;s one thing I&#8217;ve found in Flash Development sometimes old ideas are actually new ideas.</p>
<p>So I did find two very neat tools there: <a href="http://advsys.net/ken/slab6.zip"><b>Slab6</b></a> and <a href="http://advsys.net/ken/poly2vox.zip"><b>Poly2Vox</b></a>.</p>
<p><b>Slab6</b> is an actual voxel modeling tool. I haven&#8217;t quite figured out the ins and outs of the tool but it&#8217;s all good. But in this tool you can basically move around Voxels. Essentially paint 3d Models pixel by pixel.</p>
<p>Being able to paint voxels is great but sometimes you just want to take an existing model and convert it to voxels and that is what <b>Poly2Vox</b> does. It&#8217;s a neat app&#8230;</p>
<p><b>Found the tools now what?</b><br />
As I said above I found the tools I needed. But neither of them did exactly what I wanted&#8230; Neither of them spit out XML files but they did spit out binary files. Luckily <b>Ken</b> had given specifications for these files so I could quite easily parse them in Flash and display them.</p>
<p><b>Hurdles</b><br />
As with any 3d applications one of my biggest hurdles was ZSorting. I first created a sort function that sorted out all the ZPositions of the model however my app came to screeching slow speed of 2fps.</p>
<p>Luckily with some inspiration from <b>Martin Munoz</b> from <b>Jam3</b> we were able to come up with a solution. He had implemented a ZBuffer using the Vector class in Flash. A ZBuffer essentially just takes the 2d position of every pixel and checks to see if for that position the Voxel with the largest (or smallest) Z position is drawn there. The problem with the Vector implementation was that clearing out the ZBuffer was quite slow. So I took his concept and implemented a ZBuffer using BitmapData so all we would need to do is do a BitmapData.fillRect to clear out the ZBuffer.</p>
<p><b>Source</b><br />
I guess all of this would make more sense if you could see the source code. I think I will eventually release the source code if people are interested in it. For now though I&#8217;ll keep it to myself til I&#8217;ve had a chance to clean things up a bit and optimize it more.</p>
<p><b>So what is this good for</b><br />
Because essentially Voxel models are just particles you can take the particles and do anything with them. For example to explode a model is very easy. Or to morph from one model to another it shouldn&#8217;t be too hard.</p>
<p><b>Here is another example:</b><br />
<small>(Please open the article to see the flash file or player.)</small></p>
<p>If you have questions feel free to write them below. I&#8217;ll try to explain your questions in my next post.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/_yZD33ljKG8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/07/voxels-in-flash-continued/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Latest Experiment</title>
		<link>http://www.mikkoh.com/blog/2009/07/latest-experiment/</link>
		<comments>http://www.mikkoh.com/blog/2009/07/latest-experiment/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 23:54:28 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=339</guid>
		<description><![CDATA[Just wanted to do a quick post showing some stuff I&#8217;ve been goofing around with.
Click on the link to see the experiment-

I&#8217;ll try to explain more later. I know it&#8217;s been awhile since I posted anything and it&#8217;s with good reason. Trust me. 
]]></description>
			<content:encoded><![CDATA[<p>Just wanted to do a quick post showing some stuff I&#8217;ve been goofing around with.</p>
<p>Click on the link to see the experiment-<br />
<a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/07/voxelexperiment.swf" target="_blank"><img src="http://www.mikkoh.com/blog/wp-content/uploads/2009/07/voxelexpiremtn.jpg" alt="Noodles in Voxels" /></a></p>
<p>I&#8217;ll try to explain more later. I know it&#8217;s been awhile since I posted anything and it&#8217;s with good reason. Trust me. </p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/0UScHN8mkdY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/07/latest-experiment/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>FITC Banner Contest (I WON)</title>
		<link>http://www.mikkoh.com/blog/2009/04/fitc-banner-contest-i-won/</link>
		<comments>http://www.mikkoh.com/blog/2009/04/fitc-banner-contest-i-won/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:48:01 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=331</guid>
		<description><![CDATA[Really? I couldn&#8217;t believe it myself I never win at anything. I don&#8217;t drink a lot of coffee but I&#8217;ve gotten 3-4 roll up the rim cups in the past while and haven&#8217;t won once (Canadians will know what that means) But this time around I won the grand prize for the creative contest for [...]]]></description>
			<content:encoded><![CDATA[<p>Really? I couldn&#8217;t believe it myself I never win at anything. I don&#8217;t drink a lot of coffee but I&#8217;ve gotten 3-4 roll up the rim cups in the past while and haven&#8217;t won once (Canadians will know what that means) But this time around I won the grand prize for the <a href="http://www.fitc.ca/contest/toronto/2009/">creative contest for FITC</a>.</p>
<p><strong>Go ahead click the link below to see the banner but realize that when you enter in your idea it will actually get Twittered:</strong><br />
<a href="http://www.mikkoh.com/freeYourIdea/" target="_blank"><img src="http://www.mikkoh.com/blog/wp-content/uploads/2009/04/bannerscreengrab.jpg" alt="FITC 09 Creative Contest Banner" /></a><br />
<span id="more-331"></span><br />
The theme for the conference (FITC Toronto) is <strong>&#8220;outside the lines&#8221;</strong> and my concept is about escaping &#8220;outside the lines&#8221; and how your ideas escape outside the lines.</p>
<p>From a <strong>technical stand point</strong> there are <strong>2600 particles</strong> moving around plus your idea particle. I had this banner running with more particles but decided to lower the amount just in case someone is viewing it on a somewhat crappy computer. After all it is a banner and everyone should HAVE to view banners right?</p>
<p><strong>Collision detection</strong> is quite simple again to keep the banner running smoothly. There is actually one <strong>BitmapData</strong> that is the <strong>&#8220;collision map&#8221;</strong>. Basically it&#8217;s the FITC logo just in green and the negative space is all transparent. Each particle will check if it&#8217;s in the green area. If it goes outside the green area it will just change direction. So when your idea starts bouncing around and exploding the lines all I am doing is drawing more green onto the collision map to make the area where the particles can move bigger.</p>
<p>If you have any more questions feel free to write a comment below. Oh and if you&#8217;re going to <strong>FITC Toronto</strong> let me know, maybe I&#8217;ll see you there.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/ZYFe5Hi4ucA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/04/fitc-banner-contest-i-won/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Interactive FlarToolkit (reacting to translation and rotation)</title>
		<link>http://www.mikkoh.com/blog/2009/03/interactive-flartoolkit-transformations-from-the-transformation-matrix/</link>
		<comments>http://www.mikkoh.com/blog/2009/03/interactive-flartoolkit-transformations-from-the-transformation-matrix/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 19:07:45 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Code Libraries]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=281</guid>
		<description><![CDATA[(Please open the article to see the flash file or player.)
This example uses this marker print it out or navigate to this url on your Iphone/Ipod.
(I&#8217;ll explain why I&#8217;m using this marker below)
Download the source code here
This is my newest experiment in the realm of FlarToolkit.
Here&#8217;s what you should look for. If you turn the [...]]]></description>
			<content:encoded><![CDATA[<p><small>(Please open the article to see the flash file or player.)</small></p>
<p><strong>This example uses <a href="http://pv3d.googlecode.com/files/PMarker.pdf">this marker</a> print it out or navigate to this <a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/03/pmarker.jpg">url on your Iphone/Ipod</a>.<br />
(I&#8217;ll explain why I&#8217;m using this marker below)</strong></p>
<p><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/03/flartoolkittransformations.zip"><strong>Download the source code here</strong></a></p>
<p>This is my newest experiment in the realm of FlarToolkit.</p>
<p>Here&#8217;s what you should look for. If you turn the marker upside down the <strong>mouth goes green</strong> when you move the marker around the <strong>tongue moves</strong> in the mouth. Also I&#8217;ve tried to implement <strong><a href="http://saqoosha.net/en/2009/01/08/1676/">Saqoosha&#8217;s hole in the marker effect</a></strong>. Oh and the mouth eases into the rotation and position of where it should be (just looks more smooth).<span id="more-281"></span></p>
<p>So how is this all done-</p>
<p>In my previous examples I&#8217;ve been using the FlarToolkit <strong>FLARBaseNode</strong> container class and basically getting the transformation matrix from the <strong>FLARSingleMarkerDetector</strong> and applying it to the <strong>FLARBaseNode</strong>. (almost everyone is doing this I think)</p>
<p>Well this is cool but what if you want to find out how much you&#8217;re going to rotate or translate your object by. Well I started digging around to figure out how I could get this information from the transformation matrix and so I started looking in the <strong>FLARBaseNode</strong> and seeing what the <strong>setTransformMatrix</strong> does.</p>
<p>Without boring you I discovered all it does is convert the FlarToolkit transformation matrix to a Papervision transformation matrix. Simple enough&#8230; From here it wasn&#8217;t too tough to get all the transformations out.</p>
<p>The following gets the translation and rotation of the object in my example-</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> mat<span style="color: #000000; font-weight: bold;">:</span>Matrix3D = <span style="color: #0033ff; font-weight: bold;">new</span> Matrix3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
mat.n11 =  trans.m01; mat.n12 =  trans.m00; mat.n13 =  trans.m02; mat.n14 =  trans.m03;
mat.n21 = <span style="color: #000000; font-weight: bold;">-</span>trans.m11; mat.n22 = <span style="color: #000000; font-weight: bold;">-</span>trans.m10; mat.n23 = <span style="color: #000000; font-weight: bold;">-</span>trans.m12; mat.n24 = <span style="color: #000000; font-weight: bold;">-</span>trans.m13;
mat.n31 =  trans.m21; mat.n32 =  trans.m20; mat.n33 =  trans.m22; mat.n34 =  trans.m23;
&nbsp;
obPosition=<span style="color: #0033ff; font-weight: bold;">new</span> Number3D<span style="color: #000000;">&#40;</span>mat.n14, mat.n24, mat.n34<span style="color: #000000;">&#41;</span>;
obRotation=Matrix3D.matrix2euler<span style="color: #000000;">&#40;</span>mat<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>The first part of the code where we are setting <strong>mat.n11, mat.n12, and so on</strong> we are converting the Flartoolkit transformation matrix to be a Papervision transformation matrix.</p>
<p><strong>obPosition</strong> and <strong>obRotation</strong> are <strong>Number3d</strong> objects so they will contain three values x,y,z. obPosition contains the x, y, z position of where the object should be according to the marker and obRotation contains the x,y,z rotation of the object.</p>
<p>I&#8217;d have to admit this isn&#8217;t the coolest example but it was something I could whip up quickly. On another note oddly enough the day after I was almost finished this I actually did get the stomach flu so beware of this example you may catch it too.</p>
<p>Thanks to <a href="http://www.eightlines.com/blog/">Brent Marshall (Eightlines)</a> (he&#8217;s from Toronto too) for telling me about the <strong>Matrix3D.matrix2euler</strong> function.</p>
<p>Oh yeah also&#8230; The reason why I chose to use the marker mentioned above is that <a href="http://pv3d.org/">John Lindquist</a> is running a <a href="http://forum.papervision3d.org/viewtopic.php?f=21&#038;t=35">flartoolkit contest</a> and this is the pattern of choice for the contest. (not saying I&#8217;m entering this one in for sure but I figure people will have this marker)</p>
<p><strong>Another thing I discovered is that once and awhile FlarToolkit throws an through the following:</strong></p>
<p>	at org.libspark.flartoolkit.core.pickup::FLARDynamicRatioColorPatt_O3/updateExtpat()[FLARDynamicRatioColorPatt_O3.as:450]<br />
	at org.libspark.flartoolkit.core.pickup::FLARDynamicRatioColorPatt_O3/pickFromRaster()[FLARDynamicRatioColorPatt_O3.as:333]<br />
	at org.libspark.flartoolkit.detector::FLARSingleMarkerDetector/detectMarkerLite()[FLARSingleMarkerDetector.as:179]</p>
<p>I asked Saqoosha about this and he said he&#8217;s seen it happen too but has no idea why. Just so your aware if you see it happening to you it&#8217;s a known bug.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/ddpJ4lsrW-g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/03/interactive-flartoolkit-transformations-from-the-transformation-matrix/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Your Models Into Papervision The Other Way</title>
		<link>http://www.mikkoh.com/blog/2009/02/your-models-into-papervision-the-other-way/</link>
		<comments>http://www.mikkoh.com/blog/2009/02/your-models-into-papervision-the-other-way/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 04:52:54 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Code Libraries]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=267</guid>
		<description><![CDATA[In my previous post I talked about how to get your 3d models from Blender using the Collada format.
There is actually yet another way to get your 3d models from Blender. Dennis Ippel has developed a Blender to Actionscript 3.0 Exporter. (it&#8217;s very cool)
Here is my first test of this exporter:
(Please open the article to [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.mikkoh.com/blog/?p=227">previous post</a> I talked about how to get your 3d models from Blender using the Collada format.</p>
<p>There is actually yet another way to get your 3d models from Blender. <strong><a href="http://www.rozengain.com/blog/2008/01/02/export-your-blender-objects-straight-to-away3d-papervision3d-and-sandy/" target="_blank">Dennis Ippel</a></strong> has developed a <strong>Blender to Actionscript 3.0 Exporte</strong>r. (it&#8217;s very cool)</p>
<p><strong>Here is my first test of this exporter:</strong><br />
<small>(Please open the article to see the flash file or player.)</small><br />
<span id="more-267"></span><br />
What&#8217;s nice about this method is that you do not have to wait/parse the Collada file. (although I think you could just embed the Collada as an XML file and just parse it immediately and not wait for it to load)</p>
<p>There is one thing I&#8217;m not sure about when it comes to the Actionscript 3 exporter from blender. I&#8217;m not 100% positive it can do animation like Collada does. (it may but I&#8217;d have to do some research to find out for sure)</p>
<p><strong>Here&#8217;s how you use the AS3 Exporter <a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/02/papervision3dmodels.zip">(before we begin download my source files)</a>:</strong></p>
<p><a href="http://www.rozengain.com/blog/2008/01/02/export-your-blender-objects-straight-to-away3d-papervision3d-and-sandy/">Install the AS3 exporter following the instructions posted here.</a></p>
<p>In Blender select your model and go into edit mode.</p>
<p>Go into face mode and hit <strong>“A”</strong> until your entire model is selected.</p>
<p>Then hit <strong>CTRL + T</strong> to triangulate your model. (turn quads into tris)</p>
<p>With your model selected go to <strong>File >> Export >> Actionscript 3.0 Class (.as)</strong></p>
<p>You do not need to set the package name but you must set the name of the class for your 3d object. (In my case my class was called HandExported)</p>
<p>After this select which 3d Package you want to export to (in our case Papervision 2.0)</p>
<p>Finally select where you want the class to be exported and hit <strong>“Export”</strong>.</p>
<p><strong>Now you&#8217;re ready to roll on the AS3 side of things.</strong><br />
This part is as easy if not easier than doing it the Collada way.</p>
<p>All you need to do is instantiate your class and pass in a material and add it to your scene.</p>
<p>If you had added in a texture in Blender just take the texture as a jpg or png and create a BitmapMaterial out of it and pass it as the material to your custom 3d Model Class on instantiation.</p>
<p><strong><a href="http://www.rozengain.com/blog/2008/01/02/export-your-blender-objects-straight-to-away3d-papervision3d-and-sandy/">Download the Actionscript 3.0 Exporter from here</a><br />
<a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/02/papervision3dmodels.zip">Download my source/example from here</a></strong></p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/uB-0UgTrpj8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/02/your-models-into-papervision-the-other-way/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>You can lick my Collada (Getting 3d models into Papervision)</title>
		<link>http://www.mikkoh.com/blog/2009/02/you-can-lick-my-collada-getting-3d-models-into-papervision/</link>
		<comments>http://www.mikkoh.com/blog/2009/02/you-can-lick-my-collada-getting-3d-models-into-papervision/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 05:51:59 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[Code Libraries]]></category>
		<category><![CDATA[Coding Conventions]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=227</guid>
		<description><![CDATA[Ok on my previous post on getting started with FlarToolkit I had a Bunch of people asking me how do you get your own models into FlarToolkit kind of like the guys at Bofswana or the guys at North Kingdom with the GE site:


Lately I&#8217;ve been learning Blender and you know I actually kind of [...]]]></description>
			<content:encoded><![CDATA[<p>Ok on my previous post on getting started with FlarToolkit I had a Bunch of people asking me how do you get your own models into FlarToolkit kind of like the guys at <a href="http://www.boffswana.com/news/?p=392">Bofswana</a> or the guys at North Kingdom with the GE site:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/NK59Beq0Sew&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/NK59Beq0Sew&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<span id="more-227"></span><br />
Lately I&#8217;ve been learning <a href="http://www.blender.org/">Blender</a> and you know I actually kind of enjoy it once you get over the wierd kinks. Although I&#8217;d have to say I enjoy working in <strong>ALL</strong> 3d apps. I started out with some free gheto 3d app, then moved onto <a href="http://www.erain.com/">Swift 3d</a> (this was before Papervision), then I did some Cinema 4d, and finally did some Maya and Zbrush stuff.</p>
<p>I really do like Maya but I&#8217;m anti software pirating now so I&#8217;m trying to figure out all the good free tools now. (I had a legal version of Maya and Zbrush at my old work)</p>
<p><strong>So without further adieu I&#8217;d like to explain why I&#8217;ve entitled this post &#8220;You can lick my Collada&#8221;.</strong></p>
<p><strong>Click on the mouth to see my first Collada export:</strong><br />
<small>(Please open the article to see the flash file or player.)</small></p>
<p>For those of you who do not know what Collada is, it&#8217;s basically just the XML representation of a 3d scene. (right click and open a Collada file in a text editor and you&#8217;ll see) Papervision has some classes to parse/show these XML 3d scenes.</p>
<p>To export from Blender as Collada.</p>
<p>In Blender Click- <strong>File >> Export >> Collada 1.4(.dae)<br />
(Note you have to have Python installed along with Blender to export Collada files)</strong></p>
<p><strong>Use the following settings for the Collada export:</strong><br />
<img src="http://www.mikkoh.com/blog/wp-content/uploads/2009/02/colladaexport.jpg" alt="colladaexport" width="168" height="319" /></p>
<p>Now to get your model into Papervision it&#8217;s super simple. <strong>(source download at bottom)</strong></p>
<p>The following lines load in my Collada file and parse it:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">mouth=<span style="color: #0033ff; font-weight: bold;">new</span> Collada<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;3dStuff/mouth.dae&quot;</span><span style="color: #000000;">&#41;</span>;
mouth.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FileLoadEvent.LOAD_COMPLETE, colladaLoaded<span style="color: #000000;">&#41;</span>;
mouth.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FileLoadEvent.COLLADA_MATERIALS_DONE, matsLoaded<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>That&#8217;s it. You actually don&#8217;t need to have the LOAD_COMPLETE event but it&#8217;s a nice to have. How Papervision loads Collada files is that it first loads and sets up the model then it goes in and loads in the Materials, hence adding the second listener for COLLADA_MATERIALS_DONE.</p>
<p>Within the COLLADA_MATERIALS_DONE listener I add the model to the scene and start a render loop. This is all you need to get Collada files in.</p>
<p>One thing to watch out for though is that the paths for your textures maybe off in your Collada file so open up your Collada file and search for your textures in my Collada file my textures are named: tongue.jpg, and mouth.jpg.</p>
<p>There should be no path in here it should just be the file name. Papervision will try to load the textures relative to where your Collada file is. So your textures should sit in the same folder as your Collada file. (to make things easy)</p>
<p><strong><a href="http://www.mikkoh.com/blog/wp-content/uploads/2009/02/papervision3dmodels.zip">Download the source code from here.</a> (this is a Flex Project)</p>
<p>The code is pretty straight forward. You may notice there is another class there called &#8220;As3ExportFromBlender.as&#8221; I&#8217;ll talk about this in my next post.</strong></p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/S9ndeSp-HxI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/02/you-can-lick-my-collada-getting-3d-models-into-papervision/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Augmented Reality Cloth</title>
		<link>http://www.mikkoh.com/blog/2009/01/augmented-reality-cloth/</link>
		<comments>http://www.mikkoh.com/blog/2009/01/augmented-reality-cloth/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 15:43:33 +0000</pubDate>
		<dc:creator>Mikko Haapoja</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Code Libraries]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.mikkoh.com/blog/?p=225</guid>
		<description><![CDATA[Back from Finland. Well&#8230; We got back a week and a bit ago but still we&#8217;re back.
Been crazy getting back into the swing of things at work again. Big projects coming to an end but there lies a big possibility of starting my first &#8220;real&#8221; Augmented Reality project which I&#8217;m pretty stoked about.
Seeing this video [...]]]></description>
			<content:encoded><![CDATA[<p>Back from Finland. Well&#8230; We got back a week and a bit ago but still we&#8217;re back.</p>
<p>Been crazy getting back into the swing of things at work again. Big projects coming to an end but there lies a big possibility of starting my first &#8220;real&#8221; Augmented Reality project which I&#8217;m pretty stoked about.</p>
<p>Seeing this video makes me want to hurry up and get these projects out of the way quick:</p>
<p><object width="400" height="302"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2883790&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=2883790&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="302"></embed></object><br /><a href="http://vimeo.com/">Augmented Reality + Cloth Simulation</a> from <a href="http://vimeo.com/saqoosha">Saqoosha</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<img src="http://feeds.feedburner.com/~r/MikkoHaapoja/~4/H9-VH__j2kM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mikkoh.com/blog/2009/01/augmented-reality-cloth/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

