<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Code Laboratorium</title>
	<atom:link href="http://codelab.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codelab.wordpress.com</link>
	<description>Musings of a grumpy coder</description>
	<lastBuildDate>Mon, 02 Jan 2012 12:15:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codelab.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Code Laboratorium</title>
		<link>http://codelab.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codelab.wordpress.com/osd.xml" title="Code Laboratorium" />
	<atom:link rel='hub' href='http://codelab.wordpress.com/?pushpress=hub'/>
		<item>
		<title>OpenGL video editing hack</title>
		<link>http://codelab.wordpress.com/2011/10/19/opengl-video-editing-hack/</link>
		<comments>http://codelab.wordpress.com/2011/10/19/opengl-video-editing-hack/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 06:08:37 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[video editing]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=233</guid>
		<description><![CDATA[Hello, just a quick hack report cause I really liked how useful it turned out to be. It all started when I located a small program I wrote, for an interesting coursework assignment, back when I did my graphics MSc at the University of Hull. I wanted to upload a video capture to youtube to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=233&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://codelab.files.wordpress.com/2011/10/vpost_result_shot-thumb.jpg?w=780" alt="video post result shot" title="vpost_result_shot-thumb"   class="alignright size-full wp-image-234" /><br />
Hello, just a quick hack report cause I really liked how useful it turned out to be.</p>
<p>It all started when I located a small program I wrote, for an interesting coursework assignment, back when I did my graphics MSc at the University of Hull. I wanted to upload a video capture to youtube to show 4rknova who&#8217;s going through the same MSc course right now.</p>
<p>So I did capture the video, and saved it as an image sequence for further editing, because I wanted to add titles at the bottom describing what was demonstrated at each part of the video (the program was basically a sequence of arbitrary shader effects).</p>
<p>But how was I supposed to add the captions? The thought of wrestling with one of those fucking GUI video editing programs made me cringe. They are all slughish, heavy and unweildy, and I always have to fight for a few hours to do even simple things. I was more inclined to use ffmpeg from the command line, but then adding transitions to the captions, like having them fade and slide in from below would be a complete pain in the ass. Btw take a look at <a href="http://www.youtube.com/watch?v=txt6SGL483E">the final video</a> to understand what I was trying to achieve with the caption transitions. Should be really simple right?</p>
<p>But then it dawned &#8230; hey, I could easily write that transition in a couple lines of C/OpenGL code instead of fighting with all those video editing programs! I started by writing a simple program that iterates over an input image sequence, opening each one in turn and then feeding them one by one to a dlopened plugin which could do whatever it likes with the frame. When that plugin processing function returns, I just dump the image back to the disk. It&#8217;s that simple!</p>
<p>Then the plugin was almost trivial as well. I just drop the frame into the OpenGL framebuffer and use <a href="http://nuclear.mutantstargoat.com/sw/libdrawtext/">my new text rendering library</a> to draw the captions at the appropriate times with the appropriate alpha and position. The timing was derived by a simple event script file containing the frame numbers where each part starts and ends. I fed the script into <a href="https://nuclear.mutantstargoat.com/hg/dsys2/">my new event sequencing (demosystem) library</a> which gives me back a nice linearly increasing [0, 1] value for each event (part) during the time when it is active according to the script. That makes it a piece of cake to fiddle with trig and some factors here and there to transition my captions just the way I wanted.</p>
<p>Here&#8217;s the code in case you want to play around with it:</p>
<ul>
<li><a href="https://nuclear.mutantstargoat.com/hg/vpost/">the vpost program</a>
<li><a href="https://nuclear.mutantstargoat.com/hg/vpost_plugins/">the vpost plugin for the aformentioned video processing task</a>
</ul>
<p>I&#8217;m impressed, it&#8217;s fucking awesome and powerful to edit videos like that, and I&#8217;m definitely going to use it again.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=233&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/10/19/opengl-video-editing-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/10/vpost_result_shot-thumb.jpg" medium="image">
			<media:title type="html">vpost_result_shot-thumb</media:title>
		</media:content>
	</item>
		<item>
		<title>Stereoscopic fun on iOS</title>
		<link>http://codelab.wordpress.com/2011/09/11/stereoscopic-fun-on-ios/</link>
		<comments>http://codelab.wordpress.com/2011/09/11/stereoscopic-fun-on-ios/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 06:45:04 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=217</guid>
		<description><![CDATA[The fun never stops with stereoscopic rendering. I posted previously about my earlier attempts with anaglyphs and shutter glasses, and all that was really fun, but not without drawbacks. Shutter glasses are awesome, but the only computer I have with a stereo output is an old SGI workstation, which isn&#8217;t up to the task to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=217&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The fun never stops with stereoscopic rendering. I posted previously about my earlier attempts with <a href="http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/">anaglyphs</a> and <a href="http://codelab.wordpress.com/2010/01/06/stereoscopic-opengl-part2">shutter glasses</a>, and all that was really fun, but not without drawbacks. Shutter glasses are awesome, but the only computer I have with a stereo output is an old SGI workstation, which isn&#8217;t up to the task to render modern 3D graphics, and doesn&#8217;t event give me stereo OpenGL visuals and a depth buffer at the same time. Anaglyph glasses are cheap and work everywhere, but they mess up the colors and they have a serious problem with ghosting, ruining the stereoscopic effect.</p>
<p><a href="http://codelab.files.wordpress.com/2011/09/ipod_stereo_tunnel.jpg"><img src="http://codelab.files.wordpress.com/2011/09/ipod_stereo_tunnel.jpg?w=300" alt="My3D ipod stereo tunnel" title="My3D ipod stereo tunnel" class="alignleft size-medium wp-image-219" /></a><br />
So, it was with great enthousiasm that I learned there&#8217;s a cheap and simple stereoscopic viewing contraption for the iphone produced by hasbro. It&#8217;s sortof like a <a href="http://en.wikipedia.org/wiki/View-Master">viewmaster</a>, only instead of cardboard reel with stereoscopic pictures, it has a place to attach an iphone or ipod touch on the back of it, using it as the source of the stereoscopic image presented to the user. What needs to be done iphone-side is simple enough. Just make it display a stereo pair side by side in a split-screen. The only drawback of this approach, is that since the iphone display is split in half, the achievable aspect ratio is slightly less than 1 which has an impact on immersion, making the perception more like looking through a squarish window into the 3D world rather than being surrounded by it. Still very impressive for a 28 dollar plastic widget.</p>
<p>Buying this apparatus gave me the final push I needed to get onto iOS programming. I find Objective-C unspeakably ugly and the Apple APIs needlessly convoluted, which was why I kept pushing this back, but I really wanted to see my code in glorious stereoscopic &#8230; glory, so I bit the bullet and ported over the stereoscopic tunnel program I&#8217;ve written originally for the SGI when I bought the shutter glasses.</p>
<p>The result is awesome; full stereo 3d without color degradation on modern programmable graphics hardware. Unfortunately one has to use the crippled version of OpenGL that&#8217;s become so popular on mobile devices lately: OpenGL ES 2.0 (<a href="http://codelab.wordpress.com/2011/06/21/webgl-hacks/">see webgl post for my rant on that issue</a>), but it was easy enough to make a wrapper that brings back immediate mode and the matrix stack.</p>
<p>In case you&#8217;d like to play around with the code, <a href="http://nuclear.mutantstargoat.com/sw/istereo.tar.gz">here&#8217;s a tarball</a>. Feel free to use it under the terms of the GPLv3. It includes an Xcode project that compiles it for the iphone and a makefile for normal systems. If you run the program on your iphone tap anywhere on the screen to go to the options GUI to enable stereo rendering or change between the simple and the normal-mapped tunnel (keys s and b on the PC version).</p>
<table>
<tr>
<td><a href="http://codelab.files.wordpress.com/2011/09/tunnel-mono.jpg"><img src="http://codelab.files.wordpress.com/2011/09/tunnel-mono.jpg?w=150&#038;h=100" alt="" title="tunnel-mono" width="150" height="100" class="alignleft size-thumbnail wp-image-220" /></a></td>
<td><a href="http://codelab.files.wordpress.com/2011/09/tunnel-mono-nmap.jpg"><img src="http://codelab.files.wordpress.com/2011/09/tunnel-mono-nmap.jpg?w=150&#038;h=100" alt="" title="tunnel-mono-nmap" width="150" height="100" class="alignleft size-thumbnail wp-image-221" /></a></td>
</tr>
<tr>
<td><a href="http://codelab.files.wordpress.com/2011/09/tunnel-stereo.jpg"><img src="http://codelab.files.wordpress.com/2011/09/tunnel-stereo.jpg?w=150&#038;h=100" alt="" title="tunnel-stereo" width="150" height="100" class="alignleft size-thumbnail wp-image-222" /></a></td>
<td><a href="http://codelab.files.wordpress.com/2011/09/tunnel-stereo-nmap.jpg"><img src="http://codelab.files.wordpress.com/2011/09/tunnel-stereo-nmap.jpg?w=150&#038;h=100" alt="" title="tunnel-stereo-nmap" width="150" height="100" class="alignleft size-thumbnail wp-image-223" /></a></td>
</tr>
<tr>
<td><a href="http://codelab.files.wordpress.com/2011/09/tunnel-options-gui.jpg"><img src="http://codelab.files.wordpress.com/2011/09/tunnel-options-gui.jpg?w=150&#038;h=100" alt="" title="tunnel-options-gui" width="150" height="100" class="alignleft size-thumbnail wp-image-224" /></a></td>
<td></td>
</tr>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=217&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/09/11/stereoscopic-fun-on-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/ipod_stereo_tunnel.jpg?w=300" medium="image">
			<media:title type="html">My3D ipod stereo tunnel</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/tunnel-mono.jpg?w=150" medium="image">
			<media:title type="html">tunnel-mono</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/tunnel-mono-nmap.jpg?w=150" medium="image">
			<media:title type="html">tunnel-mono-nmap</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/tunnel-stereo.jpg?w=150" medium="image">
			<media:title type="html">tunnel-stereo</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/tunnel-stereo-nmap.jpg?w=150" medium="image">
			<media:title type="html">tunnel-stereo-nmap</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/09/tunnel-options-gui.jpg?w=150" medium="image">
			<media:title type="html">tunnel-options-gui</media:title>
		</media:content>
	</item>
		<item>
		<title>WebGL hacks</title>
		<link>http://codelab.wordpress.com/2011/06/21/webgl-hacks/</link>
		<comments>http://codelab.wordpress.com/2011/06/21/webgl-hacks/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 01:28:32 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[opengl es]]></category>
		<category><![CDATA[sanegl]]></category>
		<category><![CDATA[webgl]]></category>
		<category><![CDATA[webgl-tools]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=193</guid>
		<description><![CDATA[That&#8217;s it, I finally found something fun in web development! I never thought I&#8217;d live to see the day when I would feel the motivation to learn javascript, but here we are. WebGL is fun, because you can do all the things you could with regular OpenGL, but now you can send URLs to all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=193&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://nuclear.mutantstargoat.com/webgl/webrtjulia"><img src="http://codelab.files.wordpress.com/2011/06/juliaquat.jpg?w=780" alt="webgl julia quaternion raytracer" title="Julia quaternion raytracer thumbnail"   class="alignleft size-full wp-image-194" /></a>That&#8217;s it, I finally found something fun in web development! I never thought I&#8217;d live to see the day when I would feel the motivation to learn javascript, but here we are. WebGL is fun, because you can do all the things you could with regular OpenGL, but now you can send URLs to all your friends to show off. I can&#8217;t say I liked javascript really, but I guess it&#8217;s passable as long as you can avoid the horrible conventions people have established for pretending to write object-oriented code with it.</p>
<p>So what I did, after experimenting to see how WebGL and javascript programming works, is a port of a GPU-raytracer for 4D quaternion Julia fractals, and a simple 360-panorama viewer. You can find those on my <a href="http://nuclear.mutantstargoat.com/webgl/">webgl hacks</a> page I put up yesterday.</p>
<p>About WebGL itself now, I&#8217;m really disappointed they chose to base it on OpenGL ES 2.0, which is the bastard child of a slashed down OpenGL subset initially spec&#8217;ed for fixed point embedded devices, and Khronos&#8217; OpenGL &gt;= 3 d3d10-buttlicking madness. I understand why they chose that, because they intend to have WebGL easily implementable on mobile phones and tablets, but I&#8217;m still disappointed.</p>
<p>For those of you not well versed in the differences between the various OpenGL versions that suddenly crept up when Khronos group took control of OpenGL and apparently surrendered it over to inmates of the nearest insane asylum, I&#8217;ll give you a short overview of what sucks in OpenGL &gt;= 3.x, OpenGL ES 2.0, and WebGL:</p>
<ul>
<li>No fixed function pipeline. Yeah I know shaders are awesome, I love them too. But it&#8217;s convenient to be able to put a goddamn texture on a quad without having to write a bloody shader for it. OpenGL is <strong>not</strong> just used for video games you know.</li>
<li>No immediate mode (glBegin). Again, yes immediate mode is slow if you use it to draw multimillion vertex meshes, but having to make a vertex buffer for a quad representing a button in a GUI or a simple overlay, is insanity.</li>
<li>No matrix stack. Obviously when I&#8217;m writing a full 3D engine, with hierarchical keyframe animation, I have to ignore the matrix stack and write my own quaternion/matrix code. But for everything else, the OpenGL matrix functions are unbelievably useful.</li>
<li>No GL_QUADS.</li>
</ul>
<p>So anyway, while I was playing around with it these past few days, I had to bring back a little bit of sanity to WebGL. For that reason I wrote <a href="https://nuclear.mutantstargoat.com/hg/webgl-tools/file/3c42ff114e49/sanegl.js">SaneGL</a>, a small piece of code that implements immediate mode drawing, and the OpenGL matrix stack on top of WebGL. I bundled that along with a small matrix math library and some helper functions for WebGL programs in a project called webgl-tools, which you can find in my mercurial repository: <a href="https://nuclear.mutantstargoat.com/hg/webgl-tools">https://nuclear.mutantstargoat.com/hg/webgl-tools</a>.</p>
<p>Oh by the way, if you&#8217;re one of those misguided sods that keep using windows, and you try to run any webgl apps right now you will probably be disappointed. In an unprecedented inspiration of pure stupidity, both firefox4 and chrome chose to implement WebGL over Direct3D by default on windows, using a project called <a href="http://code.google.com/p/angleproject/">ANGLE</a>. The reason for that, they say, is that most graphics card vendors provide buggy OpenGL implementations on windows, so apparently it makes sense to write an even more buggy OpenGL-&gt;D3D translator and use that.</p>
<p>Initially I thought that ANGLE fails to translate huge shaders such as the one on my fractal raytracer, but in fact it seems to fail on pretty much everything, complex or trivial. The only way for windows users to use WebGL at the moment until mozilla and google comes to their senses and make ANGLE a fallback for known buggy OpenGL implementations instead of the default choice, is to go and force the browsers to use OpenGL instead. On firefox you can do that by setting the about:config variable &#8220;webgl.prefer-native-gl&#8221; to true, while chrome requires the command-line argument: &#8211;use-gl=desktop.</p>
<p>On GNU/Linux, as long as you have an nvidia card everything should be peachy from the get-go. Other cards are apparently blacklisted by firefox, so you&#8217;ll have to set webgl.force-enable to true, and pray to Odin.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=193&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/06/21/webgl-hacks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2011/06/juliaquat.jpg" medium="image">
			<media:title type="html">Julia quaternion raytracer thumbnail</media:title>
		</media:content>
	</item>
		<item>
		<title>Escaping glutMainLoop</title>
		<link>http://codelab.wordpress.com/2011/05/14/escaping-glutmainloop/</link>
		<comments>http://codelab.wordpress.com/2011/05/14/escaping-glutmainloop/#comments</comments>
		<pubDate>Sat, 14 May 2011 16:25:37 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[freeglut]]></category>
		<category><![CDATA[glut]]></category>
		<category><![CDATA[glutMainLoop]]></category>
		<category><![CDATA[glutMainLoopEvent]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[simplygl]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=179</guid>
		<description><![CDATA[Let&#8217;s say you&#8217;re writing a distinctly glut-like window-system abstraction library for OpenGL context creation, event handling, etc. For those not familliar with the way one uses OpenGL to draw graphics, what happens is you talk to the native window system (X11, Win32 API, etc) to create a window and process events, then you create an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=179&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you&#8217;re writing a distinctly glut-like window-system abstraction library for OpenGL context creation, event handling, etc. For those not familliar with the way one uses OpenGL to draw graphics, what happens is you talk to the native window system (X11, Win32 API, etc) to create a window and process events, then you create an OpenGL context and you bind it to that window using again platform-specific calls (GLX, WGL, etc).</p>
<p>So let&#8217;s say you&#8217;re writing that code, but you decided your library will allow the user to keep control of the main loop, so you provide a funcion called something like <code>process_events</code> to run a single iteration of your event processing, so that the user may call it in a loop. How do you implement that on top of glut, which has a single glutMainLoop function that doesn&#8217;t ever return?</p>
<p>By the way, for those qurious on why would you do that in the first place, the reason to write a glut backend for this library, would be as a catch-all fallback to be able to run on platforms for which no native backend is yet written.</p>
<p>On GNU/Linux systems generally we don&#8217;t have the original GLUT, but rather FreeGLUT, which is nice enough to provide a <code>glutMainLoopEvent</code> function which runs a single iteration of the event loop, so we just call that from process_events and we&#8217;re done. But I have actually written an X11/GLX backend for my library, so I don&#8217;t need GLUT there, I need it on other systems. So how to break the chains of <code>glutMainLoop</code> and return after each iteration of the event handling loop?</p>
<p>The solution is obvious, use setjmp/longjmp. In <code>process_events</code> we call setjmp which obviously returns 0 the first time around, in which case glutMainLoop is called. Now glut enters its infinite loop and waits for events from the window system. As soon as all pending events are processed, or if there are no events to be processed, it calls our idle callback, then when that returns it loops back to the top again, and again, and again.</p>
<p>Of course we set up an idle callback that doesn&#8217;t actually return. It calls the user&#8217;s idle callback if there&#8217;s one registered, and then calls longjmp which unwinds the stack until we end up back into <code>process_events</code> at which point setjmp returns non-zero and we return execution to the user.</p>
<p>One minor issue that needs to be addressed is that since we set an idle function, if the user didn&#8217;t set one with our library, we&#8217;re wasting cpu cycles busy-looping because GLUT will never block waiting for events when there&#8217;s an idle callback. This again is easily remedied. If the user didn&#8217;t register an idle function with us, we don&#8217;t actually set our idle function to GLUT a-priori, instead we wait for one of the other event callbacks to trigger, and at the end of those callbacks we set the idle callback, and remove it again when it gets called, before longjmping back to the user.</p>
<p>Here are a few snippets of the actual code demonstrating the above:<br />
<span id="more-179"></span></p>
<p><code>
<pre>
static int process_events(void)
{
#ifdef FREEGLUT
    glutMainLoopEvent();
#else
    if(setjmp(jbuf) == 0) {
        glutMainLoop();
    }
    /* ok ... what happens is any callback that kicks in will set the idle func
     * if it's not set,  and then the idle func will longjmp right back here...
     */
#endif
    return 0;
}

static void reshape_cb(int x, int y)
{
    sgl_reshape_callback_t func = sgl_get_callback(SGL_RESHAPE);
    func(x, y);

#ifndef FREEGLUT
    glutIdleFunc(idle_cb);
#endif
}

static void idle_cb(void)
{
    sgl_idle_callback_t func = sgl_get_callback(SGL_IDLE);
    if(func) {
        func();
#ifndef FREEGLUT
    } else {
        /* this was just the longjmp trick so restore the lack of idle func */
        glutIdleFunc(0);
#endif
    }

#ifndef FREEGLUT
    longjmp(jbuf, 0);
#endif
}
</code></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=179&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/05/14/escaping-glutmainloop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>
	</item>
		<item>
		<title>Linuxtrack 6dof headtracking for wine games</title>
		<link>http://codelab.wordpress.com/2011/02/27/linuxtrack-6dof-headtracking-for-wine-games/</link>
		<comments>http://codelab.wordpress.com/2011/02/27/linuxtrack-6dof-headtracking-for-wine-games/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 06:06:25 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[6dof headtracking]]></category>
		<category><![CDATA[linuxtrack]]></category>
		<category><![CDATA[linuxtrack-wine]]></category>
		<category><![CDATA[trackir]]></category>
		<category><![CDATA[wine]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=164</guid>
		<description><![CDATA[Since I was a little kid, I always loved airplanes. When I became a little older, mainly during the 90s I used to play a lot of flight simulators on my computer, I even had a set of decent flight controls (stick/throttle), but for some reason I dropped that hobby for many years. Until I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=164&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="float:left;padding:8px;" src="http://code.google.com/p/linuxtrack-wine/logo?cct=0" alt="linuxtrack-wine logo">Since I was a little kid, I always loved airplanes. When I became a little older, mainly during the 90s I used to play a lot of flight simulators on my computer, I even had a set of <a href="http://codelab.files.wordpress.com/2011/02/stick_throttle.jpg">decent flight controls (stick/throttle)</a>, but for some reason I dropped that hobby for many years. Until I very recently picked it up again.</p>
<p>One really important thing that changed during my abstinence from flight simulators, a huge change that transformed the whole experience, was the almost universal adoption of 6dof headtracking for looking around as you fly!</p>
<p>Now people are able, with simple intuitive movements of their head to be able to look outside as they fly above that beautiful lake, &#8220;check six&#8221; to effectively maneuver to avoid an enemy plane in a dogfight, or follow the runway with their own eyes as the airplane turns slowly into final approach to line up perfectly for landing! Even better, since 6dof headtracking includes translation as well as rotation, the user can look around an obstacle blocking the view, to see for instance a pesky instrumment in the panel that&#8217;s partly hidden behind the stick, or a plane in formation which happens to fly just where the canopy frame happens to have a metal support bar. Just moving the head a bit to the left or the right does the trick&#8230; Unbelivable!</p>
<p>Instrumental for the universal adoption of 6dof headtracking among flight simulator users and developers, is a company called NaturalPoint who sells a complete head-tracking system called <a href="http://www.naturalpoint.com/trackir/">TrackIR</a>, that includes an infrared high framerate camera, markers that the user attaches to their heads, and supplies an API to game developers to access their headtracking data easily. Now that set doesn&#8217;t come cheap, so there&#8217;s the necessary free alternative out there, that works with a simple (or even better modified) webcam, called <a href="http://www.free-track.net/english/">freetrack</a>. The main problem with both of those as you might have guessed, is that they only work on windows.</p>
<p>After the first dissapointment, I obviously <em>had</em> to have that functionality, so I decided to start hacking <a href="http://codelab.wordpress.com/2008/02/03/3d-vr-headtracking-test/">my old 3dof headtracking experiment</a> to make it 6dof and connect it somehow with games running through wine. However, while I was researching how to do that, I stumbled upon the <a href="http://code.google.com/p/linux-track/">linux-track</a> project, which does exactly what I needed, but it only worked with a native GNU/Linux flight simulator called <a href="http://www.x-plane.com">x-plane</a>.</p>
<p>So, with only a small piece of the puzzle missing, I went on and wrote a program that emulates the TrackIR API which is supported by <a href="http://www.naturalpoint.com/trackir/03-enhanced-games/enhanced-games-all.html">many windows games</a>, but feeds them data from linuxtrack instead. Currently I&#8217;m happily playing <a href="http://en.wikipedia.org/wiki/IL-2_Sturmovik_%28video_game%29">IL-2 Sturmovik</a> and <a href="http://en.wikipedia.org/wiki/Falcon_4.0:_Allied_Force">Falcon4 AF</a> through wine, with full head-tracking support, enjoying the virtual view from my cockpit.</p>
<p>This new project of mine is called <a href="http://code.google.com/p/linuxtrack-wine/">linuxtrack-wine</a> and is available under GNU GPLv3.</p>
<p>I also had to do a hardware hack, to convert my old flight controllers from gameport to USB, but that&#8217;s much less interesting, and I&#8217;m too lazy to write about it right now :)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=164&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/02/27/linuxtrack-6dof-headtracking-for-wine-games/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://code.google.com/p/linuxtrack-wine/logo?cct=0" medium="image">
			<media:title type="html">linuxtrack-wine logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Kernel Development from Scratch</title>
		<link>http://codelab.wordpress.com/2011/02/03/kernel-development-from-scratch/</link>
		<comments>http://codelab.wordpress.com/2011/02/03/kernel-development-from-scratch/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 19:08:19 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[kernel development]]></category>
		<category><![CDATA[linux inside]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=157</guid>
		<description><![CDATA[I&#8217;ve started a series of articles for the new Greek magazine: Linux Inside. The articles aim to introduce the reader to kernel development, by starting from scratch and building up a small working kernel. The first issue of Linux Inside, which should be available by now, includes the first part of the series which covers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=157&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started a series of articles for the new Greek magazine: <a href="http://www.linuxinside.gr">Linux Inside</a>. The articles aim to introduce the reader to kernel development, by starting from scratch and building up a small working kernel.</p>
<p>The first issue of Linux Inside, which should be available by now, includes the first part of the series which covers setting up the development tools for compiling and running the kernel both on the real machine and in a simulator, bootstrapping with multiboot boot loaders, and text output by driving the VGA in text mode.</p>
<p>For obvious reasons the full source code supplementing each article could not fit in the pages of the magazine, only the most relevant snippets are included. So make sure to follow the URL at the start of the article to download the full source code and have it handy while you read. The source code for the first article can be found <a href="http://nuclear.sdf-eu.org/articles/kerneldev/src/kerneldev1.tar.gz">here</a>.</p>
<p>So go grab a copy of the Linux Inside magazine and let me know what you think. Each article will also contain exercises for the readers, so have a go at them and <a href="mailto:nuclear@member.fsf.org">send me your code</a>! I&#8217;ll try to include it in the next issue.</p>
<p>Oh and of course each article will be released under a free license (I&#8217;m thinking either <a href="http://www.gnu.org/licenses/fdl.html">GNU FDL</a> or <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA</a>) when each issue goes out of circulation.</p>
<p>edit: Just made a <a href="http://nuclear.sdf-eu.org/articles/kerneldev/">website for the series</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=157&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2011/02/03/kernel-development-from-scratch/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>
	</item>
		<item>
		<title>Serial Spaceball and Spacenavd</title>
		<link>http://codelab.wordpress.com/2010/06/07/serial-spaceball-and-spacenavd/</link>
		<comments>http://codelab.wordpress.com/2010/06/07/serial-spaceball-and-spacenavd/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 02:57:27 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[6dof]]></category>
		<category><![CDATA[free spacenav]]></category>
		<category><![CDATA[libsball]]></category>
		<category><![CDATA[space navigator]]></category>
		<category><![CDATA[spaceball]]></category>
		<category><![CDATA[spaceball 4000 flx]]></category>
		<category><![CDATA[spacenavd]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=150</guid>
		<description><![CDATA[I finally got my hands on a serial spaceball device. Apparently non-USB devices are literally given away on ebay for ridiculously small amounts of money, so I managed to get this wonderful Spaceball 4000 FLX for 12 pounds a couple of days ago! I wanted a serial spaceball for two reasons: first of all I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=150&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I finally got my hands on a serial spaceball device. Apparently non-USB devices are literally given away on ebay for ridiculously small amounts of money, so I managed to get this wonderful Spaceball 4000 FLX for 12 pounds a couple of days ago!</p>
<p><a href="http://codelab.files.wordpress.com/2010/06/spaceballs.jpg"><img src="http://codelab.files.wordpress.com/2010/06/spaceballs.jpg?w=300&#038;h=222" alt="spaceballs" title="spaceballs" width="300" height="222" class="alignnone size-medium wp-image-151" /></a></p>
<p>I wanted a serial spaceball for two reasons: first of all I meant to add support for serial devices to <a href="http://spacenavd.sourceforge.net">spacenavd</a> for a long time now. In fact John Stone was kind enough to send me his <a href="http://jedi.ks.uiuc.edu/~johns/projects/libsball">code to interface with serial spaceballs</a> a long time ago, but not having such a device myself, for testing, I wasn&#8217;t very keen to hack at it blindly. Also, I wanted to be able to use a 6dof input device with my SGI Octane2, which doesn&#8217;t have any USB ports.</p>
<p>So finally, as soon as I got my hands on the serial spaceball, I went on and added serial support to spacenavd. I haven&#8217;t released a new version of spacenavd yet, because I want to iron out some details first, but you can always get the new serial-capable spacenavd through subversion if you need it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=150&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2010/06/07/serial-spaceball-and-spacenavd/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/06/spaceballs.jpg?w=300" medium="image">
			<media:title type="html">spaceballs</media:title>
		</media:content>
	</item>
		<item>
		<title>Wacom Hacking</title>
		<link>http://codelab.wordpress.com/2010/02/21/wacom-hacking/</link>
		<comments>http://codelab.wordpress.com/2010/02/21/wacom-hacking/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 11:02:23 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[intuos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linuxwacom]]></category>
		<category><![CDATA[pl2303]]></category>
		<category><![CDATA[rs232]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[wacom]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=128</guid>
		<description><![CDATA[Recently, I acquired a rather old Wacom Intuos A5 tablet, for reasons I won&#8217;t delve into at the moment. It&#8217;s an old serial model, and although I don&#8217;t have a serial port anymore, I do have a USB-to-serial adapter, which thought would probably work fine with the X.org driver produced by the linuxwacom project, since [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=128&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I acquired a rather old Wacom Intuos A5 tablet, for reasons I won&#8217;t delve into at the moment.</p>
<p><a href="http://codelab.files.wordpress.com/2010/02/wacom_intuos_a5_serial.jpg"><img src="http://codelab.files.wordpress.com/2010/02/wacom_intuos_a5_serial.jpg?w=300&#038;h=225" alt="Wacom Intuos A5 Serial" title="Wacom Intuos A5 Serial" width="300" height="225" class="alignnone size-medium wp-image-129" /></a></p>
<p>It&#8217;s an old serial model, and although I don&#8217;t have a serial port anymore, I do have a USB-to-serial adapter, which thought would probably work fine with the X.org driver produced by the linuxwacom project, since they do mention support for serial tablets on their website.</p>
<p>I plugged it in, followed the linuxwacom documentation about setting everything up in xorg.conf, and fired up the X server. Nothing happened&#8230; So I started digging in the wacom driver source.</p>
<h3>First Obstacle: Prolific PL2303 USB Serial Port</h3>
<p>The first problem I encountered was with my USB-serial adaptor. Apparently, the wacom driver used a TCIOCGSERIAL ioctl, which is supposed to return information on a serial device, to determine if it&#8217;s talking to a serial or a USB device. If the ioctl fails, it thinks it&#8217;s not talking to a serial device, and starts talking USB HID to the tablet.</p>
<p>Unfortunately, the pl2303 driver in the linux kernel (as of version 2.6.32.8 that I tested) does not implement the aforementioned ioctl, even though it&#8217;s supposed to present a proper serial port to the system. So I had to hack the kernel, and add that ioctl in the pl2303 driver (<a href="http://nuclear.mutantstargoat.com/sw/pl2303-ioctl_cgserial.patch">patch against 2.6.32.8</a>).</p>
<p>(edit: my pl2303 patch got included in linux 2.6.34, so you don&#8217;t need the patch any more)</p>
<p>Sadly however, although now the wacom driver realized that it was dealing with a serial device, the tablet still didn&#8217;t work&#8230;</p>
<h3>Second Obstacle: The linuxwacom Driver</h3>
<p>After a lot of digging around the source of multiple wacom driver versions, it turns out the guys at the linuxwacom project <em>removed</em> the code for old serial tablets from the driver sometime last year!</p>
<p>I tried installing a few older versions of the driver (anything prior to 0.9.1 had the serial code), but they would not compile with the much newer X.org headers in my system. Apparently some changes with the XInput extension broke the old driver. So I started hacking again.</p>
<p>First I tried back-porting the XInput changes from the newer wacom driver to the old 0.8.4 version, but although I managed to compile it, it would segfault upon being loaded by the X server. Evidently I screwed something up during the backport, which I could have probably fixed eventually, but I realized that it&#8217;s a bad idea to get stuck to the old wacom driver.</p>
<p>So instead I started from scratch in the opposite direction, re-integrating the old serial code from 0.8.4 to the most recent 0.10.4 wacom driver.</p>
<h3>Success!</h3>
<p>And indeed after a few hours of hacking, I managed to get my serial Wacom Intuos to work perfectly! <a href="http://nuclear.mutantstargoat.com/sw/xwacom_restore_serial.patch">Here&#8217;s the patch</a> in case anyone needs it.</p>
<p>I must say it&#8217;s an impressive input device, pressure-sensitivity, tilt sensing, everything works perfectly. The only problem is that I still can&#8217;t draw any more than I could on paper :)</p>
<p><a href="http://codelab.files.wordpress.com/2010/02/craptoon22.png"><img src="http://codelab.files.wordpress.com/2010/02/craptoon22.png?w=300&#038;h=203" alt="" title="craptoon2" width="300" height="203" class="alignnone size-medium wp-image-138" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=128&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2010/02/21/wacom-hacking/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/02/wacom_intuos_a5_serial.jpg?w=300" medium="image">
			<media:title type="html">Wacom Intuos A5 Serial</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/02/craptoon22.png?w=300" medium="image">
			<media:title type="html">craptoon2</media:title>
		</media:content>
	</item>
		<item>
		<title>Stereoscopic OpenGL part2</title>
		<link>http://codelab.wordpress.com/2010/01/06/stereoscopic-opengl-part2/</link>
		<comments>http://codelab.wordpress.com/2010/01/06/stereoscopic-opengl-part2/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 01:58:16 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[asus vr100]]></category>
		<category><![CDATA[octane2]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[sgi]]></category>
		<category><![CDATA[shutter glasses]]></category>
		<category><![CDATA[stereoscopic]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=118</guid>
		<description><![CDATA[My obsession with stereoscopic rendering continues unabated. It&#8217;s just so fucking cool to write a bit of code and have 3D objects pop outside of your monitor and float above your keyboard. Fact is, I couldn&#8217;t settle with my crummy anaglyph glasses see previous post. I had to try out proper shutter glasses and quad-buffer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=118&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://codelab.files.wordpress.com/2010/01/nuc_shutter_glasses2.jpg"><img src="http://codelab.files.wordpress.com/2010/01/nuc_shutter_glasses2.jpg?w=150&#038;h=112" alt="Me with my shutter glasses" title="Playing with stereoscopic rendering with my shutter glasses and my SGI workstation" width="150" height="112" class="alignleft size-thumbnail wp-image-124" /></a>My obsession with stereoscopic rendering continues unabated. It&#8217;s just so fucking cool to write a bit of code and have 3D objects pop outside of your monitor and float above your keyboard.</p>
<p>Fact is, I couldn&#8217;t settle with my crummy anaglyph glasses <a href="http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/">see previous post</a>. I <em>had</em> to try out proper shutter glasses and quad-buffer OpenGL visuals.</p>
<p>Thanks to nvidia&#8217;s policy of supporting quad-buffer visuals and stereo ports only on expensive Quadro graphics boards, and the proliferation of flat panels which are entirely unsuitable for use with shutter glasses due to ridiculously low refresh rates, I couldn&#8217;t do that with my PC. On the other hand, my trusty Silicon Graphics Octane2 workstation was more than up to the task as it comes with a stereo synchronization port and quad-buffered OpenGL support out of the box.</p>
<p>So off I go to ebay, where I bought the cheapest lcd shutter glasses I could find, the ASUS VR100 glasses which came once upon a time bundled with some expensive ASUS TNT2 graphics cards as a high-end gimmick.</p>
<p><a href="http://codelab.files.wordpress.com/2010/01/sgi2asusvr_adaptor.jpg"><img src="http://codelab.files.wordpress.com/2010/01/sgi2asusvr_adaptor.jpg?w=150&#038;h=112" alt="SGI to ASUS VR100 adaptor circuit" title="SGI to ASUS VR100 adaptor circuit" width="150" height="112" class="alignright size-thumbnail wp-image-119" /></a>Connecting these glasses to SGI workstations <a href="http://www.roosmcd.dds.nl/oldsite/index.htm">has been done before</a> and it was a piece of cake to follow that guy&#8217;s schematic and construct the necessary circuit to translate the signals from the SGI stereo port to those required by the shutter glasses.</p>
<p>The only problem I&#8217;ve had, is that my Octane2 has the low-end V6 graphics option, which apparently doesn&#8217;t provide a z-buffer when using stereo visuals.</p>
<p><a href="http://codelab.files.wordpress.com/2010/01/stereo_tunnel.jpg"><img src="http://codelab.files.wordpress.com/2010/01/stereo_tunnel.jpg?w=150&#038;h=112" alt="3D tunnel" title="3D tunnel" width="150" height="112" class="alignleft size-thumbnail wp-image-122" /></a>Now I didn&#8217;t feel like z-sorting all polygons like the good old days when z-buffering was too expensive to use on underpowered PCs while doing software polygon rendering, so I tried to figure out a couple of graphics hacks that I could do which wouldn&#8217;t require a z-buffer to look right. So I came up with this <a href="http://apricot.hep.ntua.gr/~nuclear/files/stereo_tunnel.tar.gz">swirling tunnel</a>, and a simple <a href="http://apricot.hep.ntua.gr/~nuclear/files/quadgltest.tar.gz">wireframe teapot</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=118&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2010/01/06/stereoscopic-opengl-part2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/01/nuc_shutter_glasses2.jpg?w=150" medium="image">
			<media:title type="html">Playing with stereoscopic rendering with my shutter glasses and my SGI workstation</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/01/sgi2asusvr_adaptor.jpg?w=150" medium="image">
			<media:title type="html">SGI to ASUS VR100 adaptor circuit</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2010/01/stereo_tunnel.jpg?w=150" medium="image">
			<media:title type="html">3D tunnel</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenGL stereoscopic anaglyphs and patents</title>
		<link>http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/</link>
		<comments>http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 01:27:51 +0000</pubDate>
		<dc:creator>Nuclear</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[anaglyph]]></category>
		<category><![CDATA[anaglyphs]]></category>
		<category><![CDATA[colorcode]]></category>
		<category><![CDATA[colorcode3d]]></category>
		<category><![CDATA[graphics programming]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[red/blue]]></category>
		<category><![CDATA[red/cyan]]></category>
		<category><![CDATA[stereoscopic]]></category>

		<guid isPermaLink="false">http://codelab.wordpress.com/?p=95</guid>
		<description><![CDATA[An anaglyph is a combination of two images into one, in such a way that they can later be separated by viewing the image through appropriately colored transparent filters. The objective is to present slightly shifted views of the same 3D environment to each eye, in order to achieve depth perception (i.e. really perceive the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=95&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>An anaglyph is a combination of two images into one, in such a way that they can later be separated by viewing the image through appropriately colored transparent filters. The objective is to present slightly shifted views of the same 3D environment to each eye, in order to achieve depth perception (i.e. really perceive the 3rd dimension).</p>
<p><img src="http://codelab.files.wordpress.com/2009/10/ccglasses-thumb.jpg?w=780" alt="anaglyph glasses" title="ColorCode3D anaglyph glasses"   class="alignright size-full wp-image-96" /></p>
<p>I&#8217;ve never dealt with anaglyphs in the past, but during my recent week-old obsession with stereoscopy, I&#8217;ve stumbled upon a pair of free anaglyph viewing glasses (made out of cardboard and cellophane of course). So I couldn&#8217;t help but try to find out how I can use them with my own programs.<br />
<span id="more-95"></span></p>
<p>I dug up a small dungeon editor I&#8217;ve written some time ago, and hacked stereoscopic rendering into it. I implemented various stereo rendering modes including cross-eyed (side-by side images), quad-buffered (the native OpenGL stereo mode), and anaglyphs.</p>
<p>Quad-buffering is of course the ideal method to present stereo views in OpenGL, but it requires support from the graphics driver and expensive hardware such as <a href="http://en.wikipedia.org/wiki/Shutter_glasses">shutter glasses</a> or a pair of polarized projectors and <a href="http://en.wikipedia.org/wiki/Polarized_glasses">polarized glasses</a>.</p>
<p>The problem with the glasses that I&#8217;ve got is that all articles regarding anaglyphs I&#8217;ve found on the internet talked about either red/blue or red/cyan glasses, while mine was obviously neither. It turns out my glasses are for a new variety of anaglyphs which go by the name <em>ColorCode3D</em> and are supposed to be able to keep more color information than previous red/blue and red/cyan methods (which generally only work for grayscale images).</p>
<p>This color-code thing is apparently patented and there&#8217;s no mention anywhere on how to combine stereo images for viewing with color-code glasses. The company who owns the patent has released a program for converting stereo pairs of images to colorcode anaglyphs, which is of course proprietary and doesn&#8217;t come with source code, ergo useless.</p>
<p>Then I remembered that there&#8217;s an upside to a patented algorithm if you choose to completely disregard patent law, which I definitely do. In order for an algorithm to become patented, it must be described in detail in a patent application which must be filed at the patent office. All such patent documents are publicly available at the web site of the US patent office. So I just got the patent document, and implemented the algorithm from that description.</p>
<p>It turns out the process is extremely simple, although just outside the reach of the OpenGL fixed function pipeline, which can be used to handle red/blue and red/cyan anaglyphs easily by employing additive blending and color masks. To combine the left/right stereo pair into a single color-code compatible image:</p>
<ul>
<li>The red channel of the left image is used as the red channel of the output image.</li>
<li>The green channel of the left image is used as the green channel of the output image.</li>
<li>All three color channels of the right image are converted to grayscale as follows: <img src='http://s0.wp.com/latex.php?latex=%5Cleft%28r%5C+g%5C+b%5Cright%29+%5Ccdot+%5Cleft%280.15%5C+0.15%5C+0.7%5Cright%29&amp;bg=ffffff&amp;fg=494949&amp;s=0' alt='&#92;left(r&#92; g&#92; b&#92;right) &#92;cdot &#92;left(0.15&#92; 0.15&#92; 0.7&#92;right)' title='&#92;left(r&#92; g&#92; b&#92;right) &#92;cdot &#92;left(0.15&#92; 0.15&#92; 0.7&#92;right)' class='latex' />, and are used as the blue channel of the output image.</li>
</ul>
<p>Here&#8217;s the small GLSL program I used to combine the two left and right images, previously rendered into two textures:<br />
<code>
<pre>uniform sampler2D tex_left, tex_right;

void main()
{
	vec3 left = texture2D(tex_left, gl_TexCoord[0].st).rgb;
	vec3 right = texture2D(tex_right, gl_TexCoord[0].st).rgb;

	vec3 col, coeff = vec3(0.15, 0.15, 0.7);
	col.r = left.r;
	col.g = left.g;
	col.b = dot(right, coeff);

	gl_FragColor = vec4(col, 1.0);
}</pre>
<p></code></p>
<p>The result is fantastic, I&#8217;m using the space navigator to navigate in the 3D dungeon without taking my eyes off the screen, and the stereoscopic effect is very evident indeed, creating the illusion of depth quite effectively.</p>
<p>Here are a few of screenshots in both color-code and the more common red/cyan anaglyph variety (note that I don&#8217;t have red/cyan glasses, so I can only assume that the red/cyan rendering works correctly, I haven&#8217;t tested it).</p>
<p>The second one with the jutting pillar is particularly nice. The geometry crosses the zero-parallax plane into the negative subspace, making the pillar seem to &#8220;come out of the screen&#8221;.</p>
<p><a href="http://codelab.files.wordpress.com/2009/10/stereo1.jpg"><img src="http://codelab.files.wordpress.com/2009/10/stereo1.jpg?w=150&#038;h=112" alt="colorcode (amber/blue) anaglyph 1" title="colorcode (amber/blue) anaglyph 1" width="150" height="112" class="alignnone size-thumbnail wp-image-101" /></a><a href="http://codelab.files.wordpress.com/2009/10/stereo2.jpg"><img src="http://codelab.files.wordpress.com/2009/10/stereo2.jpg?w=150&#038;h=112" alt="colorcode (amber/blue) anaglyph 2" title="colorcode (amber/blue) anaglyph 2" width="150" height="112" class="alignnone size-thumbnail wp-image-101" /></a></p>
<p><a href="http://codelab.files.wordpress.com/2009/10/stereo_redcyan1.jpg"><img src="http://codelab.files.wordpress.com/2009/10/stereo_redcyan1.jpg?w=150&#038;h=112" alt="red/cyan anaglyph 1" title="red/cyan anaglyph 1" width="150" height="112" class="alignnone size-thumbnail wp-image-108" /></a><a href="http://codelab.files.wordpress.com/2009/10/stereo_redcyan2.jpg"><img src="http://codelab.files.wordpress.com/2009/10/stereo_redcyan2.jpg?w=150&#038;h=112" alt="red/cyan anaglyph 2" title="red/cyan anaglyph 2" width="150" height="112" class="alignnone size-thumbnail wp-image-109" /></a></p>
<p><b>References</b></p>
<ol>
<li><a href="http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/stereographics/stereorender">Paul Bourke, Calculating Stereo Pairs</a></li>
<li><a href="http://local.wasp.uwa.edu.au/~pbourke/texture_colour/anaglyph">Paul Bourke, Creating Anaglyphs using OpenGL</a></li>
<li><a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&amp;Sect2=HITOFF&amp;p=1&amp;u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&amp;r=1&amp;f=G&amp;l=50&amp;co1=AND&amp;d=PTXT&amp;s1=6,687,003.PN.&amp;OS=PN/6,687,003&amp;RS=PN/6,687,003">US Patent #6,687,003: Method for recording and viewing stereoscopic images in color using multichrome filters</a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codelab.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codelab.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codelab.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codelab.wordpress.com&amp;blog=2300657&amp;post=95&amp;subd=codelab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Nuclear</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2009/10/ccglasses-thumb.jpg" medium="image">
			<media:title type="html">ColorCode3D anaglyph glasses</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2009/10/stereo1.jpg?w=150" medium="image">
			<media:title type="html">colorcode (amber/blue) anaglyph 1</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2009/10/stereo2.jpg?w=150" medium="image">
			<media:title type="html">colorcode (amber/blue) anaglyph 2</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2009/10/stereo_redcyan1.jpg?w=150" medium="image">
			<media:title type="html">red/cyan anaglyph 1</media:title>
		</media:content>

		<media:content url="http://codelab.files.wordpress.com/2009/10/stereo_redcyan2.jpg?w=150" medium="image">
			<media:title type="html">red/cyan anaglyph 2</media:title>
		</media:content>
	</item>
	</channel>
</rss>
