<?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>uncontrol</title>
	<atom:link href="http://www.uncontrol.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uncontrol.com</link>
	<description>A collection of experiments using fancy shmancy code</description>
	<lastBuildDate>Tue, 21 Feb 2012 02:24:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Iris experiment</title>
		<link>http://www.uncontrol.com/posts/iris-experiment/</link>
		<comments>http://www.uncontrol.com/posts/iris-experiment/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 19:27:13 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=853</guid>
		<description><![CDATA[I recently found an great article about bezier curves by Mike Kamermans. What made it extra amazing was that all the images were open-sourced, interactive files created with Processing JS. You&#8217;re able to follow the mathematics of beziers as well understand how they were executed by reading the code. His brief about calculating offset curves&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://iris.uncontrol.com/latest" target="iris"><img title="main" src="http://www.uncontrol.com/wp-content/uploads/2012/02/main.jpg" rel="facebox" alt="" width="440" height="440" /></a></p>
<p>I recently found an great article about <a href="http://processingjs.nihongoresources.com/bezierinfo/" target="_blank">bezier curves</a> by Mike Kamermans. What made it extra amazing was that all the images were open-sourced, interactive files created with <a href="http://processingjs.org/" target="_blank">Processing JS</a>. You&#8217;re able to follow the mathematics of beziers as well understand how they were executed by reading the code.</p>
<p>His brief about <a href="http://processingjs.nihongoresources.com/bezierinfo/#offsets">calculating offset curves</a> sparked off this concept of layering. By taking the initial bezier and rotate it about the y axis you get a simple and easily adjustable lathe. Offset curves around a lathe create a beautiful layering effect which add quite a bit of dimension. Using gradient fills instead of solids as subtlety to the shape(s) generated.<del> It&#8217;s called Eye primarily because the shapes it was generating once I added the gradient fill looked liked an Eyeball. I think in hindsight, this experiment should be renamed iris and because I have an older flash experiment already named <a href="http://www.uncontrol.com/v7/deploy/content/EXPERIMENTS/eye/" target="_blank">eye</a>.</del></p>
<p>Update &#8211; I&#8217;ve renamed it Iris.</p>
<p>This experiment was built in HTML5 using the excellent <a href="https://github.com/mrdoob/three.js/" target="_blank">three.js</a> and <a href="http://code.google.com/p/dat-gui/" target="_blank">dat.gui</a> libraries.</p>
<p><a href="http://iris.uncontrol.com/v_14" target="iris"><img title="view_variations" src="http://www.uncontrol.com/wp-content/uploads/2012/02/view_variations.jpg" rel="facebox" alt="" width="440" height="440" /></a></p>
<p>I had a decent understanding of the idea so I set about modifying my base code with 3 distinct parts starting from left to right&#8230;</p>
<ol>
<li>The interactive 2d representation of the bezier.</li>
<li>The rotate-able 3d version of the lathe.</li>
<li>Controls created in <a href="http://code.google.com/p/dat-gui/" target="_blank">dat.gui</a> to modify parameters.</li>
</ol>
<p>After a few versions I was able to get the bezier code as well as the layering effect working in 2d space. I then started working on the 3d shape, constantly adding and refining more parameters. I Isolated a few parameters which affect the animation of the shape and then spent the rest of the time cleaning and refining. Once the majority of the math was done, I spent time creating different view-able options with lines, particles and eventually fills.</p>
<p><em>Click the image below to see a progression of work</em></p>
[[Show as slideshow]]
<p>&nbsp;<br />
version : <a href="http://iris.uncontrol.com/v_01/" target="iris">01</a> | <a href="http://iris.uncontrol.com/v_02/" target="iris">02</a> | <a href="http://iris.uncontrol.com/v_03/" target="iris">03</a> | <a href="http://iris.uncontrol.com/v_04/" target="iris">04</a> | <a href="http://iris.uncontrol.com/v_05/" target="iris">05</a> | <a href="http://iris.uncontrol.com/v_06/" target="iris">06</a> | <a href="http://iris.uncontrol.com/v_07/" target="iris">07</a> | <a href="http://iris.uncontrol.com/v_08/" target="iris">08</a> | <a href="http://iris.uncontrol.com/v_09/" target="iris">09</a> | <a href="http://iris.uncontrol.com/v_10/" target="iris">10</a> | <a href="http://iris.uncontrol.com/v_11/" target="iris">11</a> | <a href="http://iris.uncontrol.com/v_12/" target="iris">12</a> | <a href="http://iris.uncontrol.com/v_13/" target="iris">13</a> | <a href="http://iris.uncontrol.com/v_14/" target="iris">14</a> | <a href="http://iris.uncontrol.com/v_15/" target="iris">15</a></p>
<p><img title="eyes_02" src="http://www.uncontrol.com/wp-content/uploads/2012/02/eyes_02.jpg" alt="" width="440" height="792" /></p>
<p>I&#8217;ve only tested this in chrome so there&#8217;s a very good chance it will not work in other browsers due to the needs of WebGL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/iris-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Cooper Union mark variant in HTML5</title>
		<link>http://www.uncontrol.com/posts/a-cooper-union-mark-variant-in-html5/</link>
		<comments>http://www.uncontrol.com/posts/a-cooper-union-mark-variant-in-html5/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 18:42:19 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[interactive branding]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=834</guid>
		<description><![CDATA[I&#8217;ve always made a distinction between client-work and personal-work. Sometimes we make choices which prevents us from using a particular technology or an effect in favor of accommodating for the largest viewing audience. I chose to do it in HTML5 instead of flash not because of any particular argument over which technology is better. I&#8217;ve&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://cooperhtml.uncontrol.com/preso/" target="_blank"><img title="v2_preso" src="http://www.uncontrol.com/wp-content/uploads/2012/01/v2_preso.jpg" rel="facebox" alt="" width="440" height="330" /></a></p>
<p>I&#8217;ve always made a distinction between client-work and personal-work. Sometimes we make choices which prevents us from using a particular technology or an effect in favor of accommodating for the largest viewing audience. I chose to do it in HTML5 instead of flash not because of any particular argument over which technology is better. I&#8217;ve worked in flash for years and there wouldn&#8217;t be anything relatively new to learn. 3D in HTML5 and was something new to me and one of the best ways to learn new things is to force-ably throw yourself into a project.</p>
<p>If <a href="http://en.wikipedia.org/wiki/Murphy%27s_law" target="_blank">Murphy&#8217;s Law</a> came into effect, I can always revert to a flash solution. As it turned out, browser compatibility issues prevented it from looking correct and the HTML5 version was scrapped for an entirely flash based solution.</p>
<p>Once the project was completed, I didn&#8217;t want to loose all that effort I spent on the HTML5 iteration so I slowly reformatted the original code using the latest version of <a href="https://github.com/mrdoob/three.js/" target="_blank">Three.js</a> and <a href="http://code.google.com/p/dat-gui/" target="_blank">dat.gui</a>, a framework that easily allowed you to modify parameters contained within a panel.</p>
<p><a href="http://cooperhtml.uncontrol.com/latest/" target="_blank"><img title="v2_latest" src="http://www.uncontrol.com/wp-content/uploads/2012/01/v2_latest.jpg" rel="facebox" alt="" width="440" height="251" /></a></p>
<p>On a logistical note, I&#8217;m hesitant about naming it as the cooper union mark because of the alterations I&#8217;ve made to the original design, like the reintroduction of perspective and the addition of cube geometry. So for now, I&#8217;d like to call it a variant. Below are a few more randomly generated variants.</p>
<p><a href="http://www.uncontrol.com/wp-content/uploads/2012/01/v2_versions_large.jpg" rel="facebox" target="_blank"><img title="v2_versions" src="http://www.uncontrol.com/wp-content/uploads/2012/01/v2_versions.jpg" alt="" width="440" height="743" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/a-cooper-union-mark-variant-in-html5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Case Study: An interactive brand for the Cooper Union</title>
		<link>http://www.uncontrol.com/posts/a-interactive-brand-for-the-cooper-union/</link>
		<comments>http://www.uncontrol.com/posts/a-interactive-brand-for-the-cooper-union/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 22:38:07 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[case study]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[interactive branding]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=702</guid>
		<description><![CDATA[Created in flash using PV3D. Roll over to change the logo. &#160; DESIGN SYSTEM I&#8217;ve done a few dynamic logos in the past and have always had a bit of fun making them. So when my friends over at Behavior asked me to help out with creating one for the Cooper Union to coincide with&#8230;]]></description>
			<content:encoded><![CDATA[<p><object width="440" height="399" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://cooper.uncontrol.com/cooper.swf" /><embed width="440" height="399" type="application/x-shockwave-flash" src="http://cooper.uncontrol.com/cooper.swf" /></object><em>Created in flash using PV3D. Roll over to change the logo.</em><br />
&nbsp;</p>
<h5>DESIGN SYSTEM</h5>
<p>I&#8217;ve done a <a href="http://uncontrol.dreamhosters.com/projects/mtv/0104_frame/mtv_c_06.html" target="_blank">few</a> <a href="http://uncontrol.dreamhosters.com/projects/mtv/1229_frame/mtv_b_04.html" target="_blank">dynamic</a> <a href="http://uncontrol.dreamhosters.com/projects/mtv/1227_frame/mtv_07.html " target="_blank">logos</a> <a href="http://uncontrol.dreamhosters.com/projects/pulse/0831_frame/html/slide_rotate_pill_01.html " target="_blank">in</a> <a href="http://uncontrol.dreamhosters.com/projects/pulse/0831_frame/html/grid_pattern_01.html " target="_blank">the</a> <a href="http://uncontrol.dreamhosters.com/projects/hrl/0128_frame/test_d_01.html" target="_blank">past</a> and have always had a bit of fun making them. So when my friends over at <a href="http://behaviordesign.com/" target="_blank">Behavior</a> asked me to help out with creating one for <a href="http://cooper.edu" target="_blank">the Cooper Union</a> to coincide with their new <a href="http://www.cooper.edu" target="_blank">site</a>, it was impossible to say no. The logo itself (created by <a href="http://www.doylepartners.com/">Doyle Partners</a>) was a series of planes that were organized in an isometric-looking view that had so much potential for 3D motion.</p>
<p>The mark centers around an abstracted &#8216;C&#8217; and &#8216;U&#8217; intertwined in orthogonal space. We wanted the mark to deconstruct itself to it&#8217;s basic form of 2D planes which then form to create a composition. We wanted the composition to be randomly generated so what we needed to do was isolate specific parameters (like rotation and distance) that radically changes its look and feel. To do that we need to create a generative design system.</p>
<p><a href="http://cooper.uncontrol.com/v_13/index.html" target="_blank"><img title="cooperInteractive" src="http://www.uncontrol.com/wp-content/uploads/2011/12/cooperInteractive.jpg" rel="facebox" alt="" width="440" height="220" /></a></p>
<p>Once we found the parameters, it took a matter of trial and error to clamp which values looked good. For anything rotation related, we choose angles incremented to 45° while position based parameters are numbers divisible by 20. The Cooper Union mark is actually a variation generated using these parameters. After that, it was just a matter of animating these parameters from one set to another using tweening equations. The last thing we did was extend the animation back to the original mark by adding delays between each tweened parameter. On a side note, I do remember having fun changing the speeds to sync up with the <a href="http://www.youtube.com/watch?v=xBq3wZ5VK3Q&amp;feature=related" target="_blank">tranformers&#8217;s transforming sound</a>.</p>
<p>&nbsp;</p>
<h5>HTML vs FLASH</h5>
<p>I&#8217;ve had some minor success with learning canvas recently and thought this would be a great way to dive into <a href="https://github.com/mrdoob/three.js/" target="_blank">Three.js</a>, Mr. doob&#8217;s 3D framework. For compatibility&#8217;s sake I ditched the WegGLRenderer in favor of the CanvasRenderer so it would work in all modern browsers and devices. For the most part, most of my preliminary tests work and so i moved forward with building it it in HTML.</p>
<p><a href="http://cooper.uncontrol.com/v_05/" target="_blank"><img title="preliminaryTest" src="http://www.uncontrol.com/wp-content/uploads/2011/12/preliminaryTest.jpg" rel="facebox" alt="" width="440" height="360" /></a><br />
<em>Preliminary test done in Canvas using Three.js</em></p>
<p><a href="http://cooper.uncontrol.com/v_11/" target="_blank"><img title="htmlTest" src="http://www.uncontrol.com/wp-content/uploads/2011/12/htmlTest1.jpg" rel="facebox" alt="" width="440" height="328" /></a><em>Design system in Canvas using Three.js and jQueryUI</em></p>
<p>Everything was going splendidly until I hit a nasty roadblock that completely derailed the use of HTML, layer effects compatibility. It wasn&#8217;t supported in IE or Firefox and every hack I tried didn&#8217;t work or suffered massive performance issues. Removing the multiple/subtractive effects wasn&#8217;t an option because it was integral to the branding so there was no other recourse but to sandbag HTML in favor of Flash&#8217;s ubiquity among browsers. If i had to sacrifice anything it would be the user experience on mobile devices (who are already accustomed to it and won&#8217;t think much of it) than over half of all modern browsers. The final interactive brand was built with flash 10, using <a href="http://blog.papervision3d.org/" target="_blank">PaperVision3D</a>.</p>
<p>A nice outcome of this was learning about perspective nomenclature. The Cooper Union mark is a non <a href="http://en.wikipedia.org/wiki/Foreshortening#Foreshortening" target="_blank">foreshortened</a>, <a href="http://en.wikipedia.org/wiki/Oblique_projection" target="_blank">oblique projection</a> with a 45 degree rotation. PaperVision3D nor Three.js had that particular angle configuration so I had to hack it by using an orthogonal camera position and using trial and error. I believe the closest approximation to the brand required squeezing the stage/canvas width a by 15%.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/a-interactive-brand-for-the-cooper-union/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wormy experiment</title>
		<link>http://www.uncontrol.com/posts/wormy-experiment/</link>
		<comments>http://www.uncontrol.com/posts/wormy-experiment/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 23:30:51 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=662</guid>
		<description><![CDATA[This experiment was an offshoot from my previous experiment where I wanted to create a simple following formation rather than the circular one that arc had. This particular experiment was unusual in that I didn&#8217;t really have a clear goal in mind. I was trying to solve a particular geometry problem. One iteration led to&#8230;]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://lab.uncontrol.com/wormy/latest/" target="wormy">experiment</a> was an offshoot from my <a href="http://www.uncontrol.com/posts/arc-experiment/" target="arc">previous experiment</a> where I wanted to create a simple following formation rather than the circular one that arc had.</p>
<p>This particular experiment was unusual in that I didn&#8217;t really have a clear goal in mind. I was trying to solve a particular <a href="http://www.teacherschoice.com.au/maths_library/trigonometry/solve_trig_sss.htm" target="_blank">geometry problem</a>. <a href="http://lab.uncontrol.com/wormy/v_04/" target="wormy">One</a> iteration led to <a href="http://lab.uncontrol.com/wormy/v_07/" target="wormy">another</a> which led to <a href="http://lab.uncontrol.com/wormy/v_09/" target="wormy">another</a>. The end result was just a cleanup of all the iterations so you can see the inner workings. My fiancee wanted to name it colon but I had to veto an name it something more professional like <a href="http://lab.uncontrol.com/wormy/latest/" target="wormy">wormy</a>.</p>
<p>I&#8217;m slowly learning more about about html5, and I&#8217;m finally at a point where I can express some of these ideas at the same fidelity that I had with flash and processing. The reality is that it wouldn&#8217;t be possible without some of the open source frameworks available. For this experiment, I use <a href="http://jquery.com" target="_blank">jquery</a>, <a href="http://jqueryui.com" target="_blank">jqueryui</a>, <a href="http://sebleedelisle.com/" target="_blank">seb&#8217;s</a> vector class and had help from <a href="http://davidelstob.co.uk" target="_blank">mr elstob</a>.</p>
<p><a href="http://lab.uncontrol.com/wormy/latest/" target="wormy"><img title="img_01" src="http://www.uncontrol.com/wp-content/uploads/2011/09/img_01.jpg" rel="facebox" alt="" width="440" height="540" /></a></p>
<p><a href="http://lab.uncontrol.com/wormy/latest/" target="wormy"><img title="img_03" src="http://www.uncontrol.com/wp-content/uploads/2011/09/img_03.jpg" rel="facebox" alt="" width="440" height="340" /></a></p>
<p><a href="http://lab.uncontrol.com/wormy/latest/" target="wormy"><img title="img_02" src="http://www.uncontrol.com/wp-content/uploads/2011/09/img_02.jpg" rel="facebox" alt="" width="440" height="840" /></a></p>
<p>Iterations<br />
<a href="http://lab.uncontrol.com/wormy/v_01/" target="wormy">version 01</a><br />
<a href="http://lab.uncontrol.com/wormy/v_02/" target="wormy">version 02</a><br />
<a href="http://lab.uncontrol.com/wormy/v_03/" target="wormy">version 03</a><br />
<a href="http://lab.uncontrol.com/wormy/v_04/" target="wormy">version 04</a><br />
<a href="http://lab.uncontrol.com/wormy/v_05/" target="wormy">version 05</a><br />
<a href="http://lab.uncontrol.com/wormy/v_06/" target="wormy">version 06</a><br />
<a href="http://lab.uncontrol.com/wormy/v_07/" target="wormy">version 07</a><br />
<a href="http://lab.uncontrol.com/wormy/v_08/" target="wormy">version 08</a><br />
<a href="http://lab.uncontrol.com/wormy/v_09/" target="wormy">version 09</a><br />
<a href="http://lab.uncontrol.com/wormy/v_10/" target="wormy">version 10</a><br />
<a href="http://lab.uncontrol.com/wormy/v_11/" target="wormy">version 11</a><br />
<a href="http://lab.uncontrol.com/wormy/v_12/" target="wormy">version 12</a><br />
<a href="http://lab.uncontrol.com/wormy/v_13/" target="wormy">version 13</a><br />
<a href="http://lab.uncontrol.com/wormy/v_14/" target="wormy">version 14</a><br />
<a href="http://lab.uncontrol.com/wormy/v_15/" target="wormy">version 15</a><br />
<a href="http://lab.uncontrol.com/wormy/v_16/" target="wormy">version 16</a><br />
<a href="http://lab.uncontrol.com/wormy/v_17/" target="wormy">version 17</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/wormy-experiment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>arc experiment</title>
		<link>http://www.uncontrol.com/posts/arc-experiment/</link>
		<comments>http://www.uncontrol.com/posts/arc-experiment/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 04:02:52 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=598</guid>
		<description><![CDATA[I&#8217;ve been drawing circles with code for quite a little while now. For the most part, I&#8217;ve been drawing them using a simple sinusoidal equation which I&#8217;ve used a ridiculous amount of times. for(i=0;i&#60;total;i++){ var percentage = i/total*Math.PI / 180 var xPos = Math.cos(percentage) * radius + offsetX; var yPos = Math.sin(percentage) * radius +&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.uncontrol.com/arc" target="arc"><img src="http://www.uncontrol.com/wp-content/uploads/2011/07/img_00.jpg" rel="facebox" alt="" title="img_00" width="440" height="440" /></a></p>
<p>I&#8217;ve been drawing circles with code for quite a little while now.<br />
For the most part, I&#8217;ve been drawing them using a simple sinusoidal equation which I&#8217;ve used a ridiculous amount of times.</p>
<pre class="brush: javascript">

for(i=0;i&lt;total;i++){
    var percentage = i/total*Math.PI / 180
    var xPos = Math.cos(percentage) * radius + offsetX;
    var yPos = Math.sin(percentage) * radius + offsetY;
    // do stuff with values
}
</pre>
<p>You don&#8217;t have to fully understand trigonometry (although it does help if you do). Plug in some values that change the parameters and you can easily modify code. However, once I started to create arcs, this proved to cause a whole mess of issues, the biggest when determining when to rotate clockwise vs counterclockwise. From my understanding, the sin/cos functions are smart enough to get a range from 0-360°. Once you go pass that, the values reset back to 0°. You can keep track of it using states but the values keep getting clobbered. It&#8217;s like the the tall man, small blanket problem. Covering your head makes your feet cold and covering your feet makes your head cold. I wasn&#8217;t smart enough to figure this out so I sat on it for a few months, then a few years, I&#8217;ve tried tackling this a few times but I&#8217;ve always ended up using a workaround instead. </p>
<p>Cut away to a month back. I was reading a <a href="http://www.allegro.cc/forums/thread/594175" target="new">post</a> about drawing arcs and circles without using sine and cosine in the main loop. I believe the purpose was to skip trigonometry which can be processing intensive. </p>
<pre class="brush: javascript">
var da = (endPositionInRads - startPositionInRads); // distance angle
var ss = 45; // segmenet spacing
var rs = (Math.abs(da) / (Math.PI * 2) * ss); // real segments
var tm = Math.tan(da / real_segments); // tangent multiplier
var rm = 1 - Math.cos(da / real_segments); //radial multiplier

// first position uses sinusoidal
var xPos = Math.cos(startPositionInRads) * radius + offsetX;
var yPos = Math.sin(startPositionInRads) * radius + offsetY;
var tx; // transitionX
var ty; // transitionY
for (i = 0; i &lt; rs; i++) {
    tx = -(yPos - offsetY);
    ty = xPos - offsetX;
    xPos += tx * tm;
    yPos += ty * tm;
    xPos += (offsetX - xPos) * rm;
    yPos += (offsetY - yPos) * rm;
    // do stuff with values
}
</pre>
<p>(The code is a little larger but it works)</p>
<p>I didn&#8217;t think much of it at first. I&#8217;ve actually used it before just for the sake of using it. Going back to the arc problem again, I realized that a simple way to not get the modulus 360° problem was to not use sine and cosines at all. Sure enough it worked and the results of that can be seen below.</p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/07/img_02.jpg" alt="" title="img_02" width="440" height="220" /><br />
(left image uses trig, right image just uses math)</p>
<p>I&#8217;ve been completely reliant on using sines and cosines for the pass decade that it actually prevented me from doing what I wanted to do. I think I&#8217;m going to revisit a few old experiments that I&#8217;ve never published due to code complexity and take a look at it from a different perspective. All the iterations can be found below. </p>
<p><a href="http://lab.uncontrol.com/arc/versions/v_01/" target="arc">version 01</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_02/" target="arc">version 02</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_03/" target="arc">version 03</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_04/" target="arc">version 04</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_05/" target="arc">version 05</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_06/" target="arc">version 06</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_07/" target="arc">version 07</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_08/" target="arc">version 08</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_09/" target="arc">version 09</a><br />
<a href="http://lab.uncontrol.com/arc/versions/v_10/" target="arc">version 10</a></p>
<p><a href="http://lab.uncontrol.com/arc" target="arc"><img src="http://www.uncontrol.com/wp-content/uploads/2011/07/img_01.jpg" rel="facebox" alt="" title="img_01" width="440" height="660"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/arc-experiment/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>nudibranch experiment</title>
		<link>http://www.uncontrol.com/posts/nudibranch-experiment/</link>
		<comments>http://www.uncontrol.com/posts/nudibranch-experiment/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 20:35:00 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=552</guid>
		<description><![CDATA[Audio by Daft Punk (&#8220;Recognizer&#8221; from Tron Legacy [SoundTrack]). Nudibranch is an experiment inspired by the motions of a spanish dancer, a type of sea slug commonly found on coral reefs. They oscillate their fins symmetrically as well as rhythmically to travel through open water. This experiment is an abstraction of that motion. In my&#8230;]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/19381759?byline=0&amp;portrait=0" width="440" height="248" frameborder="0"></iframe><br />
Audio by Daft Punk (&#8220;Recognizer&#8221; from Tron Legacy [SoundTrack]).</p>
<p><a href="http://nudibranch.uncontrol.com/" target="_blank"><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_00.jpg" rel="facebox" alt="" title="img_00" width="440" height="494"  /></a><br />
<a href="http://nudibranch.uncontrol.com/" target="_blank">Nudibranch</a> is an experiment inspired by the motions of a spanish dancer, a type of sea slug commonly found on coral reefs. They oscillate their fins symmetrically as well as rhythmically to travel through open water. This experiment is an abstraction of that motion. </p>
<p><a href="http://www.flickr.com/photos/jackroth/5178814859/" target="_blank"><img title="balloon_md" src="http://www.uncontrol.com/wp-content/uploads/2011/01/spanishDancer.png" rel="facebox" alt="" width="440" height="440" /></a></p>
<p>In my <a href="http://www.uncontrol.com/posts/balloon-experiment/">previous experiment</a>, I was writing code natively in <a href="processing.org" target="_blank">Processing IDE</a>. I&#8217;ve had some luck working with the <a href="http://fdt.powerflasher.com/blog/tag/fdt4/">FDT4 IDE</a> for work related projects so I figured it was about time to plunge into the <a href="www.eclipse.org" target="_blank">Eclipse framework</a>. It was definitely a challenge getting everything setup but once it was, working in Eclipse was a breeze.</p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_01.jpg" alt="" title="img_01" width="440" height="209" /><br />
The first step was to create a simple following motion in 3d space using code I found while browsing through the processing forums. I implemented it to a simple chain script that I converted from 2d to 3d. While the mouse follow was technically working, the range I was receiving leaned towards the extreme causing weird jumps in animation. I instead opted for a simple motion that followed a osculating track. </p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_02.jpg" alt="" title="img_02" width="440" height="246" /><br />
In the balloon experiment, I was exposing much of the math calculations which overcomplicated the code. In this experiment, I used the <a href="toxiclibs.org" target="_blank">toxiclibs libraries</a> which handled much of the complex mathematics and saved me quite a bit of time and headaches along the way. The purple dots represent a scaffold for me to visualize the flapping motion. To quickly go over the construction, I&#8217;m building the nudibranch in terms of segments, like slices of a banana. Each slice points towards as well as follows it&#8217;s parent. I first parse and store all the points of all the segments and then draw those points later.</p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_03.jpg" alt="" title="img_03" width="440" height="251" /><br />
The next step was to create a simple oscillating line that protrudes from the center of each segment aka the fins. Using sinusoidal motion that&#8217;s offset by the segment id, I&#8217;m able to get the motion and cause a ripple effect that travels from the head to the tail of the nudibranch.</p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_04.jpg" alt="" title="img_04" width="440" height="586" /><br />
I added another scale and offset to each segment to make the flapping of the fins less rigid. I also started playing with the visuals creating line segments for better viewing.</p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/img_05.jpg" alt="" title="img_05" width="440" height="220"  /><br />
I added the mesh fills soon after and proceeded to fine tune the parameters I created to mimic the look and feel of a nudibranch. I had quite a bit of fun modifying the parameters via the <a href="http://www.sojamo.de/libraries/controlP5/" target="_blank">controlP5 sliders</a> so I exposed it to the viewer and added quite a bit more which included motions related to audio, as well as the ability to randomize and animate across all parameters. </p>
<p><img src="http://www.uncontrol.com/wp-content/uploads/2011/01/series.jpg" alt="" title="series" width="440" height="248" /></p>
<p>This was the basis for the nudibranch video which randomly changed form and shape over time. It may not look like a nudibranch any more but the essence is still there. Feel free to download the latest <a href="http://nudibranch.uncontrol.com" target="_blank">mac and pc desktop</a> apps to view the ful experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/nudibranch-experiment/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HTML5&#8242;s new Logo</title>
		<link>http://www.uncontrol.com/posts/html5s-new-logo/</link>
		<comments>http://www.uncontrol.com/posts/html5s-new-logo/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 16:12:04 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=533</guid>
		<description><![CDATA[I took it upon myself to make the new html5 branding more interesting. yeah it&#8217;s built in flash View it here or if you would like to convert it to a proper html5 logo, you can download the source. Edit : Yes it&#8217;s on purpose, yes it&#8217;s ironic and yes I&#8217;m being a dick about&#8230;]]></description>
			<content:encoded><![CDATA[<p>I took it upon myself to make the new html5 branding more interesting.</p>
<p><object width="440" height="440"><param name="movie" value="http://html5.uncontrol.com/HTML5Patch.swf"><param value="true"><embed src="http://html5.uncontrol.com/HTML5Patch.swf" type="application/x-shockwave-flash" width="440" height="440"></object></p>
<p>yeah it&#8217;s built in flash <img src='http://www.uncontrol.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>View it <a href="http://html5.uncontrol.com/index.html" target="HTML5Patch">here</a> or if you would like to convert it to a proper html5 logo, you can download the <a href="http://html5.uncontrol.com/HTML5Patch.zip" target="HTML5Patch">source</a>. </p>
<p>Edit : Yes it&#8217;s on purpose, yes it&#8217;s ironic and yes I&#8217;m being a dick about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/html5s-new-logo/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>balloon experiment</title>
		<link>http://www.uncontrol.com/posts/balloon-experiment/</link>
		<comments>http://www.uncontrol.com/posts/balloon-experiment/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 20:53:51 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=478</guid>
		<description><![CDATA[Written images is an upcoming book comprised of artists creating a series of code generated images. The content of each printed book is a random selection of those images, making each book unique. One of the available ways to submit work was to use processing as a medium. I&#8217;ve had some minor success manipulating coordinates in&#8230;]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/17146166?byline=0&amp;portrait=0" width="440" height="248" frameborder="0"></iframe></p>
<p><a href="http://balloon.uncontrol.com" target="_blank"><img title="balloon_md" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_md.jpg" rel="facebox" alt="" width="440" height="440" /></a></p>
<p><a href="http://writtenimages.net/" target="_blank">Written images</a> is an upcoming book comprised of artists creating a series of code generated images. The content of each printed book is a random selection of those images, making each book unique. One of the available ways to submit work was to use processing as a medium. I&#8217;ve had some minor success manipulating coordinates in 3d space with my previous flash projects so I assumed it would be easy to do it again in processing.</p>
<p><a href="http://flavorwire.com/wp-content/uploads/2009/03/jeff-koons.jpeg" rel="facebox"><img class="alignnone" title="'jeff koons'" src="http://flavorwire.com/wp-content/uploads/2009/03/jeff-koons.jpeg" alt="" width="440" height="330" /></a></p>
<p>My idea was to create a randomly generated balloon animals, looking specifically at how the joints are connected from segment to segment.  Each segment  has a specific length and a specific rotation which would be nested into the next segment until the dog shape emerges. It seemed simple and straightforward enough until I started rotating each balloon segment in 3d space. I assumed all rotations would be easy to create using only the base x,y,z axis rotations but boy was I wrong. Once I started nesting the segments it became harder and harder to predict where the rotations would end up. There was no easy way to solve this and the deadline was fast approaching so I had to shelf the project until I solve the rotation issue.</p>
<p>Without getting into the details, because frankly I still don&#8217;t completely understand them. There are a few ways to do rotations in 3d space. There&#8217;s Euler angles, matrix transformations, axis angle rotations and quaternion rotation. After testing every option, quaternion rotation seemed to be the solution. I&#8217;m slowly understanding quaternions which I learned from this <a href="http://www.gamemath.com/" target="_blank">book</a> and this <a href="http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Pseudo-code_for_rotating_using_a_quaternion_in_3D_space" target="_blank">wikipedia </a><a href="http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Pseudo-code_for_rotating_using_a_quaternion_in_3D_space" target="_self">article</a>.</p>
<p>The first thing I did was to randomly distribute a set of points that had no dependency with it&#8217;s previous segment. The white lines below represents the segment length and random position.</p>
<p><a href="http://balloon.uncontrol.com/v_03/Balloon/applet/index.html" target="_blank"><img title="balloon_02" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_02.jpg" rel="facebox" alt="" width="440" height="200" /></a></p>
<p>The violet and green lines represents the start and end 3d tangents of each segment respectively. Getting a 3d tangent aka a cross product is a little tricky only because it requires 2 vectors. I only had 1 so I arbitrarily created another one ( you can barely see it as a small white line extending from each segment corner). After normalizing the cross product and multiplying it by a radius I was able to get the violet and green dots that cap the lines.</p>
<p><a href="http://balloon.uncontrol.com/v_04/Balloon/applet/index.html" target="_blank"><img title="balloon_03" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_03.jpg" rel="facebox" alt="" width="440" height="200" /></a></p>
<p>Using the quaternion solution above, I was able to get a rotation around the off axis created by the segment line. I distributed the angles in relation to an arbitrary total number of points used to generate a circle and then connecting the front and back points to create a cylinder. I now have enough data to connect the lines using a bezier segment. Each line of a segment is comprised of 2 bezier curves, one from the front and 1 from the back. adjusting where the control points of the bezier are position govern the &#8216;shape&#8217; of the segment.</p>
<p><a href="http://balloon.uncontrol.com/v_05/Balloon/applet/index.html" target="_blank"><img title="balloon_04" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_04.jpg" rel="facebox" alt="" width="440" height="200" /></a></p>
<p>This is starting to look good but there was an issue with the segment edges. When I linked a segment, the cross products theoretically should be a mashup of the front and back of two segments. Currently there is no mashing going on so i needed a simple way of averaging of 2 vectors.</p>
<p><a href="http://balloon.uncontrol.com/v_06/Balloon/applet/index.html" target="_blank"><img title="balloon_05" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_05.jpg" rel="facebox" alt="" width="440" height="200" /></a></p>
<p>My first instinct was to use a SLERP which I will not describe because frankly i couldn&#8217;t get it to work. Instead I copped out and used a basic LERP which kind of works well enough to be passable. I think if I started to get serious about creating a balloon shape I&#8217;ll probably have to switch over. For now it works well enough. You can see the resulting LERP as the red dotted lines that orbits the joint between two segments.</p>
<p>The next step is to systematize all the arbitrary controls into a unified control panel. <a href="http://www.sojamo.de/libraries/controlP5/" target="_blank">ControlP5</a> made it really easy to add controls to the shape without having to create a radically new interface. <a href="http://mrfeinberg.com/peasycam/" target="_blank">PeasyCam</a> made it easy to rotate the balloon in 3d space. I&#8217;ll still need an easy way to modify each point manually but currently i&#8217;m happy with just using a random spread.</p>
<p><a href="http://balloon.uncontrol.com/v_07/Balloon/applet/index.html" target="_blank"><img title="balloon_06" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_06.jpg" rel="facebox" alt="" width="440" height="200" /></a></p>
<p>I added a few different views to make it more interesting and a randomizer button that repositions the segments over time. There&#8217;s still quite a few more things i&#8217;d like to add like audio input and video export but I&#8217;m happy with the result so far. Maybe if written images 2 rolls around I can resubmit this to the project.</p>
<p><a href="http://balloon.uncontrol.com/v_08/Balloon/applet/index.html" target="_blank"><img title="balloon_07" src="http://www.uncontrol.com/wp-content/uploads/2010/11/balloon_07.jpg" rel="facebox" alt="" width="420" height="294" /></a></p>
<p>In the meantime please enjoy the progression of work <a href="http://balloon.uncontrol.com/" target="_blank">here</a>.<br />
(Source and local version are also available).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/balloon-experiment/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>new redesign</title>
		<link>http://www.uncontrol.com/posts/new-redesign/</link>
		<comments>http://www.uncontrol.com/posts/new-redesign/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 01:15:40 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://www.uncontrol.com/?p=472</guid>
		<description><![CDATA[I&#8217;ve redesigned my site yet again. This iteration focuses more heavily on a blog format which I hear are all the rave these days. Although I&#8217;ve had some practical experience editing javascript, html and css, I&#8217;ve always felt a little uneasy when writing from scratch. So I&#8217;ve decided to use Khoi&#8217;s and Allan&#8217;s Basic Math&#8217;s&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve redesigned my site yet again. This iteration focuses more heavily on a blog format which I hear are all the rave these days. Although I&#8217;ve had some practical experience editing javascript, html and css, I&#8217;ve always felt a little uneasy when writing from scratch. So I&#8217;ve decided to use <a href="http://basicmaths.subtraction.com/">Khoi&#8217;s  and Allan&#8217;s Basic Math&#8217;s</a> template and slowly rework the code to something that fits my tastes. I&#8217;ve also switched to wordpress because it seems to offer a simple way of encapsulating everything I need in a blog without having to use an external blog service. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/new-redesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>umbrella experiment</title>
		<link>http://www.uncontrol.com/posts/379/</link>
		<comments>http://www.uncontrol.com/posts/379/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 23:26:55 +0000</pubDate>
		<dc:creator>mannytan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://blog.uncontrol.com/?p=379</guid>
		<description><![CDATA[Under my umbrella&#8230;ella&#8230;ella&#8230;hey&#8230;hey. In my previous experiment. I used a series of simple methods that calculates rotations in 3d space. For the most part it worked fine, so long as my rotations were parallel to the x, y and z axis. But once the rotation was along an off axis, the math became terribly complex&#8230;]]></description>
			<content:encoded><![CDATA[<p><a target="umbrella" href="http://www.uncontrol.com/content/umbrella/index.html"><img class="alignnone" title="umbrella_sm" src="http://www.uncontrol.com/wp-content/uploads/2010/11/umbrella_sm.jpg" rel="facebox" alt="" width="440" height="248" /></a></p>
<p>Under my umbrella&#8230;ella&#8230;ella&#8230;hey&#8230;hey.</p>
<p>In my previous experiment. I used a series of simple methods that calculates rotations in 3d space. For the most part it worked fine, so long as my rotations were parallel to the x, y and z axis. But once the rotation was along an off axis, the math became terribly complex and I entered a world of hurt trying to get my head around quaternions. Pouring through wikis about SLERPs and cross/dot products, I think I finally reached a point were I&#8217;ve learned just enough to come up with this umbrella experiment.</p>
<p>I&#8217;ve been having some issues with playing java applets online so I created local versions to play with on a  <a href="http://www.uncontrol.com/content/umbrella/application.macosx.zip">mac</a> or a <a href="http://www.uncontrol.com/content/umbrella/application.windows.zip">pc</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncontrol.com/posts/379/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

