<?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>nklein software &#187; Development</title>
	<atom:link href="http://nklein.com/topics/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Thu, 22 Dec 2011 04:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Animal Artwork and More Languages in iPhone Spelling App</title>
		<link>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/</link>
		<comments>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:09:02 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[New Versions]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1261</guid>
		<description><![CDATA[I just finished up some animal artwork for my iPhone Spelling Toy. I also added translations for Japanese and German (in addition to the English, French, and Spanish that were already there). After I double-check the translations, I will get it uploaded to the App Store. If you have any expertise in Spanish, French, German, [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished up some animal artwork for my iPhone Spelling Toy.  I also added translations for Japanese and German (in addition to the English, French, and Spanish that were already there).  After I double-check the translations, I will get it uploaded to the App Store.</p>
<p><center><a href="http://nklein.com/wp-content/uploads/2010/03/spell-fish.png"><img src="http://nklein.com/wp-content/uploads/2010/03/spell-fish.png" alt="" title="spell-fish" width="480" height="320" class="alignnone size-full wp-image-1262" /></a></center></p>
<p>If you have any expertise in Spanish, French, German, or Japanese, I&#8217;d appreciate any feedback you can give me about the <a href="http://nklein.com/spell-it-words/">words I chose in those languages</a>.  Would they be the word one would think of when shown the picture?  Thanks, in advance.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/03/animal-artwork-and-more-languages-in-iphone-spelling-app/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iPhone App Submitted To The App Store</title>
		<link>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/</link>
		<comments>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:19:52 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=1169</guid>
		<description><![CDATA[I just submitted my first my first iPhone app to the App Store. Once it is approved, I will announce it here.]]></description>
			<content:encoded><![CDATA[<p>I just submitted my first <a href="http://nklein.com/software/spell-it-iphone-app/">my first iPhone app</a> to the App Store.  Once it is approved, I will announce it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2010/02/iphone-app-submitted-to-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinking in the Car</title>
		<link>http://nklein.com/2009/06/thinking-in-the-car/</link>
		<comments>http://nklein.com/2009/06/thinking-in-the-car/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 13:52:50 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=580</guid>
		<description><![CDATA[I think best while driving. Unfortunately, I rarely have time to get my thoughts down in text when I get back home. There are a couple iPhone apps that claim to have voice-to-text: QuickVoice PRO w/Voice2Text, reQall, and Jott. It seems that reQall and Jott require me to sign up for their web services. reQall [...]]]></description>
			<content:encoded><![CDATA[<p>I think best while driving.  Unfortunately, I rarely have time to get my thoughts down in text when I get back home.</p>
<p>There are a couple iPhone apps that claim to have voice-to-text: <q>QuickVoice PRO w/Voice2Text</q>, <q>reQall</q>, and <q>Jott</q>.  It seems that <q>reQall</q> and <q>Jott</q> require me to sign up for their web services.  <q>reQall</q> has both a free and a pay web service.  <q>Jott</q> only seems to have a pay service.  So, I will probably try them in that order until I find one that I like or get frustrated with the whole process.</p>
<p>It seems that <q>QuickVoice PRO</q> uses <a href="http://www.spinvox.com/">SpinVox</a> to do their voice-to-text.  I am not impressed with the test message.  I said, <q>This is just a test.  open parenthesis foo close parenthesis.</q>  The email that I got back says:</p>
<blockquote><p><q>This is just a test of open(?) friends to see who close friends to see.</q> &#8211; spoken through SpinVox</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/06/thinking-in-the-car/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sneak Peek: Screenshot for Spelling iPhone App</title>
		<link>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/</link>
		<comments>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/#comments</comments>
		<pubDate>Wed, 06 May 2009 20:05:37 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=288</guid>
		<description><![CDATA[Earlier, I gave a sneak peek at some artwork for the children&#8217;s spelling game I am making for the iPhone. Here is a screenshot of the application (click for full size): I need to touch up the jaunty logo tiles in the upper left. Some of them are worse for the wear after the perspective [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier, I gave a <a href="http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/">sneak peek at some artwork</a> for the children&#8217;s spelling game I am making for the iPhone.  Here is a screenshot of the application (click for full size):<br />
<center><a href="http://nklein.com/wp-content/uploads/2009/05/spell-it-four.png"><img src="http://nklein.com/wp-content/uploads/2009/05/spell-it-four-300x159.png" alt="spell-it-four" title="spell-it-four" width="300" height="159" class="alignnone size-medium wp-image-290" /></a></center></p>
<p>I need to touch up the jaunty logo tiles in the upper left.  Some of them are worse for the wear after the perspective transformations and rotations.  More to follow&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/sneak-peek-screenshot-for-spelling-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exponential Spirals for Game Effects</title>
		<link>http://nklein.com/2009/05/exponential-spirals-for-game-effects/</link>
		<comments>http://nklein.com/2009/05/exponential-spirals-for-game-effects/#comments</comments>
		<pubDate>Mon, 04 May 2009 17:51:31 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[game design]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=265</guid>
		<description><![CDATA[In earlier posts, I mentioned finding polynomials, riffing off of damped harmonic motion, and then hitting on exponential spirals all trying to come up with a nice looking way to snap game tiles back into place when they are released. I want them to overshoot and then settle into place rather than snap directly into [...]]]></description>
			<content:encoded><![CDATA[<p>In earlier posts, I mentioned <a href="http://nklein.com/2009/04/find-the-polynomial-youve-been-looking-for/">finding polynomials</a>, <a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/">riffing off of damped harmonic motion</a>, and then <a href="http://nklein.com/2009/05/a-eureka-moment/">hitting on exponential spirals</a> all trying to come up with a nice looking way to snap game tiles back into place when they are released.  I want them to overshoot and then settle into place rather than snap directly into their spot.</p>
<h3>The Basic Spiral</h3>
<p>I am talking about a simple spiral of the form:<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_5c7a5dfe252b1e1d04ae968831814d30.png" title="\theta(t) = Kt" style="vertical-align:-20%;" class="tex" alt="\theta(t) = Kt" /></center> <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_8fcd17db24f8e548df04d4249cc15894.png" title="r(t) = \alpha\left(Kt\right)^{n}" style="vertical-align:-20%;" class="tex" alt="r(t) = \alpha\left(Kt\right)^{n}" /></center> for some integer <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_18a633fc025e2f1a862f7c8de3b31d6c.png" title="n" style="vertical-align:-20%;" class="tex" alt="n" />.</p>
<p>That would be an equation for a spiral that starts at the origin and heads outward as <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> increases.  For my application though, I want to end at the origin so I need to substitute <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_6c9b1142f71b0b5a6b24c00b99c8f1a5.png" title="1-t" style="vertical-align:-20%;" class="tex" alt="1-t" /> in for <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" />.  <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c08f3589a4375d6b7976b2258bab8abc.png" title="\theta(t) = K(1-t)" style="vertical-align:-20%;" class="tex" alt="\theta(t) = K(1-t)" /></center> <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_8fd9e991927911824d5cbc68b33e46f8.png" title="r(t) = \alpha\left(K(1-t)\right)^{n}" style="vertical-align:-20%;" class="tex" alt="r(t) = \alpha\left(K(1-t)\right)^{n}" /></center></p>
<p>The math is also going to work out slightly better if I use <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_d51a208cc9d5f74919f9a5d0ca1e09ac.png" title="n-2" style="vertical-align:-20%;" class="tex" alt="n-2" /> in place of <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_18a633fc025e2f1a862f7c8de3b31d6c.png" title="n" style="vertical-align:-20%;" class="tex" alt="n" /> in the above equations: <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c08f3589a4375d6b7976b2258bab8abc.png" title="\theta(t) = K(1-t)" style="vertical-align:-20%;" class="tex" alt="\theta(t) = K(1-t)" /></center> <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_69c047e0a9e6eb9696354cebcadb18dc.png" title="r(t) = \alpha\left(K(1-t)\right)^{n-2}" style="vertical-align:-20%;" class="tex" alt="r(t) = \alpha\left(K(1-t)\right)^{n-2}" /></center></p>
<p>I don&#8217;t want the piece to spiral into place when released though.  So, really, I am concerned with just the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_1a507c5494969dc6de305770cadc6630.png" title="x" style="vertical-align:-20%;" class="tex" alt="x" /> coordinate from the above equations: <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_5e7ac3bf4d7efe0da6ec76be9e9bafcc.png" title="x(t) = r(t) \cos \theta(t) = \alpha K^{n-2} (1-t)^{n-2} \cos \left(K\left(1-t\right)\right)" style="vertical-align:-20%;" class="tex" alt="x(t) = r(t) \cos \theta(t) = \alpha K^{n-2} (1-t)^{n-2} \cos \left(K\left(1-t\right)\right)" /></center></p>
<p>To normalize everything, I am going to let <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0e5e44c9a79f0a02bb2f353dc1e46d1a.png" title="\alpha = K^{2-n}" style="vertical-align:-20%;" class="tex" alt="\alpha = K^{2-n}" />.  And, since I want my interpolation value to go from zero to one instead of one to zero, I am again going to subtract this all from one: <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2195d2979907e1d41edc2160ee9e4aeb.png" title="x(t) = 1 -  (1-t)^{n-2} \cos \left(K\left(1-t\right)\right)" style="vertical-align:-20%;" class="tex" alt="x(t) = 1 -  (1-t)^{n-2} \cos \left(K\left(1-t\right)\right)" /></center></p>
<p><span id="more-265"></span></p>
<h3>Parametrizing by Arc Length</h3>
<p>If I just plot the spiral as is, then I am stuck with the same problem that I had with damped spring motion:  the frequency is constant.  The rate at which it would shimmy would not increase.  I want it to really settle into place.  So, I have to walk through the spiral at a fixed rate.  I need to rescale the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ffb09132255189b1b96b1e35156ebac1.png" title="(1-t)" style="vertical-align:-20%;" class="tex" alt="(1-t)" /> into something else so that for any given time interval, I cover the same arc length on the spiral.</p>
<p>The first step then is to figure out how much arc length I sweep out with any given <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" />.  Call this arc length <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_91c8733fdad1e8960345a6ed7c2876fc.png" title="s(t)" style="vertical-align:-20%;" class="tex" alt="s(t)" />: <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_6dc70cc2b7891d7417847ba6f0bc877e.png" title="s(t) = \int_0^{t} r(\tau) \theta(\tau) d\theta = \int_0^{t} - \alpha K^{n} (1 - \tau)^{n-1} d\tau" style="vertical-align:-20%;" class="tex" alt="s(t) = \int_0^{t} r(\tau) \theta(\tau) d\theta = \int_0^{t} - \alpha K^{n} (1 - \tau)^{n-1} d\tau" /></center> which comes out to: <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_54c0b6811ba2868b7342943cbee8bad2.png" title="s(t) = \frac{\alpha K^n}{n} \left(\left(1-t\right)^n-1\right)" style="vertical-align:-20%;" class="tex" alt="s(t) = \frac{\alpha K^n}{n} \left(\left(1-t\right)^n-1\right)" /></center></p>
<p>Then, to rescale my <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" />, I want to use <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_83d0feb46e59fb31e04c28f080b85af2.png" title="t'" style="vertical-align:-20%;" class="tex" alt="t'" /> instead so that <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_813a51472b6d24723a45e35a2807e18e.png" title="t' = \frac{s(t)}{s(1)}" style="vertical-align:-20%;" class="tex" alt="t' = \frac{s(t)}{s(1)}" />.  So, when <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_029c003e4631eb7982d298b06bef9e36.png" title="t' = \frac{1}{4}" style="vertical-align:-20%;" class="tex" alt="t' = \frac{1}{4}" />, for example, I will need to find the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> such that the arc length covered in the first <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> seconds is <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c78400c32272b1ce00c8785c0d99408d.png" title="\frac{1}{4}" style="vertical-align:-20%;" class="tex" alt="\frac{1}{4}" />-th of the arc length covered in the whole interval.  Solving for <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> in the equation <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_813a51472b6d24723a45e35a2807e18e.png" title="t' = \frac{s(t)}{s(1)}" style="vertical-align:-20%;" class="tex" alt="t' = \frac{s(t)}{s(1)}" /> comes out to:  <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ca375f933602b93fc0bdef182df31c78.png" title="t = 1 - \sqrt[n]{1-t'}" style="vertical-align:-20%;" class="tex" alt="t = 1 - \sqrt[n]{1-t'}" /></center></p>
<p>Plugging all of that back into the equation for <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2980c069e2e147070875ec659bb90764.png" title="x(t)" style="vertical-align:-20%;" class="tex" alt="x(t)" /> gives me:<br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_52e53acfaac85d56299824d890c35f2c.png" title="x(t) = 1 - \sqrt[n]{(1-t)^{n-2}} \cos \left(K\sqrt[n]{1-t}\right)" style="vertical-align:-20%;" class="tex" alt="x(t) = 1 - \sqrt[n]{(1-t)^{n-2}} \cos \left(K\sqrt[n]{1-t}\right)" /></center><br />
The simplest spiral here has <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_57adc49a1855f637d336bb87f20451ff.png" title="n = 3" style="vertical-align:-20%;" class="tex" alt="n = 3" />, and we will go around four times with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_630e308a4470b6fbbde955e475a3b403.png" title="K = 8\pi" style="vertical-align:-20%;" class="tex" alt="K = 8\pi" />:  <center><a href="http://nklein.com/wp-content/uploads/2009/05/simple-spiral.png"><img src="http://nklein.com/wp-content/uploads/2009/05/simple-spiral.png" alt="simple-spiral" title="simple-spiral" width="480" height="320" class="alignnone size-full wp-image-266" /></a></center></p>
<p>You can see how the period speeds up toward the end.  This was a good starting point.  However, the first oscillation goes almost as far beyond the target as our initial point was.  So, I upped the exponent to <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ff961597b47bca30f2bc0d971a7fba65.png" title="n = 9.5" style="vertical-align:-20%;" class="tex" alt="n = 9.5" />:  <center><a href="http://nklein.com/wp-content/uploads/2009/05/higher-order-spiral.png"><img src="http://nklein.com/wp-content/uploads/2009/05/higher-order-spiral.png" alt="higher-order-spiral" title="higher-order-spiral" width="480" height="320" class="alignnone size-full wp-image-267" /></a></center></p>
<p>This was pretty much the effect I wanted.  Unfortunately, it involves taking an <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_b09ede879256f79ac633ff419d6ad90e.png" title="7.5" style="vertical-align:-20%;" class="tex" alt="7.5" />-th power, an <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_89a491e439f20085a37a460884f22858.png" title="9.5" style="vertical-align:-20%;" class="tex" alt="9.5" />-th root, and a cosine of calculation.  I decided that <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_296cffcf7e9622b92396b77dae19c81f.png" title="\frac{7.5}{9.5}" style="vertical-align:-20%;" class="tex" alt="\frac{7.5}{9.5}" /> was close enough to one to give it a whirl without needing the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_b09ede879256f79ac633ff419d6ad90e.png" title="7.5" style="vertical-align:-20%;" class="tex" alt="7.5" />-th power.  <center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_b7198479b4f8171c1f2b53bc85119d8d.png" title="x(t) = 1 - (1-t) \cos \left(K\sqrt[n]{1-t}\right)" style="vertical-align:-20%;" class="tex" alt="x(t) = 1 - (1-t) \cos \left(K\sqrt[n]{1-t}\right)" /></center></p>
<p>Here you can see <a href="http://nklein.com/wp-content/uploads/2009/05/tile-slide.mov">the final result</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/exponential-spirals-for-game-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://nklein.com/wp-content/uploads/2009/05/tile-slide.mov" length="1334665" type="video/quicktime" />
		</item>
		<item>
		<title>A Eureka Moment</title>
		<link>http://nklein.com/2009/05/a-eureka-moment/</link>
		<comments>http://nklein.com/2009/05/a-eureka-moment/#comments</comments>
		<pubDate>Fri, 01 May 2009 17:23:02 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=254</guid>
		<description><![CDATA[I was pondering the Phony Physics again as I set to work on my iPhone app. In the previous post, I twiddled the equations for damped spring motion until I found something visually pleasing. Last night, I went back to the drawing (a.k.a. white) board. What if I used an exponential spiral (parameterized by arc [...]]]></description>
			<content:encoded><![CDATA[<p>I was pondering the <a href="http://nklein.com/2009/04/phony-physics-aka-fun-with-interpolation/">Phony Physics</a> again as I set to work on my <a href="http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/">iPhone app</a>.</p>
<p>In the previous post, I twiddled the equations for damped spring motion until I found something visually pleasing.  Last night, I went back to the drawing (a.k.a. <q>white</q>) board.</p>
<p>What if I used an exponential spiral (parameterized by arc length).  Then, I could easily adjust the number of times it bounces back and forth.  I could use a spiral like <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_423e44d60380dbc2ae4d5767f351d4fd.png" title="r(t) = \alpha K (1-t)^n" style="vertical-align:-20%;" class="tex" alt="r(t) = \alpha K (1-t)^n" /> and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c08f3589a4375d6b7976b2258bab8abc.png" title="\theta(t) = K(1-t)" style="vertical-align:-20%;" class="tex" alt="\theta(t) = K(1-t)" /> where <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_7989e0ac09d9b7e9e3b541e36a5cb514.png" title="K" style="vertical-align:-20%;" class="tex" alt="K" /> is some multiple of <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2865ca0c5331aac3fceea41c25b3f97f.png" title="2\pi" style="vertical-align:-20%;" class="tex" alt="2\pi" />.  Then, I could walk along the spiral getting to the origin when <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4eea309dec2e2b71e1f70b7a4895f3ac.png" title="t = 1" style="vertical-align:-20%;" class="tex" alt="t = 1" /> going around the origin <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0f8b4dccb0d9958e9165026a8b86e493.png" title="\frac{K}{2\pi}" style="vertical-align:-20%;" class="tex" alt="\frac{K}{2\pi}" /> times in the process.  If I follow the curve at a fixed rate, then I guarantee that my oscillations will pick up speed as I approach the origin.</p>
<p>Rather than have it spiral into the center, I am just using the x-coordinate of the spiral as my new <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4e156c4dfd6f5bd0adffc493c64bc7ca.png" title="t" style="vertical-align:-20%;" class="tex" alt="t" /> value to interpolate with.  I like the effect for the most part.  It overshoots a little bit far on the first oscillation.  I may tweak it some more before it&#8217;s all over.  For now though, I am sticking with it.</p>
<p>I will post some graphs soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/a-eureka-moment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sneak Peak: Artwork for Spelling iPhone App</title>
		<link>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/</link>
		<comments>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/#comments</comments>
		<pubDate>Fri, 01 May 2009 05:32:51 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[iphone app]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[spell-it]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=242</guid>
		<description><![CDATA[My first iPhone app is a children&#8217;s spelling game. Development is coming along well now that I&#8217;ve discovered cocos2d-iphone. I should have screenshots to show early next week. For now, here is a sneak peak at one of the cards in the game.]]></description>
			<content:encoded><![CDATA[<p>My first iPhone app is a children&#8217;s spelling game.  Development is coming along well now that I&#8217;ve discovered <a href="http://code.google.com/p/cocos2d-iphone/">cocos2d-iphone</a>.  I should have screenshots to show early next week.  For now, here is a sneak peak at one of the <q>cards</q> in the game.</p>
<p><center><a href="http://nklein.com/wp-content/uploads/2009/05/three.png"><img src="http://nklein.com/wp-content/uploads/2009/05/three.png" alt="three" title="three" width="256" height="256" class="size-full wp-image-243" style="border: black solid 0.25em;" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/sneak-peak-artwork-for-spelling-iphone-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First decent images from my new raytracer</title>
		<link>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/</link>
		<comments>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:13:40 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[mpi]]></category>
		<category><![CDATA[rt]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=490</guid>
		<description><![CDATA[Some time ago, I wrote an n-dimensional raytracer in C++. It does a fair number of things, none of them efficiently, most of the rigidly. There are a bunch of things that I wanted to do with it for a long time, but it&#8217;s been too slow and rigid to make any of those things [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I wrote an <a href="http://www.nklein.com/products/rt">n-dimensional raytracer</a> in C++.  It does a fair number of things, none of them efficiently, most of the rigidly.</p>
<p>There are a bunch of things that I wanted to do with it for a long time, but it&#8217;s been too slow and rigid to make any of those things fun.</p>
<p>Enter Lisp.  As soon as it made it through my skull that Lisp is actually compiled (honest-to-goodness your-CPU instructions), I wanted to rewrite the whole thing in Lisp.  I have finally gotten started on doing that.  And, I just made it to the point where I&#8217;m actually tracing rays.  Here is a stereo pair of a three-dimensional scene:</p>
<p><center></p>
<table cellpadding="2" cellspacing="0">
<tr>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png" alt="lrt-l" title="lrt-l" width="240" height="135" class="alignnone size-full wp-image-491" /></a></td>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png" alt="lrt-r" title="lrt-r" width="240" height="135" class="alignnone size-full wp-image-492" /></a></td>
</tr>
</table>
<p></center></p>
<p><span id="more-490"></span></p>
<p>It use&#8217;s <a href="http://xach.livejournal.com/">xach</a>&#8216;s ZPNG library for output, my OpenMPI library for sharing work across machines, and a thin layer that I wrote on top of Portable Threads for threading within a machine.</p>
<p>It doesn&#8217;t yet do reflections and refractions, directional lights, or most of the shapes that my old raytracer does.<br />
But, it&#8217;s already got multithreading, MPI, more meaningful camera parameters, and functional color characteristics.</p>
<p>So, here&#8217;s the source code that generated the above images. Note that the one sphere has checkboarded diffuseness and the other has gradated phong-exponent and positional coloring.</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> make-checkerboard-func <span style="color: #66cc66;">&#40;</span>a b<span style="color: #66cc66;">&#41;</span>
  #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>sum <span style="color: #66cc66;">&#40;</span>reduce #'+
			 position
			 <span style="color: #66cc66;">:</span><span style="color: #555;">key</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span>vv<span style="color: #66cc66;">&#41;</span>
				  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>lt<span style="color: #808080; font-style: italic;">; 1.0 (mod vv 2.0)) 1 0)))))</span>
	<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">evenp</span> sum<span style="color: #66cc66;">&#41;</span> a b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> my-universe <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">spatial-dimensions</span> <span style="color: #cc66cc;">3</span>
		<span style="color: #66cc66;">:</span><span style="color: #555;">color-dimensions</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>look-at <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">18.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>eye-offset <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.25</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>aspect <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">16.0</span> <span style="color: #cc66cc;">9.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>field-of-view <span style="color: #cc66cc;">120.0</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>object-scale <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">3.0</span> <span style="color: #cc66cc;">3.0</span> <span style="color: #cc66cc;">3.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>x-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>y-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>z-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>angle <span style="color: #cc66cc;">10.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span>* eye-offset -<span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> look-at<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">camera</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-</span><span style="color: #b1b100;">l</span>
		   <span style="color: #66cc66;">:</span><span style="color: #555;">aspect</span> aspect
		   <span style="color: #66cc66;">:</span><span style="color: #555;">field-of-view</span> field-of-view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span>* eye-offset <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> look-at<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">camera</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-r</span>
		   <span style="color: #66cc66;">:</span><span style="color: #555;">aspect</span> aspect
		   <span style="color: #66cc66;">:</span><span style="color: #555;">field-of-view</span> field-of-view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">5.0</span> -<span style="color: #cc66cc;">2.0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">light</span> <span style="color: #66cc66;">:</span><span style="color: #555;">color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> -<span style="color: #cc66cc;">10.0</span> -<span style="color: #cc66cc;">5.0</span> <span style="color: #cc66cc;">8.0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">light</span> <span style="color: #66cc66;">:</span><span style="color: #555;">color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> look-at
			   <span style="color: #66cc66;">:</span><span style="color: #555;">scaling</span> object-scale
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">rotation</span> <span style="color: #66cc66;">&#40;</span>x-axis y-axis angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-scaling</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.75</span> <span style="color: #cc66cc;">0.75</span> <span style="color: #cc66cc;">0.75</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-rotation</span> <span style="color: #66cc66;">&#40;</span>y-axis z-axis angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.8</span> <span style="color: #cc66cc;">0.2</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">diffuseness</span> <span style="color: #66cc66;">&#40;</span>make-checkerboard-func <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.6</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">specularity</span> <span style="color: #cc66cc;">0.4</span><span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">sphere</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">1.5</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">scaling</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">1.5</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
				   <span style="color: #66cc66;">&#40;</span>map 'vector #'<span style="color: #b1b100;">abs</span> position<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">diffuseness</span> <span style="color: #cc66cc;">0.6</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">specularity</span> <span style="color: #cc66cc;">0.4</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">phong-exponent</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
						   <span style="color: #66cc66;">&#40;</span>+ <span style="color: #cc66cc;">10</span>
						      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">abs</span> <span style="color: #66cc66;">&#40;</span>* <span style="color: #cc66cc;">100</span>
							     <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">aref</span> position <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
							     <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">sphere</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-rotation</span> <span style="color: #66cc66;">&#40;</span>x-axis y-axis angle<span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> -<span style="color: #cc66cc;">15.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.8</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">halfspace</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">hspace1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
#+<span style="color: #66cc66;">:</span><span style="color: #555;">openmpi</span>
<span style="color: #66cc66;">&#40;</span>mpi<span style="color: #66cc66;">:</span><span style="color: #555;">init</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-workers</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>uu <span style="color: #66cc66;">&#40;</span>my-universe<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	 <span style="color: #66cc66;">&#40;</span>dpd <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">2.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">render-png</span> <span style="color: #66cc66;">:</span><span style="color: #555;">dots-per-degree</span> dpd
		    <span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> uu
		    <span style="color: #66cc66;">:</span><span style="color: #555;">filename</span> #P<span style="color: #ff0000;">&quot;output-l.png&quot;</span>
		    <span style="color: #66cc66;">:</span><span style="color: #555;">camera-</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-</span><span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">render-png</span> <span style="color: #66cc66;">:</span><span style="color: #555;">dots-per-degree</span> dpd
		    <span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> uu
		    <span style="color: #66cc66;">:</span><span style="color: #555;">filename</span> #P<span style="color: #ff0000;">&quot;output-r.png&quot;</span>
		    <span style="color: #66cc66;">:</span><span style="color: #555;">camera-</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-r</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
#+<span style="color: #66cc66;">:</span><span style="color: #555;">openmpi</span>
<span style="color: #66cc66;">&#40;</span>mpi<span style="color: #66cc66;">:</span><span style="color: #555;">finalize</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>And, here are the same images swapped for those of you who prefer cross-eyed stereo pairs:</p>
<p><center></p>
<table cellpadding="2" cellspacing="0">
<tr>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png" alt="lrt-r" title="lrt-r" width="240" height="135" class="alignnone size-full wp-image-492" /></a></td>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png" alt="lrt-l" title="lrt-l" width="240" height="135" class="alignnone size-full wp-image-491" /></a></td>
</tr>
</table>
<p></center></p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

