<?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>Doug McInnes &#187; Projects</title>
	<atom:link href="http://dougmcinnes.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougmcinnes.com</link>
	<description>Chuckle and Chortle</description>
	<lastBuildDate>Tue, 08 May 2012 17:13:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Zapnutter</title>
		<link>http://dougmcinnes.com/2011/08/23/zapnutter/</link>
		<comments>http://dougmcinnes.com/2011/08/23/zapnutter/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 05:51:53 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[Animation]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[center for cartoon studies]]></category>
		<category><![CDATA[squirrel]]></category>
		<category><![CDATA[zapruder]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=208</guid>
		<description><![CDATA[The animation I did for the Center for Cartoon Studies Animation for Cartoonists workshop over the course of a week during this summer. We did the whole process; coming up with ideas and workshopping them, storyboards, animatics, audio and final &#8230; <a href="http://dougmcinnes.com/2011/08/23/zapnutter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object id="squirrelzapruder" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="quality" value="high" /><param name="bgcolor" value="#ccffff" /><param name="play" value="true" /><param name="loop" value="true" /><param name="wmode" value="window" /><param name="scale" value="showall" /><param name="menu" value="true" /><param name="devicefont" value="false" /><param name="allowScriptAccess" value="sameDomain" /><param name="src" value="/wp-content/uploads/2011/08/squirrelzapruder.swf" /><embed height="360" width="640" src="/wp-content/uploads/2011/08/squirrelzapruder.swf" allowscriptaccess="sameDomain" devicefont="false" menu="true" scale="showall" wmode="window" loop="true" play="true" bgcolor="#ccffff" quality="high" align="middle" id="squirrelzapruder" type="application/x-shockwave-flash"></embed></object></p>
<p>The animation I did for the <a href="http://www.cartoonstudies.org/">Center for Cartoon Studies</a> <a href="http://www.cartoonstudies.org/index.php/2011/08/16/animation-for-cartoonists/">Animation for Cartoonists workshop</a> over the course of a week during this summer.</p>
<p>We did the whole process; coming up with ideas and workshopping them, storyboards, animatics, audio and final production. It went too fast &#8212; I miss all the great people and energy.</p>
<p>Thanks Scott and Jennifer and all the students and staff for making it a great workshop!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2011/08/23/zapnutter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML 5 Asteroids on the iPad</title>
		<link>http://dougmcinnes.com/2010/05/24/html-5-asteroids-on-the-ipad/</link>
		<comments>http://dougmcinnes.com/2010/05/24/html-5-asteroids-on-the-ipad/#comments</comments>
		<pubDate>Tue, 25 May 2010 07:29:44 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[asteroids]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=168</guid>
		<description><![CDATA[I&#8217;ve added touch controls to the HTML 5 Asteroids game that will only appear when you&#8217;re running it on an iPad.  The game will expand to fill the whole screen for maximum asteroid blasting action.  Orient your iPad in landscape &#8230; <a href="http://dougmcinnes.com/2010/05/24/html-5-asteroids-on-the-ipad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added touch controls to the HTML 5 Asteroids game that will only appear when you&#8217;re running it on an iPad.  The game will expand to fill the whole screen for maximum asteroid blasting action.  Orient your iPad in landscape fashion!</p>
<h1 style="text-align: center;"><a href="http://dougmcinnes.com/html-5-asteroids/">Play It!</a></h1>
<p> </p>
<p>There are a couple caveats (warning some nerdy content ahead):</p>
<h4>Tunneling Effect</h4>
<p>On the iPad the game runs at around 22 frames per second at its peak, not nearly as good as around 40 on a laptop, though it is enough for gameplay even if it can get choppy at times when there&#8217;s a lot of stuff whizzing around.</p>
<p>Unfortunately I&#8217;m only testing for collisions when the objects are rendered so it&#8217;s quite possible with lower framerates to have a bullet flying out of your ship first get rendered on one side of the asteroid you&#8217;re trying to pulverize and in the next frame get rendered on the other side letting it sail undamaged into your ship.  This is called the tunneling effect.  This is not a problem on a laptop or desktop because the framerates are high.  Since we&#8217;re sampling less per second (~22 verses ~40) a moving object is drawn less times though it&#8217;s traveling the same distance.  In other words if an asteroid travels from the top of the screen to the bottom of the screen in one second, on your computer it will most likely get drawn 40 times during that trip and on an iPad it will get drawn only 22 times leaving larger gaps between the drawings.  These larger gaps leave more of a chance for things to slip through and not collide when your eyes say they should have.</p>
<p>I&#8217;m considering augmenting the collision detection to remove the tunneling effect but it will need extra math which means slower framerates, at least initially.  It might be a better use of my time to pump framerates up.</p>
<h4>Buggy Touch Events</h4>
<p>There&#8217;s a bug with the iPad&#8217;s implementation of touch events in Javascript: if you have two fingers on the screen and raise one of them, a &#8220;touchend&#8221; event gets fired containing a reference to both fingers even though the second one hasn&#8217;t been raised.  If you then raise the second one, a &#8220;touchend&#8221; event is not fired.</p>
<p>It drove me nuts trying to figure this out and I haven&#8217;t been able to  work around it.</p>
<p>What this means for the game is that using two fingers at the same time will get frustrating fast as the control you&#8217;re holding down will stop working periodically.  I suggest tapping for the best experience instead of holding.</p>
<p>Oh, this does not happen on the iPhone in case you were wondering, it works as expected! I have sent a bug report to apple (with a <a href="/wp-content/uploads/2010/05/test.html">sample html page</a>) and hopefully they already have a fix that&#8217;s not available yet or they will fix it for a future release.</p>
<p>On a side note, why aren&#8217;t Apple&#8217;s bug lists searchable by the public?  They must get reams of dupes.</p>
<ol> </ol>
<p>In any case, let me know how it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2010/05/24/html-5-asteroids-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML 5 Asteroids</title>
		<link>http://dougmcinnes.com/2010/05/12/html-5-asteroids/</link>
		<comments>http://dougmcinnes.com/2010/05/12/html-5-asteroids/#comments</comments>
		<pubDate>Thu, 13 May 2010 06:42:31 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[asteroids]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=126</guid>
		<description><![CDATA[For some months I&#8217;ve been playing around with HTML 5&#8242;s Canvas element because I was curious about it, especially after seeing it run Flash.  I hacked at it for a while then realized I had produced an Asteroids game. Play &#8230; <a href="http://dougmcinnes.com/2010/05/12/html-5-asteroids/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">For some  months I&#8217;ve been playing around with HTML 5&#8242;s Canvas element because I was curious about it, especially after <a href="http://wiki.github.com/tobeytailor/gordon/">seeing it run Flash</a>.  I hacked at it for a  while then realized I had produced an Asteroids game.<img class="size-full wp-image-132 alignright" title="asteriods" src="http://dougmcinnes.com/wp-content/uploads/2010/05/asteriods.png" alt="" width="171" height="134" /></p>
<h1 style="text-align: center;"><a title="Play It!" href="/html-5-asteroids/">Play It!</a></h1>
<p style="text-align: left;"> </p>
<p style="text-align: left;">The source code is <a href="http://github.com/dmcinnes/HTML5-Asteroids">up on GitHub</a>!</p>
<p style="text-align: left;">The <a href="https://developer.mozilla.org/en/Canvas_tutorial">Canvas</a> element is super cool.  Basically all of the sprites in the game are simple paths defined by an array of points.  These points are translated, rotated and scaled based on their state at any given point in the game using the standard Canvas transformations.  Plus it gives it a nice retro feel.</p>
<p style="text-align: left;">Let me know what you think!</p>
<p style="text-align: left;">Here&#8217;s some cool links to things that helped me out with the game:</p>
<ul style="text-align: left;">
<li><a href="http://www.alienryderflex.com/polygon/">Determining Whether A Point Is Inside A Complex Polygon</a>.  Firefox does the wrong thing when it comes to isPointInPath(), the main Canvas method I used for collision detection; It doesn&#8217;t apply the current transformations before determining if there&#8217;s been a collision (and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405300">they won&#8217;t fix it</a> for some reason).  I implemented this method to get around the problem but it works fast enough it could be used on all browsers.</li>
<li><a href="http://www.metanetsoftware.com/">Metanet Software</a>, the makers of the awesome flash game <a href="http://www.thewayoftheninja.org/n.html">N</a>, have made a couple of extremely useful <a href="http://www.metanetsoftware.com/technique.html">tutorials on collision detection</a>.  These describe some of the techniques I used in the game, in particular the grid based broad-phase they describe in their second tutorial.</li>
<li>I used <a href="http://typeface.neocracy.org/">typeface.js</a> &#8216;s <a href="http://typeface.neocracy.org/fonts.html">convert tool</a> to convert the awesome <a href="http://www.dafont.com/vector-battle.font">Vector Battle</a> font into some JSON point data that could be easily used in the canvas.  Typeface.js is a neat library for easily embedding arbitrary fonts in the page.  On supported browsers it creates small canvas elements and renders the font inside based on the CSS.  I borrowed bits from the library to get the font rendering.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2010/05/12/html-5-asteroids/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>LED Flowerpot</title>
		<link>http://dougmcinnes.com/2008/04/10/led-flowerpot/</link>
		<comments>http://dougmcinnes.com/2008/04/10/led-flowerpot/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 06:29:54 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=8</guid>
		<description><![CDATA[The LED Flowerpot! This is a little project I built as a gift for the Wife for the combined 5-year being together anniversary/Valentine&#8217;s Day. I did most of the work on the weekends, soldering and gluing in the back yard &#8230; <a href="http://dougmcinnes.com/2008/04/10/led-flowerpot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href='http://dougmcinnes.com/wp-content/uploads/2008/03/fp1.jpg'><img src="http://dougmcinnes.com/wp-content/uploads/2008/03/fp1.jpg" alt="" title="LED Flowerpot" width="224" height="300" class="alignleft size-medium wp-image-13" /></a></p>
<p><strong>The LED Flowerpot!</strong></p>
<p>This is a little project I built as a gift for the Wife for the combined 5-year being together anniversary/Valentine&#8217;s Day.  I did most of the work on the weekends, soldering and gluing in the back yard out of sight from prying wifey eyes.</p>
<p>The circuit is not terribly complicated, it&#8217;s a modified version of Wilf Rigter&#8217;s <a href="http://www.solarbotics.net/library/circuits/bot_ornament_qlf.html">Quad LED Fader</a> circuit (specifically <a href="http://www.solarbotics.net/library/circuits/pix/QLF6.gif">QLF6</a>) I found on the <a href="http://www.solarbotics.net/">BEAM robotics community server</a>.  It uses a <a href="http://library.solarbotics.net/pieces/parts_elect_ic.html#74x14">74C14</a> Schmitt triggered inverter chip as a bank of five oscillators fed into a <a href="http://www.national.com/mpf/LM/LM339.html">LM339</a> quad comparator to generate four slow wave forms to drive four banks of LEDs.  The 74C14 was provided by my good friend and chip dealer, Mr. Bunt.  The major addition I made to the circuit was a voltage regulator to change its power supply to use a wall wart scavenged from a defunct answering machine that I haven&#8217;t seen in years.  A 9-volt battery, its package being the ideal size to fit in the flowerpot base, unfortunately drained quickly with the number of LEDs I wanted to use.</p>
<p><a href='http://dougmcinnes.com/wp-content/uploads/2008/03/fp_int.jpg'><img src="http://dougmcinnes.com/wp-content/uploads/2008/03/fp_int.jpg" alt="Rat\&#039;s Nest!" title="Interior of LED Flowerpot" width="224" height="300" class="alignright size-medium wp-image-12" /></a></p>
<p>Soldering the circuit itself onto the prototype board wasn&#8217;t much of a chore but as you can see, I do needs me some practice at circuit layout.  The most irritating thing was wiring up all the LEDs.  There&#8217;s 34 of the little buggers and each one had to be hot glued in and wired up to their brethren and the circuit.  The result of which is the rat&#8217;s nest you see before you.  I only have black wire, OK?</p>
<p>The prototype board rests on the sides of the pot, stuffed down below the &#8220;dirt&#8217;s&#8221; surface.  The surface itself is made from a round cut from a cheap cutting board that was too crappy to actually use as a cutting board.  Scraps left over from the same were hot glued to the sides of the pot to hold the surface at the desired depth.</p>
<p><a href='http://dougmcinnes.com/wp-content/uploads/2008/03/fp_close.jpg'><img src="http://dougmcinnes.com/wp-content/uploads/2008/03/fp_close.jpg" alt="" title="Closeup of LED Flowerpot" width="300" height="225" class="alignleft size-medium wp-image-11" /></a></p>
<p>The LEDs were hotglued into position before being wired up for action.  First I had to make holes in the cutting board round to stuff the LEDs through.  I originally intended to use a drill to create the holes, but quickly found that my smallest drill bit opened cavernous orifices compared to the width of the leads on your average LED.  In the end I used a needle heated with a lighter to pierce the holes.  Not only was the pierced diameter perfectly suited for LED leads, I found the process of holing plastic with a glowing-hot needle extremely satisfying for some strange reason.  It did take a while though.</p>
<p>After the LEDs were in place and the circuit was working, the next step was to decorate the &#8220;dirt&#8221;.  I used soil-colored foam turf I found at a model railroad store along with &#8220;scenic cement&#8221; to fix it in place.  The added details were bits of bark and very small rocks I found in our real plant pots and about the yard; without them the scene didn&#8217;t look terribly realistic.  Not that LEDs sprouting out of a fine soil-filled pot is firmly grounded in reality or anything.</p>
<p><a href='http://dougmcinnes.com/wp-content/uploads/2008/03/fp_bottom.jpg'><img src="http://dougmcinnes.com/wp-content/uploads/2008/03/fp_bottom.jpg" alt="" title="LED Flowerpot Bottom" width="224" height="300" class="alignright size-medium wp-image-10" /></a></p>
<p>When I turned from using a 9V battery fueling the circuit to a wall wart, I had intended to drill a hole in the side of the pot near the bottom to pass the power cable through.  After a couple of attempts, the near hideous scratching of the pot&#8217;s green glaze and a paralyzing fear of causing it to shatter I decided to use the pot&#8217;s drain hole as mother natured intended.  Its hole-ness beckoned to me.  Besides the socket I had fit almost perfectly.  Unfortunately the pot can&#8217;t rest on its base anymore; it requires I use a stand as you see in the first picture.  The current stand is a opened leatherman knock-off because it was the first thing I had on hand that fit the bill.  It was a poor knock-off so it makes a better stand anyway.</p>
<p>Since pictures don&#8217;t show off its glow-y goodness, here&#8217;s a video I took of it doing its thing (in the dark so you can see it better):</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/KOVsKV1baBs"></param> <embed src="http://www.youtube.com/v/KOVsKV1baBs" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p>So where did I get the idea to do this?  I was playing around with the circuit on a breadboard and a little garden of LEDs glowing and fading in and out when the wife came by and said &#8220;Ooooo! Mushrooms!&#8221;.  The idea for the finished product was a short hop away from there.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2008/04/10/led-flowerpot/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

