<?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>A world in dk(decay/denmark) &#187; openGL</title>
	<atom:link href="http://rotand.dk/blog/tag/opengl/feed/" rel="self" type="application/rss+xml" />
	<link>http://rotand.dk/blog</link>
	<description>Just another pointless weblog</description>
	<lastBuildDate>Sat, 27 Jun 2009 19:17:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Collection of Processing.org hacks</title>
		<link>http://rotand.dk/blog/2009/02/27/collection-of-processingorg-hacks/</link>
		<comments>http://rotand.dk/blog/2009/02/27/collection-of-processingorg-hacks/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 20:07:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jar file]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openGL]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://rotand.dk/blog/?p=74</guid>
		<description><![CDATA[Its been quite a while since I last posted anything.
That doesn&#8217;t mean that i haven&#8217;t been coding small hacks, just that i haven&#8217;t posted them. But now is probably a good time to show some of the stuff.
As the title suggest it has something to do with processing.org. I have been using processing on and [...]]]></description>
			<content:encoded><![CDATA[<p>Its been quite a while since I last posted anything.</p>
<p>That doesn&#8217;t mean that i haven&#8217;t been coding small hacks, just that i haven&#8217;t posted them. But now is probably a good time to show some of the stuff.</p>
<p>As the title suggest it has something to do with processing.org. I have been using processing on and off for some time. Its is really nice when you want to make a quick hack, or as its called in processing a &#8220;sketch&#8221;.</p>
<p>In no particular order here is some of the fun stuff made using processing.</p>
<h3>General remarks</h3>
<p>The following sketches and their sourcecode have served as small hacks, hence don&#8217;t expect nice comments or optimal algorithms&#8230;</p>
<h2>shrinkImage</h2>
<p>It is possible to remove the line from a picture representing the least amount of information. The algorithm evaluates every pixels &#8220;weight&#8221; as the absolute difference between the different color channels (r,g,b). And then finds the &#8220;lightest path&#8221; from the bottom to the top.</p>
<p>This means that &#8220;prominent features&#8221; won&#8217;t be removed or change size when shrinking the image. Here the definition of &#8220;prominent features&#8221; is high difference in colors between the neighboring pixels.</p>
<p>Have a look at <a title="processing hack" href="http://rotand.dk/processing/shrinkImage" target="_self">shrinkImage</a></p>
<p>Room for optimizations :</p>
<p>Eventhough its quite quick at calculating the weights and finding the lightest path, it does so in every iteration. Letting it use a bit more memory and just recalculate the changes when removing a line should speed it up. I found a huge speedup when just having an array with the weights from the last and current line, when calculation the path, so not only would saving all weights require a bit more memory it would also slow down the first calculation. But I&#8217;m sure it would give a significant speed up in the next iterations, and a lot of +-1 frustrations <img src='http://rotand.dk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>helloFoo</h2>
<p>There a some quick getting to know processing hacks, this is one off the. <a href="http://rotand.dk/processing/helloFoo" target="_self">helloFoo</a></p>
<p>One of the very cool things about processing is the ability to use openGL, so originally this sketch uses openGL. But applets and openGL isn&#8217;t exactly the best combination. It can be done, but since it doesn&#8217;t work for me (firefox, linux openJDK JRE) i just converted it to standard java graphics. And the effort required to do this, is remove an import and don&#8217;t say setup(400,400, OPENGL) but just setup(400,400). This is trivially true the other way around. If you want to use openGL its quite easy.</p>
<p>The sketch is just bouncing balls, when going away from openGL I reduced the size and number of balls, in order to get a decent animation speed.</p>
<h2>FooIII</h2>
<p>Again used openGl originally <a href="http://rotand.dk/processing/FooIII" target="_self">FooIII</a></p>
<p>Some satellites rotating around some satellites rotating around some &#8230;.</p>
<h2>sndHello</h2>
<p>yes sketches tend to have silly names : <a href="http://rotand.dk/processing/sndHello">sndHello</a></p>
<p>From Clifford Pickovers  book : Computers, Pattern, Chaos, and Beauty &#8211; graphics from an unseen world (p 39 section 4.3 snowflakes from   sound)<br />
Draw symmetrically and in &#8220;polar form&#8221; the fft of the sound, hence creating snowflakes based on the sound.<br />
Music by <a href="http://www.davidrovics.com/">David Rovics</a><br />
Choppy sound I had some problems with the sound when run as an applet. You might have better luck using the <a href="http://rotand.dk/processing/sndHello/sndHello.jar">jar</a> directly or by downloading the sourcecode and running it with processing</p>
<h2>Slit-scanning</h2>
<p>The former applet relied on an external library for the sound, ther are quite a few libraries available. I did use <a href="http://users.design.ucla.edu/~acolubri/processing/gsvideo/home/">GSvideo</a> to hook up my crappy webcam and do some video effects. I experimented with slit-scanning in different ways.Unfortunately this won&#8217;t run as an applet and it might only run on Linux.</p>
<p>By creating a cube of the images, where the z-axis represents time, its possible to play back different parts of the movie from different layers in time. Which makes for some quite interesting and dizzing effects.</p>
<p>For example a time buble where playback is delayed around a &#8220;bulge in the timespace continuum&#8221; :s (a video of some guy playing with it (<a href="http://rotand.dk/processing/timebuble1.avi">timebuble1.avi</a>) some sourcecode for a similar effect where the mouse pointer moves the buble (<a href="http://rotand.dk/processing/TimeCube.pde">TimeCube.pde</a>) another more &#8220;traditional slitscan&#8221; (<a href="http://rotand.dk/processing/CamWarpTime.pde">CamWarpTime.pde</a>) .</p>
<p>In general there is plenty of room to fiddle with the code, there a functions like selectSlice or initQueues where its decided how to slice time. its great fun to play with..</p>
]]></content:encoded>
			<wfw:commentRss>http://rotand.dk/blog/2009/02/27/collection-of-processingorg-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://rotand.dk/processing/timebuble1.avi" length="2640804" type="video/x-msvideo" />
		</item>
	</channel>
</rss>
