<?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>Shang Liang &#187; Experimental</title>
	<atom:link href="http://shang-liang.com/blog/category/experimental/feed/" rel="self" type="application/rss+xml" />
	<link>http://shang-liang.com/blog</link>
	<description>Life in a Flash</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:32:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Smooth scrolling text &#8211; how hard can it be?</title>
		<link>http://shang-liang.com/blog/smooth-scrolling-text-how-hard-can-it-be/</link>
		<comments>http://shang-liang.com/blog/smooth-scrolling-text-how-hard-can-it-be/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:34:12 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=238</guid>
		<description><![CDATA[Very hard! In short, you need a very high frame rate to make it look smooth. 120 is a good number. I&#8217;ve tried on 4 different platforms, Flash, JavaScript, Processing and OpenFrameworks. Needless to say, OpenFrameworks can do it without a sweat. Javascript&#8217;s result is almost as good as OF in Firefox, Chrome and Safari [...]]]></description>
			<content:encoded><![CDATA[<p>Very hard!</p>
<p>In short, you need a very high frame rate to make it look smooth. 120 is a good number. I&#8217;ve tried on 4 different platforms, Flash, JavaScript, Processing and OpenFrameworks. Needless to say, OpenFrameworks can do it without a sweat. Javascript&#8217;s result is almost as good as OF in Firefox, Chrome and Safari (IE not tested). Flash looks good in stand alone player but failed miserably when embedded into browsers. Processing or Java did a bad job in this. It only renders somewhat OK in OPENGL mode but failed in all other modes. When it&#8217;s embedded into an Applet, it can&#8217;t even produce 60 fps. </p>
<p><a href="http://shang-liang.com/exp/scrolltext/flash">Flash</a> | <a href="http://shang-liang.com/exp/scrolltext/js">Javascript</a> | <a href="http://shang-liang.com/exp/scrolltext/processing">Processing</a> | <a href="http://shang-liang.com/exp/scrolltext/scroll_txt_of.zip">OpenFrameworks (Mac Download)</a></p>
<p>More details (Based on my own understanding. May not be true)</p>
<p>The problem is because the animation and the display screen have different frame rates. What&#8217;s worse,  the animation doesn&#8217;t get rendered at a consistent frame rate. Which means even you set the animation&#8217;s frame rate as the same as the display you still won&#8217;t get a smooth scrolling because sometimes the animation is rendered a bit slower and some frames are dropped. </p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/smooth-scrolling-text-how-hard-can-it-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BIRME – Batch Image Resizing Made Easy</title>
		<link>http://shang-liang.com/blog/birme-batch-image-resizing-made-easy/</link>
		<comments>http://shang-liang.com/blog/birme-batch-image-resizing-made-easy/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 03:14:15 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=208</guid>
		<description><![CDATA[Download Now! The story behind As a web developer, I often need to resize images into a specific dimension to suit the website&#8217;s design. I used to resize images in Photoshop but I find it tedious to record actions again and again for different websites. Besides that, Photoshop is not cheap and not everyone has [...]]]></description>
			<content:encoded><![CDATA[<p><a title="BIRME - Batch Image Resizing Made Easy" href="http://shangplus.com/software/birme" target="_self">Download Now!</a></p>
<p>The story behind</p>
<p>As a web developer, I often need to resize images into a specific dimension to suit the website&#8217;s design. I used to resize images in Photoshop but I find it tedious to record actions again and again for different websites. Besides that, Photoshop is not cheap and not everyone has a (legal) copy. I tried some existing software but none of them satisfied me. Therefore, I decided to write one myself .</p>
<p>I&#8217;ve been searching and testing with many different platforms to develop it, C++, Java, Python and Perl. None of the above can achieve what I wanted, a single executable file without any extra libraries or dll files, no installation required. Finally I landed on PHP and I used <a href="http://www.bambalam.se/bamcompile/" target="_blank">bamcompile</a> to generate an executable file. I still have troubles to get a Mac or Linux version of any PHP compiler to work. I may re-use my C++ code for Mac in the future and wrap it up as an .app.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/birme-batch-image-resizing-made-easy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Playstation Eye to work with openframeworks</title>
		<link>http://shang-liang.com/blog/getting-playstation-eye-to-work-with-openframeworks/</link>
		<comments>http://shang-liang.com/blog/getting-playstation-eye-to-work-with-openframeworks/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 03:49:22 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=194</guid>
		<description><![CDATA[I&#8217;ve never seen such clear webcams before! The PS3 Eye is truly amazing! By default, PS3 Eye is not supported by Windows or Mac OSX. Luckily there are drivers ready for you to grab. For PC, use this driver. For Mac OSX, use this driver. To get PS3 Eye working for openframeworks in windows, you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never seen such clear webcams before! The PS3 Eye is truly amazing!</p>
<p>By default, PS3 Eye is not supported by Windows or Mac OSX. Luckily there are drivers ready for you to grab. For PC, <a title="ps3 playstation eye windows driver" href="http://alexpopovich.wordpress.com/2008/10/02/sony-ps3eye-camera-directshow-capture-source-filter/" target="_blank">use this driver</a>. For Mac OSX, <a title="PS3 playstation mac driver maccam" href="http://webcam-osx.sourceforge.net/" target="_blank">use this driver</a>.</p>
<p>To get PS3 Eye working for openframeworks in windows, you need to edit one line in file &#8220;ofVideoGrabber&#8221;. The solution is found in <a title="fix openframeworks to work with ps3 eye" href="http://www.openframeworks.cc/forum/viewtopic.php?f=8&amp;t=1182" target="_blank">this thread</a>, changing<br/><br/>
<pre>bool bOk = VI.setupDevice(device, width, height);</pre>
<p><br/><br/>into<br/><br/>
<pre>bool bOk = VI.setupDevice(device, width, height, VI_COMPOSITE);</pre>
<p><br/><br/>Remember to clean the project first and compile it to reflect the changes.</p>
<p>For Mac OSX, all you need to do is to copy &#8220;maccam.component&#8221; into &#8220;Library\QuickTime\&#8221;, no changes on the source code needed.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/getting-playstation-eye-to-work-with-openframeworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Box2D Tutorial</title>
		<link>http://shang-liang.com/blog/box2d-tutorial/</link>
		<comments>http://shang-liang.com/blog/box2d-tutorial/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 03:41:05 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Maths&Physics]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=191</guid>
		<description><![CDATA[I gave a mini tutorial on Box2D during A-SFUG meeting. You can download it here. Have fun!]]></description>
			<content:encoded><![CDATA[<p>I gave a mini tutorial on Box2D during <a title="another singapore flash user group" href="http://www.a-sfug.com">A-SFUG</a> meeting. You can <a href="http://www.a-sfug.com/wp-content/uploads/2009/11/box2d.zip">download it here</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/box2d-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Box2D data visualization</title>
		<link>http://shang-liang.com/blog/box2d-data-visualization/</link>
		<comments>http://shang-liang.com/blog/box2d-data-visualization/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 06:11:40 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Maths&Physics]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=184</guid>
		<description><![CDATA[Data visualization for join the pact campaign. Click to view.]]></description>
			<content:encoded><![CDATA[<p>Data visualization for join the pact campaign. Click to view.</p>
<p><a href="http://staging.jointhepact.com/presentation"><img class="alignnone size-full wp-image-187" title="data_visualization_box2d" src="http://shang-liang.com/blog/wp-content/uploads/2009/10/data_visualization_box2d.jpg" alt="data_visualization_box2d" width="592" height="338" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/box2d-data-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Box2D</title>
		<link>http://shang-liang.com/blog/fun-with-box2d/</link>
		<comments>http://shang-liang.com/blog/fun-with-box2d/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 06:47:24 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Maths&Physics]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=179</guid>
		<description><![CDATA[Messing around with Box2D. Quite fun.]]></description>
			<content:encoded><![CDATA[<p>Messing around with Box2D. Quite fun.</p>
<p><a href="http://shang-liang.com/collaboration/shang/box2d/"><img class="alignnone size-full wp-image-180" title="box2d" src="http://shang-liang.com/blog/wp-content/uploads/2009/10/box2d.jpg" alt="box2d" width="400" height="223" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/fun-with-box2d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Just for fun, try this on Firefox or IE</title>
		<link>http://shang-liang.com/blog/just-for-fun-try-this-on-firefox-or-ie/</link>
		<comments>http://shang-liang.com/blog/just-for-fun-try-this-on-firefox-or-ie/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 11:29:46 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=168</guid>
		<description><![CDATA[http://www.shang-liang.com/musicplayer/ Please be patient with my slow server. Thank you!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shang-liang.com/musicplayer/">http://www.shang-liang.com/musicplayer/</a></p>
<p>Please be patient with my slow server. Thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/just-for-fun-try-this-on-firefox-or-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Whitenoise Generator – Something helps to sleep</title>
		<link>http://shang-liang.com/blog/whitenoise-generator-something-helps-to-sleep/</link>
		<comments>http://shang-liang.com/blog/whitenoise-generator-something-helps-to-sleep/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 04:51:15 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=116</guid>
		<description><![CDATA[Just something really random and stupid, but I think it may be useful. Sometimes it&#8217;s too quiet and your ear has the &#8220;ying ying ying&#8221; sound. It&#8217;s quite annoying. This small file generates white noise.  Built in Processing and Minim library. Download: PC &#38; Mac]]></description>
			<content:encoded><![CDATA[<p>Just something really random and stupid, but I think it may be useful. Sometimes it&#8217;s too quiet and your ear has the &#8220;ying ying ying&#8221; sound. It&#8217;s quite annoying. This small file generates white noise.  Built in <a title="Processing" href="http://www.processing.org" target="_blank">Processing</a> and <a title="Code Log &amp;middot; Minim: An Audio Library for Processing" href="http://code.compartmental.net/2007/03/27/minim-an-audio-library-for-processing/" target="_blank">Minim library</a>.</p>
<p>Download: <a href="http://shang-liang.com/blog/wp-content/uploads/2009/03/whitenoise_pc.zip">PC</a> &amp; <a href="http://shang-liang.com/blog/wp-content/uploads/2009/03/whitenoise_mac.zip">Mac</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/whitenoise-generator-something-helps-to-sleep/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rhythm Surfer: Xtreme! An AIR Game (sort of)</title>
		<link>http://shang-liang.com/blog/rhythm-surfer-xtreme-an-air-game-sort-of/</link>
		<comments>http://shang-liang.com/blog/rhythm-surfer-xtreme-an-air-game-sort-of/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 04:53:40 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Maths&Physics]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=74</guid>
		<description><![CDATA[This is my entry for Code::XtremeApps::2008. It was a 24 hours coding competition. Sadly, my entry didn&#8217;t even get pass the preliminary round. As usual, I conclude the judges didn&#8217;t know what they were doing and they are not good enough to judge my idea. Download Here!]]></description>
			<content:encoded><![CDATA[<p>This is my entry for <a title="code xtreme 2008" href="http://www.itsc.org.sg/prevEvent.do?eventKey=15" target="_self">Code::XtremeApps::2008</a>. It was a 24 hours coding competition. Sadly, my entry didn&#8217;t even get pass the preliminary round. As usual, I conclude the judges didn&#8217;t know what they were doing and they are not good enough to judge my idea.</p>
<p><a title="rhythm surfer xtreme air application" href="http://hellovalerie.com/portfolio/wp-content/uploads/2008/07/rhythm_surfer/index.html" target="_self">Download Here!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/rhythm-surfer-xtreme-an-air-game-sort-of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Papervision3D LookAt problem and work around</title>
		<link>http://shang-liang.com/blog/papervision3d-lookat-problem-and-work-around/</link>
		<comments>http://shang-liang.com/blog/papervision3d-lookat-problem-and-work-around/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 12:49:17 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[Experimental]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=61</guid>
		<description><![CDATA[In Papervision3D, all classes that extend DisplayObject3D inherit its lookAt function. But the problem is the result of A.lookAt(B) sometimes ends up as A back facing B. This problem is more obvious when you want to rotate a plane to face the camera. The plane becomes invisible because it&#8217;s back facing the camera. If you [...]]]></description>
			<content:encoded><![CDATA[<p>In Papervision3D, all classes that extend DisplayObject3D inherit its lookAt function. But the problem is the result of A.lookAt(B) sometimes ends up as A back facing B. This problem is more obvious when you want to rotate a plane to face the camera. The plane becomes invisible because it&#8217;s back facing the camera. If you set the material to double-sided, the material is mirrored which is not acceptable in some cases.</p>
<p>To work around the problem without touching 3D rotations, you can create an empty object3D as C and place it along vector BA and call A.lookAt(C). Vector BA can be calculated as {A.x-B.x, A.y-B.y, A.z-B.z} and the position for C should be {BA.x*1.1+A.x, BA.y*1.1+A.y, BA.z*1.1+A.z}. The number 1.1 is just an arbitrary number. Any number greater than 1 will do the trick.</p>
<p>I&#8217;ve done <a href="http://shang-liang.com/blog/wp-content/uploads/2008/04/main.swf" target="_blank">this piece of ugly thing</a> as a demonstration and <a href="http://shang-liang.com/blog/wp-content/uploads/2008/04/main.zip">the source is here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/papervision3d-lookat-problem-and-work-around/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
