<?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>100% LOADED &#187; Adventures in Code</title>
	<atom:link href="http://www.100percentloaded.com/archives/category/adventures-in-code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.100percentloaded.com</link>
	<description>Art. Design. Development.</description>
	<lastBuildDate>Thu, 08 Oct 2009 02:44:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>So, I&#8217;m obssesed with multi-touch. But who isn&#8217;t?</title>
		<link>http://www.100percentloaded.com/archives/13</link>
		<comments>http://www.100percentloaded.com/archives/13#comments</comments>
		<pubDate>Tue, 07 Aug 2007 16:01:41 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Adventures in Code]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Multi-touch]]></category>

		<guid isPermaLink="false">http://www.100percentloaded.com/?p=13</guid>
		<description><![CDATA[I&#8217;ve been thinking about multi-touch more and more these days. I believe the way we interact with computers and technology in general is about to change in a major way. I still remember the day when I saw a mouse for the first time. Being used to good-old MS-DOS, the idea that could simply point [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking about multi-touch more and more these days. I believe the way we interact with computers and technology in general is about to change in a major way. I still remember the day when I saw a mouse for the first time. Being used to good-old <a href="http://en.wikipedia.org/wiki/MS-DOS" target="_blank">MS-DOS</a>, the idea that could simply point this little &#8220;arrow&#8221; at &#8220;icons&#8221; on the screen (<a href="http://en.wikipedia.org/wiki/Windows_2.0" target="_blank">Windows 2.0</a>, I think) and make the computer do something as opposed to typing-in a 4-page essay every time was a major epiphany. This was circa 1991, and coincidentally, this was the same day I saw an <a href="http://en.wikipedia.org/wiki/Apple_macintosh" target="_blank">Apple MacIntosh Classic</a>. That in itself was yet another revelation.</p>
<p>I&#8217;ve been looking around for information on how to build a setup to do my own multi-touch and interaction experimentation. I recommend you go over to see the <a href="http://mtg.upf.edu/reactable/" title="reactable" target="_blank">reactable project</a> that the <em>&#8220;Interactive Sonic Systems&#8221;</em> team is working on at the Universitat Pompeu  	Fabra in Barcelona Spain.</p>
<p>These examples gave the idea to start out with a simple interface experiment. <strong>What if you had a circular window that you can manipulate with two fingers?</strong> Moving the touch points around would in turn move the circle, and the size of it would depend on how close or far apart your fingers are. Inside the circle you would see that part of an image or video that is <em>&#8220;behind&#8221;</em> it. It would look something like this:</p>
<p style="text-align: center"><img src="http://www.100percentloaded.com/wp-content/uploads/2007/08/twopoint_hands.jpg" title="Two-point Transformable Circle (Not my hands, by the way)" alt="Two-point Transformable Circle (Not my hands, by the way)" border="0" /></p>
<p>Building a working multi-touch table will require some fancy fabrication and a chunk of money. so, in order to not get discouraged while that part of the plan comes to fruition I&#8217;ve decided to start with the fun part, which is the software. I can always adapt it later once the hardware is done.</p>
<p>When one takes-on a fancy visualization or interaction experiment like this, I recommend you begin by working out a solid mathematical model on paper before you dive into the code. Doing this will save you countless headaches and dead-ends during the coding and will prevent you from giving up too soon. Trust me, I&#8217;ve been there. And so, here&#8217;s what we have&#8230;</p>
<p><strong><em>Problem:</em></strong> The interface consists of a circular object that is positioned exactly between two control points. The distance between their centers determines its diameter, and moving them changes both the scale and position of the circle relative to the control points.</p>
<p>This lead me to work out the following mathematical model:</p>
<p style="text-align: center"><img src="http://www.100percentloaded.com/wp-content/uploads/2007/07/twopoint_formula.gif" alt="Two-point Model" /></p>
<p> It may look scary, but this is good old algebraic geometry from highschool. We know at all times the coordinates of both control points, so we&#8217;ll call them <strong>X1,Y1</strong> and <strong>X2,Y2</strong>. To determine the diameter of the circle we are going to draw between them we use the basic 2D <a href="http://en.wikipedia.org/wiki/Distance_formula" target="_blank">distance formula</a>,which we are calling <em><strong>d.</strong></em> And you guessed it, the exact <em>x,y</em> position of the circle is the mid-point between our two controls. I was originally going with some super-fancy trigonometric voo-do, but then I dusted-off the old math book and found this little nugget. The midpoint between two known points is merely the average of their coordinates. That formula is described by <strong>C</strong>. Having a solid model like this will take care of negative values in the coordinate system by itself. They will cancel each other out. This will save you mad &#8220;if&#8221; statements.</p>
<p>And <a href="http://100percentloaded.com/multitouch/twopoint_circle.php">here is the first prototype</a> done using Flash Actionscript:</p>
<p><a href="http://100percentloaded.com/multitouch/twopoint_circle.php"><img src="http://www.100percentloaded.com/wp-content/uploads/2007/08/thumb_twopoint.gif" alt="Two-point Transformable Circle Prototype" border="0" /></a></p>
<p>Taking it to the next level, <a href="http://100percentloaded.com/multitouch/twopoint_mask.php">this example is closer</a> to what we are trying to do:</p>
<p><a href="http://100percentloaded.com/multitouch/twopoint_mask.php" title="Two-point Transformable Circular Mask"><img src="http://www.100percentloaded.com/wp-content/uploads/2007/08/thumb_twopoint_mask.gif" alt="Two-point Transformable Circular Mask" border="0" /></a></p>
<p>And finally, for those of you who happen to have a <strong>webcam</strong>, <a href="http://100percentloaded.com/multitouch/twopoint_webcam.php">try this one</a>!</p>
<p><a href="http://100percentloaded.com/multitouch/twopoint_webcam.php" title="Two-point Transformable Mask - Webcam"><img src="http://www.100percentloaded.com/wp-content/uploads/2007/08/thumb_twopoint_webcam.gif" title="Two-point Transformable Mask - Webcam" alt="Two-point Transformable Mask - Webcam" border="0" /></a></p>
<p>If you have any examples, links, or anything else, feel free to drop a comment or two.</p>
<p><em>Special thanks to <a href="http://www.epnightlife.com/" title="EP Nightlife" target="_blank">Gabriel &#8220;George Castanza&#8221; Ruiz</a>. Hope this launches his Hand-modeling career.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.100percentloaded.com/archives/13/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
