<?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>dougt&#039;s blog &#187; MozOrientation</title>
	<atom:link href="http://dougt.org/wordpress/tag/mozorientation/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougt.org/wordpress</link>
	<description>best. tagline. ever.</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:18:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Labyrinth Game in the browser</title>
		<link>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/</link>
		<comments>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 21:18:05 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[MozOrientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=516</guid>
		<description><![CDATA[A few months ago, I mentioned the game Labyrinth and how I wanted this to work in the browser. Syd Lawrence took up the cause and put together a cool implementation. Play it here. You must be running Firefox 3.6 RC or better. This uses the new orientation events added to Firefox 3.6. Syd also [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I mentioned the <a href="http://dougt.org/wordpress/2009/08/orientation/">game Labyrinth</a> and how I wanted this to work in the browser.  <a href="http://twitter.com/sydlawrence">Syd Lawrence</a> took up the cause and put together a cool implementation.</p>
<p>Play it <a href="http://playground.marmaladeontoast.co.uk/labyrinth">here</a>.  You must be running Firefox 3.6 RC or better.</p>
<p>This uses the new <a href="http://hacks.mozilla.org/2009/10/orientation-for-firefox/"> orientation events added to Firefox 3.6</a>.</p>
<p>Syd also put together a demo of what orientation looks like for those that do not have Firefox 3.6:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="340" height="285" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/M5GMWaGiV1g&amp;hl=en_US&amp;fs=1&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="340" height="285" src="http://www.youtube.com/v/M5GMWaGiV1g&amp;hl=en_US&amp;fs=1&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>This web feature is going to be standardized in the <a href="http://www.w3.org/">W3C</a> in one of two working groups.   The general idea is to separate out acceleration (values in <a href="http://en.wikipedia.org/wiki/Standard_gravity">g</a>) and orientation (values in degrees for azimuth, roll, pitch).  More on that next year when we figure out where the work will be done!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Orientation Update&#8230;</title>
		<link>http://dougt.org/wordpress/2009/08/orientation-update/</link>
		<comments>http://dougt.org/wordpress/2009/08/orientation-update/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 16:27:42 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[MozOrientation]]></category>
		<category><![CDATA[orientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=469</guid>
		<description><![CDATA[A few days ago, I blogged about orientation support in Firefox.  I am happy to report that linux patches landed over the weekend.  (We also have Window Mobile and Thinkpads running Windows patches in the review process.) If you a linux laptop and have a few minutes, please download one of the Firefox Trunk nightly [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I blogged about <a href="http://dougt.org/wordpress/2009/08/orientation/">orientation support in Firefox</a>.  I am happy to report that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=512345">linux patches landed</a> over the weekend.  (We also have <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513183">Window Mobile</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513233">Thinkpads running Windows</a> patches in the review process.)</p>
<p>If you a linux laptop and have a few minutes, please download one of the <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mobile-trunk/">Firefox Trunk nightly builds</a> and try out orientation!</p>
<p><strong>What to try?</strong></p>
<p><a href="http://people.mozilla.org/~dougt/ori.html">http://people.mozilla.org/~dougt/ori.html</a></p>
<p>Let it run for a little bit, then shake your laptop (<em>not responsible for any damage <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </em>).  After you have a couple dozen responses, send me the results including what distro and laptop you are using.</p>
<p><strong>Demos!</strong></p>
<p>While you are testing things out, check out the demo Michael Ventnor (m.ventnor at gmail.com) put together:</p>
<p><a href="http://dougt.org/random/orientationdemo/index.xhtml"><img class="alignnone" title="Orientation Demo" src="http://dougt.org/random/orientationdemo/demo-preview.png" alt="" width="507" height="453" /></a><br />
<a href="http://dougt.org/random/orientationdemo/index.xhtml">http://dougt.org/random/orientationdemo/index.xhtml</a></p>
<p><a href="http://twitter.com/dolske">Justin Dolske</a> has a few demos too:</p>
<ul>
<li><a href="https://people.mozilla.com/~dolske/tmp/seismo.html">Seismometer</a></li>
<li><a href="https://people.mozilla.com/~dolske/tmp/awesome.html">No idea, but it&#8217;s awesome</a></li>
</ul>
<p><span><a href="http://twitter.com/jruderman">Jesse Ruderman</a> also cleaned up the &#8220;ball&#8221; demo that I created making the animation <a href="http://www.squarefree.com/smoother-orientation-demo.html">smoother</a>.<br />
</span></p>
<p><strong>Help Wanted</strong></p>
<p>There are still other platforms that I would like to support.  I specifically would like to see Windows support using their Sensor API.  If you are interested in helping, file a bug, cc me, and take a look at the other implementations.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/08/orientation-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Orientation in Firefox and beyond</title>
		<link>http://dougt.org/wordpress/2009/08/orientation/</link>
		<comments>http://dougt.org/wordpress/2009/08/orientation/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 03:24:02 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[MozOrientation]]></category>
		<category><![CDATA[orientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=452</guid>
		<description><![CDATA[One of the coolest apps I saw when the iPhone came out was the wooden balance game Labyrinth.  You basically tilt your phone to move a ball around the screen, avoiding holes, and trying to get the ball to a goal.  It made use of a feature of many modern devices &#8212; accelerometers. Obviously clear [...]]]></description>
			<content:encoded><![CDATA[<p>One of the coolest apps I saw when the iPhone came out was the wooden balance game <a href="http://en.wikipedia.org/wiki/Labyrinth_%28game%29">Labyrinth</a>.  You basically tilt your phone to move a ball around the screen, avoiding holes, and trying to get the ball to a goal.  It made use of a feature of many modern devices &#8212; accelerometers.</p>
<p>Obviously clear that there should be a webapp for doing just that.  What was missing was a javascript API.</p>
<p>In recent Mozilla trunk builds, I have added support for an orientation event.  This new event will allow you to build applications and listen for changes in orientation.  (note, the first platform to support such an event is any MacBook Pro.  Others will follow).</p>
<p><strong>Simple Call:</strong></p>
<p>To use this new event, you will add an event listener as you normally would:</p>
<p>window.addEventListener(&#8220;MozOrientation&#8221;, orientationChange, true);</p>
<p>Your callback will be called, when there is a change in acceleration, passing the current orientation:</p>
<p>function orientationChange(o) {</p>
<p>}</p>
<p><strong>Simple Result:</strong></p>
<p>The passed object has 3 attributes &#8211; &#8220;x&#8221;, &#8220;y&#8221; and &#8220;z&#8221;.  Each value is between -1 and 1 where zero is the &#8220;balance point&#8221;.  For example, suppose you device is a MacBook Pro and it is sitting on a desk that is perfectly level, you would expect to see:</p>
<p>x = 0<br />
y = 0<br />
z = 1</p>
<p>x is the axis in the direction from the left side of the keyboard to the right side of the keyboard (basically the axis that is along the home row keys) is level.  If I lift up the left side of the keyboard, x will increase.  if I lift up the right side, x will decrease.</p>
<p>y is the axis in the direction from the front of the laptop (where the mouse is) to the back of the laptop.  If I lift up the front of the laptop (the side closest to me), y will decrease.  If I left the back towards the front, y will increase.</p>
<p>Got that?  Yeah, physics is pretty hard. <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>x and y can easily be visualized.  If you have a recent trunk build for the Mac, try loading this demo page:</p>
<p><a href="http://people.mozilla.org/~dougt/ball.html">http://people.mozilla.org/~dougt/ball.html</a></p>
<p>z basically will tell you that the laptop is sitting right side up.  if z was -1, you would know that the laptop (probably closed) and is sitting on its screen.  Of course the value will change as you rotate the laptop / device in this direction.</p>
<p>Right now, there is only support for the Macbook Pro.  It is pretty easy to add support for different OSs.  We have code for Samsung Windows Mobile devices, and for the HTC Windows Mobile devices.  We still need support for linux and for Windows.  If you are interested in adding support file a bug and start looking at <a href="http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIAccelerometer.idl">http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIAccelerometer.idl</a></p>
<p>The API isn&#8217;t fixed and may change.  I do invite you to comment.  Keep in mind that we want a really simple and straight forward API to expose orientation events to web developers.  If your response has either &#8220;RDF&#8221; or &#8220;DCCI&#8221; in it, please reread the last sentence.  <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thanks again and hope you enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/08/orientation/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
	</channel>
</rss>
