<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<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/"
	>

<channel>
	<title>Tojio Lab</title>
	<link>http://lab.tojio.com</link>
	<description>Tojio Labs is the place where little useful insights (and unimportant ones) from our everyday work as an interactive agency found their home</description>
	<pubDate>Tue, 01 Jul 2008 16:55:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>WiiFlash 0.4.1 Server for Mac</title>
		<link>http://lab.tojio.com/2008/07/01/wiiflash-041-server-for-mac/</link>
		<comments>http://lab.tojio.com/2008/07/01/wiiflash-041-server-for-mac/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 16:55:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/07/01/wiiflash-041-server-for-mac/</guid>
		<description><![CDATA[Just finished a new version of the WiiFlashServerJ to keep up with the great PC version, by Thibault Imbert and Joa Ebert. Besides from adding the cross domain policy functionality, the mac version has also experienced some other small updates:
+ More then one connected Flash client can receive Wiimote input now
+ Changed setting the LED [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished a new version of the WiiFlashServerJ to keep up with the great <a href="http://wiiflash.bytearray.org/?p=78" target="_blank">PC version</a>, by Thibault Imbert and Joa Ebert. Besides from adding the cross domain policy functionality, the mac version has also experienced some other small updates:<br />
+ More then one connected Flash client can receive Wiimote input now<br />
+ Changed setting the LED status functionlity on the server. Now more than one LED can be on simultaneously</p>
<p>You can find the latest source and .app <a href="http://lab.tojio.com/2008/04/14/open-source-wiiflash-04-server-written-in-java-for-mac-os-x/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/07/01/wiiflash-041-server-for-mac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Free high resolution images of hyper realistic 3D medicine pills, injections and blood bottles</title>
		<link>http://lab.tojio.com/2008/05/19/free-high-resolution-images-of-hyper-realistic-3d-medicine-pills-injections-and-blood-bottles/</link>
		<comments>http://lab.tojio.com/2008/05/19/free-high-resolution-images-of-hyper-realistic-3d-medicine-pills-injections-and-blood-bottles/#comments</comments>
		<pubDate>Mon, 19 May 2008 09:44:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/05/19/free-high-resolution-images-of-hyper-realistic-3d-medicine-pills-injections-and-blood-bottles/</guid>
		<description><![CDATA[I made those images using 3D Studio Max, Illustrator and Photoshop. The fillings consist out of five diffrent colour themes: acid, lovely, retro, funky and psycho. You can download the images (pills.zip) (injections.zip) (blood_bottles.zip) and use them for whatever (Flyer, Poster, Screendesign, &#8230;) you want. Feel free to email us a sample of your work: [...]]]></description>
			<content:encoded><![CDATA[<p>I made those images using 3D Studio Max, Illustrator and Photoshop. The fillings consist out of five diffrent colour themes: acid, lovely, retro, funky and psycho. You can download the images (<a href="http://www.tojio.com/service/pills.zip">pills.zip</a>) (<a href="http://lab.tojio.com/wp-content/uploads/2008/05/injections.zip">injections.zip</a>) (<a href="http://lab.tojio.com/wp-content/uploads/2008/05/blood_bottles.zip">blood_bottles.zip</a>) and use them for whatever (Flyer, Poster, Screendesign, &#8230;) you want. Feel free to email us a sample of your work: info[at]tojio.com</p>
<p><a href="http://lab.tojio.com/wp-content/uploads/2008/05/pills_bigger.jpg" title="hyper realistic 3D medecine pills"><img src="http://lab.tojio.com/wp-content/uploads/2008/05/pills.jpg" alt="hyper realistic 3D medecine pills" /></a></p>
<p><a href="http://lab.tojio.com/wp-content/uploads/2008/05/blood_bottle_bigger.jpg" title="hyper realistic 3D medecine blood bottle"><img src="http://lab.tojio.com/wp-content/uploads/2008/05/blood_bottle.jpg" alt="hyper realistic 3D medecine blood bottle" /></a></p>
<p><a href="http://lab.tojio.com/wp-content/uploads/2008/05/injection_bigger.jpg" title="hyper realistic 3D medecine injection"><img src="http://lab.tojio.com/wp-content/uploads/2008/05/injection.jpg" alt="hyper realistic 3D medecine injection" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/05/19/free-high-resolution-images-of-hyper-realistic-3d-medicine-pills-injections-and-blood-bottles/feed/</wfw:commentRss>
		</item>
		<item>
		<title>drip symbols - free font</title>
		<link>http://lab.tojio.com/2008/05/19/drip-symbols-free-font/</link>
		<comments>http://lab.tojio.com/2008/05/19/drip-symbols-free-font/#comments</comments>
		<pubDate>Mon, 19 May 2008 09:34:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/05/19/drip-symbols-free-font/</guid>
		<description><![CDATA[The &#8220;drip symbols&#8221; truetype font was created by Tojio and published here on Tojio Lab first. It is freeware, you can use it any way you want to. Enjoy! Download drip_symbols.zip file here.

]]></description>
			<content:encoded><![CDATA[<p>The &#8220;drip symbols&#8221; truetype font was created by Tojio and published here on Tojio Lab first. It is freeware, you can use it any way you want to. Enjoy! Download drip_symbols.zip file <a href="http://lab.tojio.com/wp-content/uploads/2008/05/drip_symbols.zip">here</a>.</p>
<p><a href="http://lab.tojio.com/wp-content/uploads/2008/05/drip-symbols-big.png" title="drip symbols - dingbats font, symbol font, free font"><img src="http://lab.tojio.com/wp-content/uploads/2008/05/drip-symbols.png" alt="drip symbols - dingbats font, symbol font, free font" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/05/19/drip-symbols-free-font/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WiiFlash interactive Ribbons and some other WiiFlash examples</title>
		<link>http://lab.tojio.com/2008/05/05/wiiflash-interactive-ribbons-and-some-other-wiiflash-examples/</link>
		<comments>http://lab.tojio.com/2008/05/05/wiiflash-interactive-ribbons-and-some-other-wiiflash-examples/#comments</comments>
		<pubDate>Mon, 05 May 2008 19:36:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/05/05/wiiflash-interactive-ribbons-and-some-other-wiiflash-examples/</guid>
		<description><![CDATA[WiiFlash Ribbons uses the mouse, or if connected, the pitch- and roll- data of a Wiimote as input for this little Papervision3D experiment. The source code is based on Ribbons3D by Felix Turner and Line 2.0 by Mark Barcinski.
Click here to have a look at the result (use your mouse, or, if running the newest [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflashribbons.thumbnail.jpg" alt="WiiFlash interactive ribbons" style="margin: 0px 20px 10px 0px; float: left" />WiiFlash Ribbons uses the mouse, or if connected, the pitch- and roll- data of a Wiimote as input for this little Papervision3D experiment. The source code is based on <a href="http://www.airtightinteractive.com/demos/" target="_blank">Ribbons3D</a> by Felix Turner and<a href="http://blog.barcinski-jeanjean.com/2007/12/17/lines-in-3d/" target="_blank"> Line 2.0</a> by Mark Barcinski.</p>
<p>Click <a href="http://lab.tojio.com/projects/wiiflashribbons/" title="WiiFlash interactive ribbons">here</a> to have a look at the result (use your mouse, or, if running the newest WiiFlashServer, your Wiimote as input device). You can also download <a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemoRibbons.zip" title="Wiimote demo ribbons">Wiimote Demo Ribbons.zip</a> containing the source files to use it with the Wiimote and the WiiFlashserver.<br />
<br style="clear: both" /><br />
<img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflashfunctions.thumbnail.jpg" alt="WiiFlash LED, rumble and mouse control" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemoFunctions.zip" title="WiiFlash demo showing LED, IR and Mouse countrol">Wiimote Demo Functions.zip</a> (demonstrating LED, Rumble and mouse control)</p>
<p><br style="clear: both" /><br />
<img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflashir.thumbnail.jpg" alt="WiiFlash dots or blobs or what ever" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemoIR.zip" title="WiiFlash demo showing how to access IR data">Wiimote Demo IR.zip</a> (very simple way of using IR blob/dots/point data)</p>
<p><br style="clear: both" /><br />
<img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflashirtraces.thumbnail.jpg" alt="WiiFlash traces" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemoIRTraces.zip" title="WiiFlash demo showing how to access IR data">Wiimote Demo IR Traces.zip</a> (using bitmaps, filters and matrix functions to generate a nice effect when handling IR blob/dots/point data)<br />
<br style="clear: both" /></p>
<p><img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflash3dobject.thumbnail.jpg" alt="WiiFlash 3D object" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemo3DObject.zip" title="WiiFlash demo showing how to use Wiimote data">Wiimote Demo 3D Object.zip</a> (using pitch, roll and yaw data to rotate and move a 3D object in Papervision 3D)<br />
<br style="clear: both" /></p>
<p><img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflashheadtracking.thumbnail.jpg" alt="WiiFlash simple headtracking" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemoHeadTracking.zip" title="WiiFlash demo showing how to make a simple head tracking application">Wiimote Demo Head Tracking.zip</a> (using two IR dots to do simple x, y an z positioning in Papervision 3D)<br />
<br style="clear: both" /></p>
<p><img src="http://lab.tojio.com/wp-content/uploads/2008/05/wiiflash3dobjectnunchuck.thumbnail.jpg" alt="WiiFlash Nunchuck 3D object" style="margin: 0px 20px 10px 0px; float: left" /><a href="http://lab.tojio.com/projects/wiiflashdemos/WiimoteDemo3DObjectNunchuck.zip" title="WiiFlash demo showing how to use Nunchuck data">Wiimote Demo 3D Object Nunchuck.zip</a> (using the Nunchuck to rotate and scale a 3D object in Papervision 3D)<br />
<br style="clear: both" /></p>
<p>More examples are on their way so check back soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/05/05/wiiflash-interactive-ribbons-and-some-other-wiiflash-examples/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple Webcam motion detection using bitmaps and filters</title>
		<link>http://lab.tojio.com/2008/05/05/simple-webcam-motion-detection-using-bitmaps-and-filters/</link>
		<comments>http://lab.tojio.com/2008/05/05/simple-webcam-motion-detection-using-bitmaps-and-filters/#comments</comments>
		<pubDate>Mon, 05 May 2008 18:01:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/05/05/simple-webcam-motion-detection-using-bitmaps-and-filters/</guid>
		<description><![CDATA[ After playing around with blob detection and somehow not getting it fast enough a neat little solution came up from Emil Korngold. Using the built in Adobe function &#8216;getColorBoundsRect&#8217; for the BitmapData object is so much faster looking for &#8216;Blobs&#8217;. (Thanks! I had a look at that when starting and then forgot all about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.tojio.com/projects/motiondetection/" target="_blank"><img src="http://lab.tojio.com/wp-content/uploads/2008/05/motiondetection.thumbnail.jpg" alt="Simple Webcam motion detection" style="margin: 0px 20px 10px 0px; float: left" /></a> After playing around with blob detection and somehow not getting it fast enough a neat little solution came up from <a href="http://www.clublime.com/lab/headtracking/" target="_blank">Emil Korngold</a>. Using the built in Adobe function &#8216;getColorBoundsRect&#8217; for the BitmapData object is so much faster looking for &#8216;Blobs&#8217;. (Thanks! I had a look at that when starting and then forgot all about it. Sometimes the simple things are just too far away).<br />
To get a usable result when detecting motion it is good to apply filters and thresholds. This reduces noise and errors when looking for the bounds of a given color.  This example is based on the &#8216;Focus&#8217; demo files provided by <a href="http://papervision3d.org/">Papervision3D</a>.</p>
<p>Click <a href="http://lab.tojio.com/projects/motiondetection/" title="Head tracking">here</a> to have a look at the result. Enjoy!</p>
<p>The interesting part of the code:</p>
<pre><code>private function loop(e:Event):void
{
	//bitmap containing difference between last &amp; this frame
 	newBmd.draw(input);
 	newBmd.applyFilter(newBmd,bounds,topLeft,filter);
 	newBmd.draw(oldBmd,null,null,BlendMode.DIFFERENCE);
 	newBmd.threshold(newBmd,bounds,topLeft,"&gt;",0xFFAAAAAA,0xFFFFFFFF);	//remember bitmap for next time round
 	oldBmd.draw(input);
 	oldBmd.applyFilter(oldBmd,bounds,topLeft,filter);
 	//now get bounds of a given color...
 	var newBound:Rectangle = newBmd.getColorBoundsRect(m,c,true);
	//now use the newBound to move something...
}</code></pre>
<p>Hope this is of any use to someone&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/05/05/simple-webcam-motion-detection-using-bitmaps-and-filters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mobile &#8216;Quick Aid&#8217;</title>
		<link>http://lab.tojio.com/2008/04/25/quick-aid/</link>
		<comments>http://lab.tojio.com/2008/04/25/quick-aid/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 18:12:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/04/25/quick-aid/</guid>
		<description><![CDATA[
Lebensrettende Sofortmaßnahmen: Auf dem Handy jederzeit verfügbar
Medizinische Notfälle können jederzeit und überall passieren. Die wenigsten Menschen sind darauf vorbereitet einzugreifen: Zwar haben dem Deutschen Roten Kreuz zufolge rund 80 Prozent aller Deutschen einen Ersthelferkurs besucht - doch im Schnitt ist das 15 Jahre her. Eine noch unveröffentlichte Studie des Notfallmediziners Jan Breckwoldt von der Berliner [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.tojio.com/wp-content/uploads/2008/04/android-for-labs_01.jpg" title="Quick Aid"><img src="http://lab.tojio.com/wp-content/uploads/2008/04/android-for-labs_02.jpg" alt="Quick Aid" style="margin: 0px 20px 10px 0px; float: left" /></a></p>
<h4>Lebensrettende Sofortmaßnahmen: Auf dem Handy jederzeit verfügbar</h4>
<p>Medizinische Notfälle können jederzeit und überall passieren. Die wenigsten Menschen sind darauf vorbereitet einzugreifen: Zwar haben dem Deutschen Roten Kreuz zufolge rund 80 Prozent aller Deutschen einen Ersthelferkurs besucht - doch im Schnitt ist das 15 Jahre her. Eine noch unveröffentlichte Studie des Notfallmediziners Jan Breckwoldt von der Berliner Charité zeigt: Immerhin erkennen 66 Prozent der Ersthelfer, wenn ein Herz- oder Atemstillstand vorliegt. Aber nur 12,5 Prozent leiten eine sinnvolle Wiederbelebung ein. <span style="font-size: 7pt"> (1) </span></p>
<p>Vor diesem Hintergrund haben wir uns entschieden Quick Aid zu realisieren, eine Erste Hilfe Anwendung für Mobiltelefone. Quick Aid muss einmalig auf einem Mobiltelefon installiert werden und begleitet den Besitzer dann überallhin und kann jederzeit benutzt werden.</p>
<p>Die erste Version von Quick Aid wurde für das kommende Google Handy als Wettbewerbsteilnahme an der <a href="http://code.google.com/android/adc.html" target="_blank">Android Developer Challenge</a> der <a href="http://www.openhandsetalliance.com/" target="_blank">Open Handset Alliance</a> entwickelt. Weitere Versionen, die spezielle Funktionen wie GPS und Google Maps (Wo bin ich? Wo bekomme ich Hilfe?) nutzen, sind in Planung. Des Weiteren ist auch die Realisierung einer Flash Lite und iPhone Variante von Quick Aid geplant sowie die Nutzung von Audio, Video und auch Webseiten.</p>
<p>Eine vollständige Dokumentation werden wir in Kürze hier auf Tojio Labs veröffentlichen.</p>
<h2> Quick Aid (english)</h2>
<p><img src="http://lab.tojio.com/wp-content/uploads/2008/04/quick_aid_logo.png" alt="Quick Aid Logo" style="margin: 0px 20px 10px 0px; float: left" /></p>
<h4>Basic life support: Always available on mobile phones</h4>
<p>Medical emergencies can happen anywhere and any time. Very few people know what to do. According to the German Red Cross 80 per cent of all Germans have attended a First Aid course – but on average the course was 15 years ago. A study carried out by the Berlin Charité Hospital has shown that 66 per cent of First Aiders can recognize cardiac or respiratory arrest but only 12.5 per cent actually initiate (any sensible) resuscitation procedures. <span style="font-size: 7pt"> (1) </span></p>
<p>It is against this background that Quick Aid, a basic life support application for mobile phones, came into being. Quick Aid, when installed on an (Android enabled) mobile phone, accompanies the user everywhere and can be accessed at any time.</p>
<p>At the current stage this software is a prototype of the concept. The next step is making use of and integrating Android specific functions such as GPS support, Google maps (Where am I? Where can I find help?) and extending the variety of<br />
media used (using Sound, Video or Webpages for help and instructions). We are also planning a Flash Lite Version and an iPhone Version.</p>
<p>A full documentation will be available soon, here on Tojio Labs.</p>
<p><span style="font-size: 7pt"> (1) Quelle: http://www.spiegel.de/wissenschaft/mensch/0,1518,546172,00.html</span></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/04/25/quick-aid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open source WiiFlash 0.4 Server (written in Java) for Mac OS X</title>
		<link>http://lab.tojio.com/2008/04/14/open-source-wiiflash-04-server-written-in-java-for-mac-os-x/</link>
		<comments>http://lab.tojio.com/2008/04/14/open-source-wiiflash-04-server-written-in-java-for-mac-os-x/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 13:34:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/04/14/open-source-wiiflash-04-server-written-in-java-for-mac-os-x/</guid>
		<description><![CDATA[WiiFlashServerJ is a Java application built on top of the great WiiremoteJ library by Michael Diamond which also uses the Bluecove library.  WiiFlashServerJ sends and receives data from the Wiimote via WiiremoteJ. The data is transformed to a byte array in a way the WiiFlash library can handle it.
In the current version all data [...]]]></description>
			<content:encoded><![CDATA[<p>WiiFlashServerJ is a Java application built on top of the great WiiremoteJ library by Michael Diamond which also uses the Bluecove library.  WiiFlashServerJ sends and receives data from the Wiimote via WiiremoteJ. The data is transformed to a byte array in a way the WiiFlash library can handle it.</p>
<p>In the current version all data from a Wiiremote can be sent (button states, battery level, the acceleration axes, 4 IR points and sizes and data from the Nunchuck extension). Data sent from the Classic Controller extension has not been tested yet and can be considered &#8216;guessplimented&#8217;. Its possible to activate the vibrating and LEDs as well as activate the Mouse mode by WiiFlash now. If an error occurs while connecting the Wiimote is disconnected again.</p>
<p><strong>Note</strong><br />
The software should be considered experimental. There is no guarantee the data sent by WiiFlashServerJ is exactly the same as by the Windows version provided by WiiFlash. WiiFlashServerJ was coded on lazy weekends and  without insight into the interna of the official (Windows) version.</p>
<p><strong>Download</strong><br />
<a href="http://lab.tojio.com/projects/wiiflashserverj/WiiFlashServerJ_2008_06_30.zip" title="WiiFlash Server 0.4.1a">WiiFlashServerJ</a> (Alpha version, 30 Jun. 2008)<br />
<a href="http://lab.tojio.com/projects/wiiflashserverj/WiiFlashServerJ_2008_04_24.zip" title="WiiFlash Server 0.4b">WiiFlashServerJ</a> (Alpha version, 24 Apr. 2008)<br />
<a href="http://lab.tojio.com/projects/wiiflashserverj/WiiFlashServerJ_2008_04_14.zip" title="WiiFlash Server 0.4a">WiiFlashServerJ</a> (Alpha version, 14 Apr. 2008)</p>
<p><strong>Examples</strong><br />
You can find some simple examples making use of the WiiFlash library in combination with e.g. Papervision <a href="http://lab.tojio.com/2008/05/05/wiiflash-interactive-ribbons-and-some-other-wiiflash-examples/" title="WiiFlash Examples">here</a>.</p>
<p><strong>Known Issues</strong><br />
- Sometimes Wiiremote is not properly connected and in that case does not send data (properly)</p>
<p>- Sometimes its not possible to activate the LEDs, or rumble function</p>
<p>- If Nunchuck extension is plugged in, the IR point size does not change.</p>
<p>- Point size, battery level and perhaps some other data (extensions?) are sent, but values could differ from what the windows server sends. (Feedback would be great&#8230;)</p>
<p>- Battery level is just read once, when connecting or extensions are connected / disconnected. Working on that one&#8230;</p>
<p>- Button states and IR start playing random. In this case you are probably using an older version of the WiiFlash API.<br />
(Since the first release of WiiFlash 0.4 there have been small, but important changes:  In &#8220;Wiimote.as&#8221; -&gt; &#8220;function update&#8221; -&gt; pack.position = 36 has been changed to 37 and in WiiSocket.as you will find a &#8220;I80&#8243; in the newer version. So make sure you have the newer version of <a href="http://wiiflash.googlecode.com/files/WiiFlash%200.4%20pre-release.zip" target="_blank">WiiFlash 0.4</a>. or even better <a href="http://wiiflash.bytearray.org/?page_id=50" target="_blank">WiiFlash 0.4.1</a>)</p>
<p>- Nunchuck does not send data. This sometimes happens, just restart WiiFlashServerJ</p>
<p>- Classic Controller has not been tested yet</p>
<p><strong>Used libraries and software</strong><br />
Java Wiiremote library: <a href="http://www.wiili.org/WiiremoteJ" title="WiiremoteJ" target="_blank"> WiiremoteJ</a><br />
Java Bluetooth library: <a href="http://bluecove.sourceforge.net/" target="_blank">Bluecove</a><br />
Flash Wiiremote library <a href="http://wiiflash.org/" target="_blank">WiiFlash</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/04/14/open-source-wiiflash-04-server-written-in-java-for-mac-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wow Physics Engine &#038; Papervision3D Engine Hello World</title>
		<link>http://lab.tojio.com/2008/03/13/wow-physics-engine-papervision3d-engine-hello-world/</link>
		<comments>http://lab.tojio.com/2008/03/13/wow-physics-engine-papervision3d-engine-hello-world/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 17:40:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/03/13/wow-physics-engine-papervision3d-engine-hello-world/</guid>
		<description><![CDATA[ This is a little Hello World app using Papervision3D, and the Wow Physics Engine, written in AS3
Click here to have a look at the result. Enjoy!
Here are some basic tutorials to get things started with the Wow Engine:
Your First WOW-Engine Application,
how to use boundArea, 
how to use sphere and get position and
How to use [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.tojio.com/projects/wowpv3dhelloworld/" target="_blank"><img src="http://lab.tojio.com/wp-content/uploads/2008/03/papervisionwow.thumbnail.jpg" alt="Papervision Wow HelloWorld" style="margin: 0px 20px 10px 0px; float: left" /></a> This is a little Hello World app using <a href="http://papervision3d.org/">Papervision3D</a>, and the <a href="http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/" target="_blank">Wow Physics Engine</a>, written in AS3<br />
Click <a href="http://lab.tojio.com/projects/wowpv3dhelloworld/" target="_blank" title="Papervision 3D Wow Physics Engine Hello World, Getting Started">here</a> to have a look at the result. Enjoy!</p>
<p>Here are some basic tutorials to get things started with the Wow Engine:<br />
<a href="http://seraf.mediabox.fr/wow-engine/wow-engine-tutorial-your-first-wow-engine-application/" target="_blank">Your First WOW-Engine Application</a>,<br />
<a href="http://seraf.mediabox.fr/wow-engine/wow-engine-tutorial-how-to-use-boundarea/" target="_blank">how to use boundArea</a>, <a href="http://seraf.mediabox.fr/wow-engine/wow-engine-tutorial-how-to-use-sphere-and-get-position/" target="_blank"><br />
how to use sphere and get position</a> and</p>
<p><a href="http://seraf.mediabox.fr/wow-engine/wow-engine-tutorial-how-to-use-plane-sphere-constraint/" target="_blank">How to use plane, sphere &amp; constraint</a>.</p>
<p>The useful parts of the sourcode used in the hello World app is down below. Basicly you start by setting up the physics world, then the 3d. The Enterframe loop is used to update the rendering part to show what the objects in the physics world are doing.<br style="clear: both" /></p>
<p>Inititalize the physics world and its objects:</p>
<pre><code>
private function initPhysics():void
{
    //keep the objects in an array, so we can access them later on
    wowBalls = new Array();
    wowAnchorPoints = new Array();
    wowConstraints = new Array();

    // init wow basics
    wow=new WOWEngine();
    wow.collisionResponseMode = wow.SELECTIVE;
    //add some gravity
    wow.addMasslessForce(new WVector(0,gravity,0));

    var wowBall:WSphere;
    var wowAnchorPoint1:WSphere;
    var wowAnchorPoint2:WSphere;
    var constraint:WSpringConstraint;

    var x:int = 0;
    var y:int = -ballHeight/2;
    var z:int = 0;
    var fixed:Boolean = false;

    //make the physics represenation of the balls
    for(var i:uint=0; i &lt; NUM_OF_BALLS; i++)
    {
        //add the ball
        fixed = false;
        wowBall = new WSphere(1+((i-center)*ballSpacing),y,z,ballRadius,fixed,ballMass,ballElasticity,ballFriction);
        wowBalls.push(wowBall);
        wow.addParticle(wowBall);

        //add the first anchorpoint 'holding' the ball
        fixed = true;
        wowAnchorPoint1 = new WSphere(x+((i-center)*ballSpacing),y+ballHeight,z-150,ballRadius,fixed);
        wowAnchorPoints.push(wowAnchorPoint1);
        wow.addParticle(wowAnchorPoint1);

        //add the second anchorpoint 'holding' the ball
        wowAnchorPoint2 = new WSphere(x+((i-center)*ballSpacing),y+ballHeight,z+150,ballRadius,fixed);
        wowAnchorPoints.push(wowAnchorPoint2);
        wow.addParticle(wowAnchorPoint2);

        //build the 'holding' mechanism by using constraints
        constraint = new WSpringConstraint(wowBall, wowAnchorPoint1,stiffness);
        wowConstraints.push(constraint);
        wow.addConstraint(constraint);

        constraint = new WSpringConstraint(wowBall, wowAnchorPoint2,stiffness);
        wowConstraints.push(constraint);
        wow.addConstraint(constraint);
    }
}
</code></pre>
<p>Now create the Papervision 3D world:</p>
<pre><code>
private function init3D():void
{
    pv3dBalls = new Array();
    pv3dAnchorPoints = new Array();
    pv3dMirrorBalls = new Array();

    // init papervision basics
    view = new BasicView(stage.stageWidth, stage.stageHeight, true, true);
    view.camera.zoom = 10;
    view.camera.focus = 150;
    addChild(view);

    //use interactive 3dmouse
    vMouse = view.viewport.interactiveSceneManager.virtualMouse;
    mouse3D = view.viewport.interactiveSceneManager.mouse3D;
    Mouse3D.enabled = true;

    //create lines obj representing constraints between anchorpoints and balls
    pv3dLinesArray = new Array();
    pv3dLines = new Lines3D(new LineMaterial(0x666666,1));
    view.scene.addChild(pv3dLines);

    // create materials
    var shadowData = new glasTexture() as Bitmap;
    var mp:BitmapMaterial = new BitmapMaterial(shadowData.bitmapData);

    var ballData = new ballTexture() as Bitmap;
    var ballMirrorMaterial:BitmapMaterial = new  BitmapMaterial(ballData.bitmapData);

    light = new PointLight3D(false,false);
    envMaterial = new EnvMapMaterial(light, ballData.bitmapData,ballData.bitmapData,1);

    //create the glas "table"
    var glasPane:Plane = new Plane(mp,600,400);
    glasPane.rotationX = 270;
    glasPane.y = -120;
    view.scene.addChild(glasPane, "glasPane");

    var dragPlane:Plane = new Plane(new ColorMaterial(0xFF0000, 0), 1000,1000, 6, 6);
    dragPlane.material.interactive = true;
    dragPlane.material.doubleSided = true;
    dragPlane.z = 50;
    view.scene.addChild(dragPlane, "dragPlane");

    var pv3dBall:Sphere;
    var pv3dMirrorBall:Sphere;
    var pv3dAnchorPoint1:Sphere;
    var pv3dAnchorPoint2:Sphere;

    //create the 3d representation of the balls
    for(var i:uint=0; i &lt; NUM_OF_BALLS; i++)
    {
        //add the shiny little ball
        pv3dBall = new Sphere(envMaterial,ballRadius+2,16,16); //(new WireframeMaterial(0xaf8554),ballRadius+5,10,10);
        pv3dBall.material.interactive = true;
        pv3dBall.name = "pv3dBall"+i;
        pv3dBall.scale *=-1;
        view.scene.addChild(pv3dBall, "pv3dBall"+i);
        pv3dBalls.push(pv3dBall);

        //add the mirror ball
        pv3dMirrorBall = new Sphere(ballMirrorMaterial,ballRadius+2,10,10);
        view.scene.addChild(pv3dMirrorBall, "pv3dMirrorBall"+i);
        pv3dMirrorBalls.push(pv3dMirrorBall);

        //add the first anchorpoint 'holding' the ball
        pv3dAnchorPoint1 = new Sphere(new ColorMaterial(0x999999,0.5),1);
        view.scene.addChild(pv3dAnchorPoint1, "pv3dAnchorPoint1"+i);
        pv3dAnchorPoints.push(pv3dAnchorPoint1);

        //add the second anchorpoint 'holding' the ball
        pv3dAnchorPoint2 = new Sphere(new ColorMaterial(0x999999,0.5),1);
        view.scene.addChild(pv3dAnchorPoint2, "pv3dAnchorPoint2"+i);
        pv3dAnchorPoints.push(pv3dAnchorPoint2);

        //add lines from ball to both anchorpoints, coordinates are done later...
        pv3dLinesArray.push(new Line3D(pv3dLines,new LineMaterial(0x999999,0.1),1,
                            new Vertex3D(0,0,0), new Vertex3D(0,0,0) ));
        pv3dLines.addLine(pv3dLinesArray[i*2]);
        pv3dLinesArray.push(new Line3D(pv3dLines,new LineMaterial(0x999999,0.1),1,
                            new Vertex3D(0,0,0), new Vertex3D(0,0,0) ));
        pv3dLines.addLine(pv3dLinesArray[i*2+1]);
    }
}
</code></pre>
<p>Now get the Loop going:</p>
<pre><code>
private function loop( event : Event ):void
{
    //do the physics stuff
    wow.step();

    //set viewable stuff to physics stuff
    syncRenderingToPhysics();

    light.copyPosition(view.camera);

    //do some camera movement
    Camera3D(view.camera).hover(0, view.viewport.containerSprite.mouseX*0.003,
                                (view.viewport.containerSprite.mouseY-400)*0.002);

    //do the 3d rendering stuff
    view.singleRender();
}
</code></pre>
<p>This part will update the graphics part to show what the physics objects are doing:</p>
<pre><code>
private function syncRenderingToPhysics():void
{
    if(_dragging)
    {
        wowBalls[_actualDragObjID].px = mouse3D.x;
        wowBalls[_actualDragObjID].py = mouse3D.y;
    }	

    //just reposition the moving parts...
    for(var i:uint=0; i &lt; NUM_OF_BALLS; i++)
    {
        pv3dBalls[i].x = wowBalls[i].px;
        pv3dBalls[i].y = wowBalls[i].py;
        pv3dBalls[i].z = wowBalls[i].pz;
        pv3dMirrorBalls[i].copyPosition(pv3dBalls[i]);
        pv3dMirrorBalls[i].y = (pv3dMirrorBalls[i].y*-1)-250;
		....
    }
}
</code></pre>
<p>Hope this is of any use to someone&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/03/13/wow-physics-engine-papervision3d-engine-hello-world/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Data Management 03 - Storing data in a relational DB on a remote server</title>
		<link>http://lab.tojio.com/2008/02/22/flex-data-management-03-storing-data-in-a-relational-db-on-a-remote-server/</link>
		<comments>http://lab.tojio.com/2008/02/22/flex-data-management-03-storing-data-in-a-relational-db-on-a-remote-server/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 13:44:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Data Management]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2008/02/22/flex-data-management-03-storing-data-in-a-relational-db-on-a-remote-server/</guid>
		<description><![CDATA[The first and the second part of this tutorial covered the topics

reading data from a relational DB and transforming the data into a suitable (XML) format so that Flex can use this data to establish a DataProvider
setting up a (editable) DataGrid with the DataProvider and checking user input for consistency

So now we’re ready to send [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://lab.tojio.com/2007/11/12/flex-data-management-01-reading-data-from-a-remote-db-using-the-httpservice-class/" title="Flex Data Management 01">first</a> and the <a href="http://lab.tojio.com/2007/11/16/flex-data-management-02-handling-datagrid-input/" title="Flex Data Management 02">second</a> part of this tutorial covered the topics
<ul>
<li>reading data from a relational DB and transforming the data into a suitable (XML) format so that Flex can use this data to establish a <code>DataProvider</code></li>
<li>setting up a (editable) <code>DataGrid</code> with the DataProvider and checking user input for consistency</li>
</ul>
<p>So now we’re ready to send the updated data back to our server: whenever the user changes the row (either by typing ‘enter’or by clicking into another row) the entered data will be checked. If the new Values are OK, the method <code>sendData()</code> will be called in order to construct an Object that will hold our parameters for the <code>POST</code> request by means of the AS3 <code>HttpService</code> Class:</p>
<pre>
<code>
function sendData(id:int, field:String, value:String)
{
	var params:	Object 	= {};
	params.id 			= id;
	params.field 		= field;
	params.value		= value;
	var at:AsyncToken = updaterequest.send(params);
}
</code></pre>
<p>The <code>HTTPService updaterequest</code> which is called here is defined in<br />
our .mxml-file:
<pre><code>
&lt;mx:HTTPService id="updaterequest"
			result="handleUpdateResponse(event)"
			showBusyCursor="true"
			method="POST"
			url="http://yourserver.com/yourscript.php"
			useProxy="false" /&gt;
</code></pre>
<p>So far, the entered data has been sent back to our server. After the request is<br />
done, the <code>HttpService</code> will call the<br />
<code>handleUpdateResponse()</code> method in wich we can control the further<br />
program behaviour acording to success or failure. But on the server side again,<br />
we have to check the data before any attempt to write it into the DB: the param<br />
id has to be numerical, the params field and value must be quoted to avoid<br />
possible SQL injections! Let’s have a look at the PHP script that processes the<br />
data and stores them in the mySQL Database: </p>
<pre><code>
if ($_SERVER['REQUEST_METHOD'] == 'POST' &#038;&#038; isset($_POST['id']))
{
	// check whether the id is numeric and quote the other fields
	// for security reasons so that there can be no sql injection
	$id 	 = is_numeric($_POST['id']) ? $_POST['id'] : 0;
	$field  = quoteInput($_POST['field']);
	$value = quoteInput($_POST['value']);

	updateUserList( $id, $field, $value );
}

function quoteInput($value)
{
	 // Stripslashes
	 if (get_magic_quotes_gpc())  $value = stripslashes($value);

	 // Quote if not integer
	 if (!is_numeric($value))
	 	$value = "'" . mysql_real_escape_string($value) . "'";

	 return $value;
}

function updateUserList($id, $field, $value)
{
	// open the connection to our DB host and select the DB we need
	// you have to define these constants for your needs..
	$link = mysql_connect(DB_HOST, DB_USER_ADMIN, DB_PASS_ADMIN)
    	or returnError('Could not connect: ' . mysql_error());

	mysql_select_db(DB_NAME) or returnError('Could not select database');

	// prepare the update statement for the user row in question
	$exec 	= "UPDATE `user` SET `$field` ='$value'
				WHERE `id`='$id'";

	// execute the update and close the connection
	$result = mysql_query($exec);
	mysql_free_result($result);
	mysql_close($link);

	// this is the response that the Flex HttpService
	// will get, so that the Flex program can inform
	// the user of an error if necessary
	if ($result) 	print('&lt;response&gt;success&lt;/response&gt;');
	else		print('&lt;response&gt;failed&lt;/response&gt;');
}

function returnError($err)
{
	// HTTP-header?
	print('&lt;response&gt;failed&lt;/response&gt;');
	print("&lt;message&gt;$err&lt;/message&gt;");
	exit();
}

</code></pre>
<p>So we have the complete cycle of communication between a Flex program and a<br />
relational database via Http-request and Webserver&#8230;<br />
enjoy building your applications!</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2008/02/22/flex-data-management-03-storing-data-in-a-relational-db-on-a-remote-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Data Management 02 - handling DataGrid  input</title>
		<link>http://lab.tojio.com/2007/11/16/flex-data-management-02-handling-datagrid-input/</link>
		<comments>http://lab.tojio.com/2007/11/16/flex-data-management-02-handling-datagrid-input/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 15:56:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Data Management]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://lab.tojio.com/2007/11/16/flex-data-management-02-handling-datagrid-input/</guid>
		<description><![CDATA[The previous part of this tutorial was all about reading data from a mysql database and reformatting this data so that we can easily load it into a DataGrid. This second part is about validating input data from the user. As some columns  of our DataGrid are editable, we have to check whether the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.tojio.com/wp-content/uploads/2007/11/inputerror.jpg" title="inputerror.jpg"><img src="http://lab.tojio.com/wp-content/uploads/2007/11/inputerror.thumbnail.jpg" alt="inputerror.jpg" style="margin: 0px 20px 10px 0px; float: left" /></a>The previous part of this tutorial was all about reading data from a mysql database and reformatting this data so that we can easily load it into a <code>DataGrid</code>. This second part is about validating input data from the user. As some columns  of our <code>DataGrid</code> are editable, we have to check whether the user&#8217;s input is acceptable at all before sending the new data back to our database (which will be covered in part 3 of the tutorial).</p>
<p><strong>Task #2: getting the data entered into the <code>DataGrid</code></strong><br />
Our <code>DataGrid</code> has three editable columns: credits, status and active. But we have some restrictions on them: credits must be a positive integer, status a positive integer from 1 to 4 and active can only be a boolean value.<br />
So when and how can we check the data that was entered and reject the input if necessary? The DataGrid is defined with the following argument: <code>itemEditEnd="checkInput(event)"</code>. That causes it to call the function <code>checkInput()</code> in our script when the editing of a cell has ended (i.e. the user has typed <code>enter</code> or switched the row or column).</p>
<p>Now let&#8217;s have a look at the function that is processing the input:</p>
<pre>
<code>

/**
 * This method is called when a DataGridEvent occurs. In case the user has
 * changed clumn or row, check whether new data was entered and send the new
 * value of the changed field to our PHP dataservice that will update the DB.
 *
 * @param e - the DataGridEvent that has just occured
 */

function checkInput(e:DataGridEvent):void
{
    if (e.reason == DataGridEventReason.NEW_COLUMN
        || e.reason == DataGridEventReason.NEW_ROW)
    {
        var newData:String;
        var selectedRow:Object = e.itemRenderer.data;
        var previous:String = new String(
            userCollection.getItemAt(usergrid.selectedIndex)[e.dataField]);

        for (var i:String in selectedRow)
        {
            if ( i == e.dataField )
            {
                // if the current field is the updated one,
                // get the editor and do some introspection to find out
                // which class we're using (TextInput or CheckBox)

                var editor:Object    = e.currentTarget.itemEditorInstance;
                var classInfo:XML    = describeType(editor);
                var className:String = classInfo.@name.toString();

                if (className == 'mx.controls::TextInput')
                    newData = TextInput(e.currentTarget.itemEditorInstance).text;

                else if (className == 'mx.controls::CheckBox')
                {
                    if(CheckBox(e.currentTarget.itemEditorInstance).selected)
                         newData = "1";
                    else newData = "0";
                }

                // this is the place to do some first consistency checks
                // on submitted fields [...]
                // if the data is not acceptable for any reason, you can
                // invoke the preventDefault()-Method on the Datagrid event
                // and make sure that the data will not be sent

                var dataOK:Boolean = checkData(previous, newData, e);
                // send the data if it's OK and different from previous value
                if ( dataOK &amp;&amp; newData != previous )
                    sendData(selectedRow.id, e.dataField, newData);
            }
        }
    }
}</code></pre>
<p>What the function does, in brief, is:</p>
<ol>
<li>having a look at the fields of the selected row until we reach the field that has been edited</li>
<li>for the edited field: doing some introspection to find out which class is used as editor for the field</li>
<li>type casting the <code>itemEditorInstance</code> to an instance of its actual class</li>
<li>retrieving the new data entered by the user and let another function validate the data</li>
</ol>
<p>Note that <strong>you won&#8217;t get the new data</strong> by the <code>itemEditorInstance.data</code> property! By accessing that, you&#8217;ll only get the data that the row previously held. In order <strong>to get the new data, you have to do the type cast</strong> as described above and retrieve the new value by the editor class&#8217; property in question.</p>
<p><strong>Task #3: validating the data and preventing wrong values</strong><br />
The following function is finally called to validate the data. If the data entered is not acceptable, the edited field will be reset and an alert message will pop up, showing the possible values:</p>
<pre>
<code>
/**
 * This function checks the user input on the fields 'credits' and 'status'
 * For the credits, only 0 or a positive integer will be accepted,
 * for status only integers from 1 to 4.
 * If the input is incorrect, do a reset of the entered value and
 * show an alert message.
 */
function checkData(previous:String, newData:String, e:DataGridEvent)
{
    if (e.dataField == "credits")
    {
        // try to cast string input to integer
        var val:int = int(newData);
        // if new value is negative
        // OR is not "0" as string BUT 0 as integer, then the input
        // has not been a valid integer -&gt; prevent this and show message
        if (val &lt; 0 || ( newData != "0" &amp;&amp;  val == 0))
        {
            // reset the entered input
            TextInput(e.currentTarget.itemEditorInstance).text
                = previous;
            e.preventDefault();
            Alert.show("Please enter a positive Number!");
            return false;
        }
    }
    else if (e.dataField == "status")
    {
        // we will only accept integers from 1 to 4 as status code
        // try to cast string input to integer
        var val:int = int(newData);
        if (val &gt;= 0 || val &gt; 4 )
        {
            // reset the entered input
            TextInput(e.currentTarget.itemEditorInstance).text
                = previous;
            e.preventDefault();
            Alert.show("Please enter a positive from 1 to 4 as status code!");
            return false;
        }
    }
    // if no error has occured until this point, we're safe. return true...
    return true;
}</code></pre>
<p>So that&#8217;s how entered data can be accessed and validated. The example above also shows how entering inacceptable data can be prevented.<br />
The third part of this tutorial will cover sending the data back to our DB and storing it there. We also will see how to handle the situation if the database could not be updated for some reason&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.tojio.com/2007/11/16/flex-data-management-02-handling-datagrid-input/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
