<?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>usc interactive media division &#187; 532</title>
	<atom:link href="http://interactive.usc.edu/tag/532/feed/" rel="self" type="application/rss+xml" />
	<link>http://interactive.usc.edu</link>
	<description></description>
	<lastBuildDate>Thu, 24 May 2012 16:43:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>On Designing TweetWorld</title>
		<link>http://interactive.usc.edu/2011/12/05/tweet-world-atlas/</link>
		<comments>http://interactive.usc.edu/2011/12/05/tweet-world-atlas/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 15:16:26 +0000</pubDate>
		<dc:creator>VJ Um Amel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12513</guid>
		<description><![CDATA[THE ATLAS (This is part one. Part two includes interactive section.) If you had told me 2 years ago that...<br /><a class="more-link" href="http://interactive.usc.edu/2011/12/05/tweet-world-atlas/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p>THE ATLAS (This is part one. Part two includes interactive section.)</p>
<p>If you had told me 2 years ago that I&#8217;d one day watch governments fall 140 characters at a time, I&#8217;d have called you crazy.  Is that really what happened? Or is Twitter just a part of a larger paradigmatic shift, taking hold in younger generations.  I do not question its truth claim: it does not matter.  The idea behind building a 3D immersive world of Twitter data is to offer the general public an opportunity to re-imagine their relationship with technology.  The goal of the game is to find the original tweet. It’s a game of exploration. </p>
<p><iframe src="http://player.vimeo.com/video/30667863?title=0&amp;byline=0&amp;portrait=0" width="375" height="211" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>Through a process of cultural analytics, this 3D Unity game is designed to DEFAMILIARIZE its user from what it thinks the culture of Twitter, or the culture of the Middle East, or the culture of Arab activism, revolution, and social networking might be all about.</p>
<p>Here are a couple of important footnotes on the art of &#8220;defamiliarization:&#8221;</p>
<p><em>P. B. Shelley in his, &#8220;Defence of Poetry&#8221; (1821), and of several modern, Russian formalist critics, made the claim it is a distinctive feature of literature, especially poetry, that it tears away what Shelley called the ‘veil of familiarity’ from the world, making us look at it afresh. </em> 1.   <a href="http://www.bartleby.com/27/23.html">“A Defence of Poetry” by P.B. Shelley</a>. </p>
<p><em>.&#8221;..it is necessary to make it strange, or defamiliarize it, in order to open its design space. Critical approaches to technology design are of both practical and social importance in the home. Home appliances are loaded with cultural associations such as the gendered division of domestic labor that are easy to overlook. Further, homes are not the same everywhere—even within a country. Peoples’ aspirations and desires differ greatly across and between cultures. The target of western domestic technology design is often not the user, but the consumer. Web refrigerators that create shopping lists, garbage cans that let advertisers know what is thrown away, cabinets that monitor their contents and order more when supplies are low are central to current images of the wireless, digital home of the future. Drawing from our research in the United States, the United Kingdom, and Asia, we provide three different narratives of defamiliarization. A historical reading of American kitchens provides a lens with which to scrutinize new technologies of domesticity, an ethnographic account of an extended social unit in England problematizes taken-for-granted domestic technologies, and a comparative ethnography of the role of information and communication technologies in the daily lives of urban Asia’s middle classes reveals the ways in which new technologies can be captured and domesticated in unexpected ways. In the ﬁnal section of the article, we build on these moments of defamiliarization to suggest a broad set of challenges and strategies for design in the home. </em>  2. <a href="http://luci.ics.uci.edu/websiteContent/weAreLuci/biographies/faculty/djp3/LocalCopy/p149-bell.pdf">From “Making by Making Strange: Defamiliarization and the Design of Domestic Technologies” By GENEVIEVE BELL, Intel Research; MARK BLYTHE, University of York, and PHOEBE SENGERS, Cornell University.</a></p>
<p>Accordingly, every design choice along the way has been a choice to defamiliarize the player.  If I were to ask a sample of 100 people who live in any major city in the world about Twitter, many would at least know about it and might provide vague, ephemeral adjectives to describe what they imagine Twitter to be and how people interact with it. Perhaps a black, outer space –like, future-fantasy aesthetic would predominate the scene.</p>
<p>And so, in an attempt, to &#8216;lift the veil of familiarity&#8217; around Twitter – I built a space that had organic things like trees and a blue sky.  The choice to make the ground white seemed odd -– and gave a sense of lightness on a topic that doesn’t sound so light -– Middle East Revolutions. And the music too was chosen to make you think, “huh, that’s not what I was expecting.”  What was the user expecting?  And why did the user come with such expectations? </p>
<p>Likewise, the choice to have a human 3rd person player was a choice to make the unreal world of Twitter seem real – and give it a strong human perspective….grounded.  The elevation of the ground represent the number of tweets and retweeting so that the player gets a sense of immersion in the tweets themselves – and the maneuverability was meant to be challenging.  </p>
<p>Aesthetically, it is an attempt to transform a 2D data visualization into a 3D immersive environment.  My challenge here was to make a live streaming 3D data visualization.  Here is the original 2D image:</p>
<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/12/Slide30.jpg"><img src="http://interactive.usc.edu/wp-content/uploads/2011/12/Slide30.jpg" alt="" title="Slide30" width="720" height="540" class="aligncenter size-full wp-image-12522" /></a></p>
<p>HOW TO PLAY:<br />
The green waterfalls are Arabic tweets, the blue waterfalls are English tweets, and the red ones are French tweets.   The more elevated the terrain the more retweeting occurred. Your mission is to find the original tweet in each language.  The winners get access to the data.</p>
<p>The data itself will appear in CSV downloadable links. You will be able to download four distinct CSV files for each of the hashtags you find.  The four CSV files will include (1) our statistics on the data by day; (2) our statistics on the data by hour; (3) our statistics on the data by minute; (4) the original, raw tweet data.  This will appear in a database structure of rows and columns for the player to use in any imaginative way.</p>
<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/12/SAKR-atlas-tweetworld.jpg"><img src="http://interactive.usc.edu/wp-content/uploads/2011/12/SAKR-atlas-tweetworld-625x1024.jpg" alt="" title="SAKR-atlas-tweetworld" width="625" height="1024" class="aligncenter size-large wp-image-12514" /></a></p>
<p><iframe src="http://player.vimeo.com/video/32640763?portrait=0&amp;color=ffffff" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/12/05/tweet-world-atlas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Slipstream Archipelago Atlas</title>
		<link>http://interactive.usc.edu/2011/11/21/the-slipstream-archipelago-atlas/</link>
		<comments>http://interactive.usc.edu/2011/11/21/the-slipstream-archipelago-atlas/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 20:00:27 +0000</pubDate>
		<dc:creator>Alexander Beachum</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[atlas]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12424</guid>
		<description><![CDATA[The Slipstream Archipelago Atlas]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/AlexBeachum_WorldAtlas.pdf">The Slipstream Archipelago Atlas</a></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/21/the-slipstream-archipelago-atlas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scryptyria Atlas</title>
		<link>http://interactive.usc.edu/2011/11/21/scryptyria-atlas/</link>
		<comments>http://interactive.usc.edu/2011/11/21/scryptyria-atlas/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 17:13:37 +0000</pubDate>
		<dc:creator>Sarah Scialli</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12418</guid>
		<description><![CDATA[Here is the link to my Atlas for World Building: ScryptyriaAtlas &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>Here is the link to my Atlas for World Building: <a title="ScryptyriaAtlas" href="http://interactive.usc.edu/wp-content/uploads/2011/11/ScryptyriaAtlas.pdf">ScryptyriaAtlas</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/21/scryptyria-atlas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Early Reaction/Diffusion Code</title>
		<link>http://interactive.usc.edu/2011/11/07/early-reactiondiffusion-code/</link>
		<comments>http://interactive.usc.edu/2011/11/07/early-reactiondiffusion-code/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 01:30:04 +0000</pubDate>
		<dc:creator>Todd Furmanski</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12290</guid>
		<description><![CDATA[This shows an early version of my Wu Xing-inspired cellular automata, taking the form of a Reaction-Diffusion model.  This isn&#8217;t...<br /><a class="more-link" href="http://interactive.usc.edu/2011/11/07/early-reactiondiffusion-code/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/WuXingReactDiff.jpg"><img class="alignnone size-full wp-image-12291" title="WuXingReactDiff" src="http://interactive.usc.edu/wp-content/uploads/2011/11/WuXingReactDiff.jpg" alt="" width="512" height="512" /></a></p>
<p>This shows an early version of my Wu Xing-inspired cellular automata, taking the form of a Reaction-Diffusion model.  This isn&#8217;t as commented and a little more obscure than the DLA code, but you should be able to copy/paste the code into processing and get a simple reaction/diffusion cellular automata in Processing:</p>
<p><span id="more-12290"></span></p>
<p><span style="color: #00ff00;">class WuXingCell </span></p>
<h5><span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> float[] element;</span><br />
<span style="color: #00ff00;">};</span>&nbsp;</p>
<p><span style="color: #00ff00;">int worldScale = 8;</span><br />
<span style="color: #00ff00;">int worldSize = 64;</span><br />
<span style="color: #00ff00;">int mode = 1;</span><br />
<span style="color: #00ff00;">WuXingCell[][] world;</span><br />
<span style="color: #00ff00;">WuXingCell[][] nextWorld;</span><br />
<span style="color: #00ff00;">color[] WuXingColor;</span></p>
<p><span style="color: #00ff00;">float waterLevel = .25;</span></p>
<p><span style="color: #00ff00;">int dayBand = 0;</span></p>
<p><span style="color: #00ff00;">float natLog = 0.36787944118;</span><br />
<span style="color: #00ff00;">float eLog = 2.7182818284;</span></p>
<p><span style="color: #00ff00;">float growRate = .2;</span><br />
<span style="color: #00ff00;">float destroyRate = .11;</span><br />
<span style="color: #00ff00;">float insultRate = .1;</span></p>
<p><span style="color: #00ff00;">float growThresh = .1;</span><br />
<span style="color: #00ff00;">float destroyThresh = .2;</span><br />
<span style="color: #00ff00;">float insultThresh = .4;</span></p>
<p><span style="color: #00ff00;">float[] elementFlow; //how much is moved when it erodes</span><br />
<span style="color: #00ff00;">float[] elementStrength; //when element decides to erode</span><br />
<span style="color: #00ff00;">float[] elementDistScale; //distance from strongest points</span><br />
<span style="color: #00ff00;">float[] elementReactivity;</span></p>
<p><span style="color: #00ff00;">int dominantElement = 0;</span></p>
<p><span style="color: #00ff00;">float seaLevel = 0;</span></p>
<p><span style="color: #00ff00;">int water = 0; //we do this so the code is more readable, also showing the cyclical order</span><br />
<span style="color: #00ff00;">int wood = 1;</span><br />
<span style="color: #00ff00;">int fire = 2;</span><br />
<span style="color: #00ff00;">int earth = 3;</span><br />
<span style="color: #00ff00;">int metal = 4;</span></p>
<p><span style="color: #00ff00;">int mouseElement = 0;</span></p>
<p><span style="color: #00ff00;">float[] alchemyAmounts;</span><br />
<span style="color: #00ff00;">float[] alchemyAdditives;</span></p>
<p><span style="color: #00ff00;">boolean elementPoles = true;</span></p>
<p><span style="color: #00ff00;">boolean react = false;</span></p>
<p><span style="color: #00ff00;">void updateWorld()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> world[i][j].element[k] = nextWorld[i][j].element[k];</span><br />
<span style="color: #00ff00;"> //print(&#8220;.&#8221;);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void ProcessWorld()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++) //imagine 5 buckets in each cell, we look at them and their neighbors&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k] = world[i][j].element[k];</span></p>
<p><span style="color: #00ff00;"> for (int adjI = -1; adjI &lt; 2; adjI++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int adjJ = -1; adjJ &lt; 2; adjJ++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k] += (world[LoopVar(i + adjI)][LoopVar(j + adjJ)].element[k]) * (0.125); //0.125 = 1/8th, averaging the 8 adjacent cells</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> ProcessAlchemy(); //now that we have the amoutns, process what they do&#8230;</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++) //a little bit of hacky averaging, and updating the old board</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k]/=2;</span><br />
<span style="color: #00ff00;"> nextWorld[i][j].element[k] = alchemyAmounts[k];</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void ProcessAlchemy()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> float[] newAlchemy = new float[5];</span><br />
<span style="color: #00ff00;"> float[] fractionOf = new float[5];</span><br />
<span style="color: #00ff00;"> float totalAmount = 0;</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> newAlchemy[k] = alchemyAmounts[k];</span><br />
<span style="color: #00ff00;"> totalAmount += alchemyAmounts[k];</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> fractionOf[k] = totalAmount/alchemyAmounts[k];</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> int grandParent, parent, child, grandChild;</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++) //figure out what elements are &#8220;parent&#8221;, &#8220;child&#8221; etc. relative to the one you&#8217;re on</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = 6;</span><br />
<span style="color: #00ff00;"> parent = 6;</span><br />
<span style="color: #00ff00;"> child = 6;</span><br />
<span style="color: #00ff00;"> grandChild = 6; </span></p>
<p><span style="color: #00ff00;"> if (k == water)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = earth;</span><br />
<span style="color: #00ff00;"> parent = metal;</span><br />
<span style="color: #00ff00;"> child = wood;</span><br />
<span style="color: #00ff00;"> grandChild = fire; </span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (k == wood)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = metal;</span><br />
<span style="color: #00ff00;"> parent = water;</span><br />
<span style="color: #00ff00;"> child = fire;</span><br />
<span style="color: #00ff00;"> grandChild = earth; </span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (k == fire)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = water;</span><br />
<span style="color: #00ff00;"> parent = wood;</span><br />
<span style="color: #00ff00;"> child = earth;</span><br />
<span style="color: #00ff00;"> grandChild = metal; </span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (k == earth)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = wood;</span><br />
<span style="color: #00ff00;"> parent = fire;</span><br />
<span style="color: #00ff00;"> child = metal;</span><br />
<span style="color: #00ff00;"> grandChild = water; </span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (k == metal)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> grandParent = fire;</span><br />
<span style="color: #00ff00;"> parent = earth;</span><br />
<span style="color: #00ff00;"> child = water;</span><br />
<span style="color: #00ff00;"> grandChild = wood; </span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> elementReactivity[k] = 1;// *= 1.5; //how much do we react the elements (scalar, multply by this amount)</span><br />
<span style="color: #00ff00;"> //natLog = .3;</span><br />
<span style="color: #00ff00;"> newAlchemy[k] += (alchemyAmounts[parent] * natLog); </span><br />
<span style="color: #00ff00;"> newAlchemy[k] -= (alchemyAmounts[child] * natLog);</span><br />
<span style="color: #00ff00;"> if (alchemyAmounts[grandParent] &gt; alchemyAmounts[k]) //grandfather destroys&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> newAlchemy[k] -= (alchemyAmounts[grandParent] * natLog);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> // else //&#8230;or it&#8217;s too big and we&#8217;re insulted</span><br />
<span style="color: #00ff00;"> if (alchemyAmounts[grandChild] &gt; alchemyAmounts[k])// //grandfather destroys&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> newAlchemy[k] -= (alchemyAmounts[grandParent] * natLog);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if ( newAlchemy[k] &gt; 1.0)  newAlchemy[k] = 1.0;</span><br />
<span style="color: #00ff00;"> if ( newAlchemy[k] &lt; 0.0)  newAlchemy[k] = 0.0;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k] = newAlchemy[k];</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void draw()</span><br />
<span style="color: #00ff00;">{</span></p>
<p><span style="color: #00ff00;"> dominantElement += 1;</span><br />
<span style="color: #00ff00;"> if (dominantElement &gt;= 5) dominantElement = 0;</span></p>
<p><span style="color: #00ff00;"> ProcessWorld();</span><br />
<span style="color: #00ff00;"> ProcessAlchemy();</span></p>
<p><span style="color: #00ff00;"> updateWorld();</span><br />
<span style="color: #00ff00;"> background(0);</span><br />
<span style="color: #00ff00;"> color pixelColor = color(0,0,0);</span></p>
<p><span style="color: #00ff00;"> float finRed, finGreen, finBlue;</span></p>
<p><span style="color: #00ff00;"> if(keyPressed) {</span></p>
<p><span style="color: #00ff00;"> if (key == &#8217;0&#8242;) {</span><br />
<span style="color: #00ff00;"> alchemyAdditives[water] += .1;</span><br />
<span style="color: #00ff00;"> //mouseElement = water;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8217;1&#8242;) {</span><br />
<span style="color: #00ff00;"> alchemyAdditives[wood] += .1;</span><br />
<span style="color: #00ff00;"> //mouseElement = wood;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8217;2&#8242;) {</span><br />
<span style="color: #00ff00;"> alchemyAdditives[fire] += .1;</span><br />
<span style="color: #00ff00;"> //mouseElement = fire;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8217;3&#8242;) {</span><br />
<span style="color: #00ff00;"> alchemyAdditives[earth] += .1;</span><br />
<span style="color: #00ff00;"> //mouseElement = earth;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8217;4&#8242;) {</span><br />
<span style="color: #00ff00;"> alchemyAdditives[metal] += .1;</span><br />
<span style="color: #00ff00;"> //mouseElement = metal;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8216;r&#8217;) {</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k]= random(0,1.0);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8216;e&#8217;) {</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k]= 0;</span><br />
<span style="color: #00ff00;"> alchemyAdditives[k] = 0;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> //mouseElement = water;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (key == &#8216;t&#8217;) {</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> alchemyAmounts[k] += alchemyAdditives[k];</span><br />
<span style="color: #00ff00;"> alchemyAdditives[k] = 0;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> //mouseElement = water;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> float maxElement = 0;</span><br />
<span style="color: #00ff00;"> int theMaxElement = 0;</span><br />
<span style="color: #00ff00;"> int numElements = 0;</span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++) //do a bunch of comparisons to get colors, but we&#8217;re basically looping through the board and drawing</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> finRed = 0; </span><br />
<span style="color: #00ff00;"> finGreen = 0;</span><br />
<span style="color: #00ff00;"> finBlue = 0;</span></p>
<p><span style="color: #00ff00;"> maxElement = 0;</span><br />
<span style="color: #00ff00;"> theMaxElement = 0;</span></p>
<p><span style="color: #00ff00;"> numElements = 0;</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> if (world[i][j].element[k] &gt; maxElement)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> maxElement = world[i][j].element[k];</span><br />
<span style="color: #00ff00;"> theMaxElement = k;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (world[i][j].element[k] &gt; 0)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> numElements++;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> finRed += (red(WuXingColor[k]) * world[i][j].element[k]);</span><br />
<span style="color: #00ff00;"> finGreen += (green(WuXingColor[k]) * world[i][j].element[k]);</span><br />
<span style="color: #00ff00;"> finBlue += (blue(WuXingColor[k]) * world[i][j].element[k]);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> finRed /= numElements;</span><br />
<span style="color: #00ff00;"> finGreen /= numElements;</span><br />
<span style="color: #00ff00;"> finBlue /= numElements;</span></p>
<p><span style="color: #00ff00;"> if (((world[i][j].element[earth] + world[i][j].element[metal])/2) &lt;= seaLevel)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> pixelColor = color(0,0,seaLevel);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> else</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> pixelColor = WuXingColor[theMaxElement];//color(finRed,finGreen,finBlue);</span><br />
<span style="color: #00ff00;"> //pixelColor *= world[i][j].element[theMaxElement];</span><br />
<span style="color: #00ff00;"> //pixelColor = color(world[i][j].element[3],world[i][j].element[2],0);</span><br />
<span style="color: #00ff00;"> switch(theMaxElement)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> case 0:</span><br />
<span style="color: #00ff00;"> pixelColor = color(0,world[i][j].element[0],world[i][j].element[0]);</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 1:</span><br />
<span style="color: #00ff00;"> pixelColor = color(0,world[i][j].element[1],0);</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 2:</span><br />
<span style="color: #00ff00;"> pixelColor = color(1.0,0,0); </span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 3:</span><br />
<span style="color: #00ff00;"> pixelColor = color(world[i][j].element[3],world[i][j].element[2],0);</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 4:</span><br />
<span style="color: #00ff00;"> pixelColor = color(world[i][j].element[3],world[i][j].element[3],world[i][j].element[2]);</span><br />
<span style="color: #00ff00;"> break;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> pixelColor = color(finRed,finGreen,finBlue);//color(finRed,finGreen,finBlue);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (((world[i][j].element[earth] + world[i][j].element[earth])/2) &gt; seaLevel)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> //pixelColor = color(0,(world[i][j].element[earth] + world[i][j].element[earth])/2,0);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> else</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> //pixelColor = color(0,(world[i][j].element[earth] + world[i][j].element[earth])/2,.75);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (((world[i][j].element[earth] + world[i][j].element[metal])/2) &lt;= seaLevel)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> //pixelColor = color(0,0,seaLevel);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> else</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> //pixelColor = color(finRed,finGreen,finBlue);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> //    if (elementVision != 5) pixelColor = color(0,world[i][j].element[elementVision],0);</span><br />
<span style="color: #00ff00;"> //pixelColor = color(0,world[i][j].element[metal],0);</span></p>
<p><span style="color: #00ff00;"> // pixelColor = color(0,0, world[i][j].element[0] );</span></p>
<p><span style="color: #00ff00;"> //pixelColor = color (world[i][j].element[0],0,0);</span><br />
<span style="color: #00ff00;"> //set (i * 2,j * 2,pixelColor); </span></p>
<p><span style="color: #00ff00;"> //set (i * 1,j * 1,pixelColor); </span><br />
<span style="color: #00ff00;"> fill(pixelColor);</span><br />
<span style="color: #00ff00;"> rect(i * worldScale, j * worldScale, (i * worldScale) + (worldScale &#8211; 1), (j * worldScale) + (worldScale &#8211; 1));</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">float Clamp(float tempVar, float low, float high)</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> if (tempVar &lt; low) tempVar = low;</span><br />
<span style="color: #00ff00;"> if (tempVar &gt; high) tempVar = high;</span><br />
<span style="color: #00ff00;"> return tempVar;</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">int LoopVar(int theVar) //clamps var to make sure we loop, assume error is never more than one or two &#8220;off map&#8221;</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> if (theVar &lt; 0)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> theVar += worldSize;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (theVar &gt;= worldSize)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> theVar -= worldSize;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> return theVar;</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void setup()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> //worldScale = 2;</span><br />
<span style="color: #00ff00;"> frameRate(24);</span><br />
<span style="color: #00ff00;"> colorMode(RGB, 1.0);</span><br />
<span style="color: #00ff00;"> size(worldSize * worldScale,worldSize * worldScale);</span><br />
<span style="color: #00ff00;"> world = new WuXingCell[worldSize][worldSize];</span><br />
<span style="color: #00ff00;"> nextWorld = new WuXingCell[worldSize][worldSize];</span></p>
<p><span style="color: #00ff00;"> //growRate = .2;</span><br />
<span style="color: #00ff00;"> //destroyRate = .2;</span><br />
<span style="color: #00ff00;"> //insultRate = .1;</span></p>
<p><span style="color: #00ff00;"> WuXingColor = new color[5];</span></p>
<p><span style="color: #00ff00;"> WuXingColor[water] = color(0,0,1);//water</span><br />
<span style="color: #00ff00;"> WuXingColor[wood] = color(0,1,0);//wood</span><br />
<span style="color: #00ff00;"> WuXingColor[fire] = color(1,0,0);//fire</span><br />
<span style="color: #00ff00;"> WuXingColor[earth] = color(1,1,0);//earth</span><br />
<span style="color: #00ff00;"> WuXingColor[metal] = color(1,1,1);//metal</span></p>
<p><span style="color: #00ff00;"> elementFlow = new float[5];</span><br />
<span style="color: #00ff00;"> elementStrength = new float[5];</span><br />
<span style="color: #00ff00;"> elementDistScale = new float[5];</span><br />
<span style="color: #00ff00;"> elementReactivity = new float[5];</span></p>
<p><span style="color: #00ff00;"> alchemyAmounts = new float[5];</span><br />
<span style="color: #00ff00;"> alchemyAdditives = new float[5];</span></p>
<p><span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> elementFlow[k] = 0;</span><br />
<span style="color: #00ff00;"> elementStrength[k] = 0;</span><br />
<span style="color: #00ff00;"> elementDistScale[k] = 1;</span><br />
<span style="color: #00ff00;"> elementReactivity[k] = 1;</span></p>
<p><span style="color: #00ff00;"> alchemyAmounts[k] = 0.5;//random(0,1.0);</span><br />
<span style="color: #00ff00;"> alchemyAdditives[k] = 0;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> elementFlow[earth] = .05; //earth</span><br />
<span style="color: #00ff00;"> elementStrength[earth] = .1;</span></p>
<p><span style="color: #00ff00;"> //elementFlow[metal] = .25; //metal</span><br />
<span style="color: #00ff00;"> //elementStrength[metal] = .3;</span></p>
<p><span style="color: #00ff00;"> elementFlow[metal] = .4; //metal</span><br />
<span style="color: #00ff00;"> elementStrength[metal] = .5;</span></p>
<p><span style="color: #00ff00;"> elementFlow[fire] = .21; </span><br />
<span style="color: #00ff00;"> elementStrength[fire] = .11;</span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> world[i][j] = new WuXingCell();</span><br />
<span style="color: #00ff00;"> world[i][j].element = new float[5];</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> world[i][j].element[k] = random(.1,.9);//.25 + random(0,.5);//random(0.0,1.0);//.5;</span><br />
<span style="color: #00ff00;"> // world[i][j].element[k] = 0.5;</span><br />
<span style="color: #00ff00;"> //world[i][j].element[k]/=255;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> //world[i][j].element[0] = .6;</span></p>
<p><span style="color: #00ff00;"> //world[i][j].element[0] = .2;</span></p>
<p><span style="color: #00ff00;"> nextWorld[i][j] = new WuXingCell();</span><br />
<span style="color: #00ff00;"> nextWorld[i][j].element = new float[5];</span><br />
<span style="color: #00ff00;"> for (int k = 0; k &lt; 5; k++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> nextWorld[i][j].element[k] = 1;//random(0,1);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> //print(&#8221; &#8220;);</span><br />
<span style="color: #00ff00;"> //print(world[i][j].terraHeight);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> //ProcessHeat();</span><br />
<span style="color: #00ff00;">}</span></h5>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/early-reactiondiffusion-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Diffusion Limited Aggregation code:</title>
		<link>http://interactive.usc.edu/2011/11/07/world-building-code/</link>
		<comments>http://interactive.usc.edu/2011/11/07/world-building-code/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 01:11:39 +0000</pubDate>
		<dc:creator>Todd Furmanski</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12282</guid>
		<description><![CDATA[Here is the Diffusion Limited Aggregation code, to make the lighting-bolt, ice-crystal patterns &#8211; I&#8217;ve had trouble posting the working...<br /><a class="more-link" href="http://interactive.usc.edu/2011/11/07/world-building-code/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/DLA.gif"><img class="alignnone size-full wp-image-12326" title="DLA" src="http://interactive.usc.edu/wp-content/uploads/2011/11/DLA.gif" alt="" width="254" height="253" /></a></p>
<p>Here is the Diffusion Limited Aggregation code, to make the lighting-bolt, ice-crystal patterns &#8211; I&#8217;ve had trouble posting the working Processing sketch here before but here&#8217;s the code.  Copying and pasting into a new sketch <em>should</em> do the trick:</p>
<p><span id="more-12282"></span></p>
<h5 style="padding-left: 30px;"><span style="color: #00ff00;">int[][] world;</span><br />
<span style="color: #00ff00;">int[][] nextWorld;</span><br />
<span style="color: #00ff00;">int worldSize = 256;</span><br />
<span style="color: #00ff00;">float time = 0;</span><br />
<span style="color: #00ff00;">color black, purple, white;</span><br />
<span style="color: #00ff00;">int wl,wr,wt,wb;</span>&nbsp;</p>
<p><span style="color: #00ff00;">void setup()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> colorMode(RGB, 1.0);</span><br />
<span style="color: #00ff00;"> size(worldSize,worldSize);</span></p>
<p><span style="color: #00ff00;"> black = color(0,0,0);</span><br />
<span style="color: #00ff00;"> purple = color(1,0,1);</span><br />
<span style="color: #00ff00;"> white = color(1,1,1);</span></p>
<p><span style="color: #00ff00;"> //Cellular Automata usually needs two arrays, you refer to one to build the next, here</span><br />
<span style="color: #00ff00;"> //we initialize both:</span></p>
<p><span style="color: #00ff00;"> world = new int[worldSize][worldSize];</span><br />
<span style="color: #00ff00;"> nextWorld = new int[worldSize][worldSize];</span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> world[i][j] = 0;</span><br />
<span style="color: #00ff00;"> nextWorld[i][j] = 0; </span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> world[worldSize/2][worldSize/2] = 2;</span><br />
<span style="color: #00ff00;"> wl = wr = wt = wb = worldSize/2;</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void ProcessWorld() //0 = black/balnk, 1 = moving/purple, 2 = white, crystallized</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> int randDir;</span><br />
<span style="color: #00ff00;"> int ib, jb;</span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++) //loop through world and compare cells</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span></p>
<p><span style="color: #00ff00;"> if (CheckAdj(i,j,3)) //if area has something, don&#8217;t do anything, otherwise&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> else //&#8230;create a wandering cell</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> if (random(0,100) &lt; 2) nextWorld[i][j] = 1;</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (world[i][j] == 2) //keep the crystallized white cells</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> nextWorld[i][j] = 2;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> if (world[i][j] == 1) //if we have a purple, wandering cell, we have a little more to do&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> if (CheckAdj(i,j,1)) //if we&#8217;re next to a crystal cell, crystallize this one.</span><br />
<span style="color: #00ff00;"> { </span><br />
<span style="color: #00ff00;"> nextWorld[i][j] = 2;</span><br />
<span style="color: #00ff00;"> if (i &lt; wl) wl = i; //make sure the borders are ok</span><br />
<span style="color: #00ff00;"> if (i &gt; wr) wr = i;</span><br />
<span style="color: #00ff00;"> if (j &lt; wt) wt = j;</span><br />
<span style="color: #00ff00;"> if (j &gt; wb) wb = j;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> else //if we&#8217;re _not_ next to a crystallized cell, we wander</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> nextWorld[i][j] = 0; //we move away from where we are, leaving it blank</span><br />
<span style="color: #00ff00;"> randDir = (int)random(0,4); //move a random direction, North, South, East, or West&#8230;</span><br />
<span style="color: #00ff00;"> ib = i;</span><br />
<span style="color: #00ff00;"> jb = j;</span></p>
<p><span style="color: #00ff00;"> if (ib &lt; 1) ib = 1; //respect the boundaries, don&#8217;t move off the board!</span><br />
<span style="color: #00ff00;"> if (ib &gt; (worldSize &#8211; 2)) ib = worldSize &#8211; 2;</span></p>
<p><span style="color: #00ff00;"> if (jb &lt; 1) jb = 1;</span><br />
<span style="color: #00ff00;"> if (jb &gt; (worldSize &#8211; 2)) jb = worldSize &#8211; 2;</span></p>
<p><span style="color: #00ff00;"> switch(randDir){ //here we move the purple cell to a new, blank cell</span><br />
<span style="color: #00ff00;"> case 0:</span><br />
<span style="color: #00ff00;"> nextWorld[(ib + 1)][jb] = 1;</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 1:</span><br />
<span style="color: #00ff00;"> nextWorld[(ib - 1)][jb] = 1;</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 2:</span><br />
<span style="color: #00ff00;"> nextWorld[ib][(jb - 1)] = 1;</span><br />
<span style="color: #00ff00;"> break;</span></p>
<p><span style="color: #00ff00;"> case 3:</span><br />
<span style="color: #00ff00;"> nextWorld[ib][(jb + 1)] = 1;</span><br />
<span style="color: #00ff00;"> break;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> } </span><br />
<span style="color: #00ff00;"> } </span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize; i++) //now, we move the newly calcualted &#8220;nextWorld&#8221; back to the original, and start again&#8230;</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> world[i][j] = nextWorld[i][j];</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">boolean CheckAdj(int i, int j, int rad) //compare the adjacent cells, return if there&#8217;s a crystallized cell</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> int x = i;</span><br />
<span style="color: #00ff00;"> int y = j;</span><br />
<span style="color: #00ff00;"> boolean adj = false;</span></p>
<p><span style="color: #00ff00;"> int ixb,iyb;</span></p>
<p><span style="color: #00ff00;"> for (int ix = x &#8211; rad; ix &lt;= x + rad; ix++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int iy = y &#8211; rad; iy &lt;= y + rad; iy++)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> ixb = ix;</span><br />
<span style="color: #00ff00;"> iyb = iy;</span></p>
<p><span style="color: #00ff00;"> if (ixb &lt; 0) ixb = 0; //make sure we stay in borders of cell, do not want to look beyond the borders&#8230;</span><br />
<span style="color: #00ff00;"> if (iyb &lt; 0) iyb = 0;</span></p>
<p><span style="color: #00ff00;"> if (ixb &gt; worldSize &#8211; 1) ixb = worldSize &#8211; 1;</span><br />
<span style="color: #00ff00;"> if (iyb &gt; worldSize &#8211; 1) iyb = worldSize &#8211; 1;</span></p>
<p><span style="color: #00ff00;"> if (world[ixb][iyb] == 2)</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> adj = true;</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> return adj;</span><br />
<span style="color: #00ff00;">}</span></p>
<p><span style="color: #00ff00;">void draw()</span><br />
<span style="color: #00ff00;">{</span><br />
<span style="color: #00ff00;"> ProcessWorld();</span></p>
<p><span style="color: #00ff00;"> int ib,jb;</span></p>
<p><span style="color: #00ff00;"> for (int i = 0; i &lt; worldSize;i++)  //simply loop through and draw the array</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> for (int j = 0; j &lt; worldSize; j++)</span><br />
<span style="color: #00ff00;"> {</span></p>
<p><span style="color: #00ff00;"> ib = i;</span><br />
<span style="color: #00ff00;"> jb = j;</span></p>
<p><span style="color: #00ff00;"> if (ib &lt; 1) ib = 1;</span><br />
<span style="color: #00ff00;"> if (ib &gt; (worldSize &#8211; 2)) ib = worldSize &#8211; 2;</span></p>
<p><span style="color: #00ff00;"> if (jb &lt; 1) jb = 1;</span><br />
<span style="color: #00ff00;"> if (jb &gt; (worldSize &#8211; 2)) jb = worldSize &#8211; 2;</span></p>
<p><span style="color: #00ff00;"> if (world[i][j] == 0) //blank cell</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> set(i,j,black);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (world[i][j] == 1) //purple wanderers</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> set(i,j,purple); //comment this out and put in the next line if you want invisible wanderers</span><br />
<span style="color: #00ff00;"> //set(i,j,black);</span><br />
<span style="color: #00ff00;"> }</span></p>
<p><span style="color: #00ff00;"> if (world[i][j] == 2) //white, crysal cell</span><br />
<span style="color: #00ff00;"> {</span><br />
<span style="color: #00ff00;"> set(i,j,white);</span><br />
<span style="color: #00ff00;"> //print (&#8220;Boo!&#8221;);</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;"> }</span><br />
<span style="color: #00ff00;">}</span></h5>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/world-building-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Other emergent/generative worlds</title>
		<link>http://interactive.usc.edu/2011/11/07/other-emergentgenerative-worlds/</link>
		<comments>http://interactive.usc.edu/2011/11/07/other-emergentgenerative-worlds/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 00:44:50 +0000</pubDate>
		<dc:creator>Peggy Weil</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12278</guid>
		<description><![CDATA[Todd Furmanski showed several examples, here are a few more: Rebecca Allen&#8217;s BUSH SOUL and EMERGENCE system, designed in 1998:...<br /><a class="more-link" href="http://interactive.usc.edu/2011/11/07/other-emergentgenerative-worlds/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p>Todd Furmanski showed several examples, here are a few more:</p>
<p>Rebecca Allen&#8217;s <a href="http://rebeccaallen.com/v2/work/work.php?wNR=31&amp;wLimit=9">BUSH SOUL</a> and <a href="http://emergence.design.ucla.edu/">EMERGENCE </a>system, designed in 1998:  &#8221;&#8230;three interactive art installations that explore the role of human presence in a world of artificial life. A person&#8217;s &#8220;soul&#8221;, represented as a sphere of energy, enters a virtual  &#8220;bush&#8221; that is alive and responsive. The world&#8217;s inhabitants are brought  to life through programs that define their behaviors and desires. A force-feedback joystick provides both navigation and tactile  sensations, connecting one&#8217;s physical body and virtual soul. Through the  joystick one can feel the &#8220;energy&#8221; of the environment as vibrations  emanating from certain creatures and significant places in the virtual  world.&#8221;</p>
<p><img src="http://emergence.design.ucla.edu/images/bushSoul3/JPEGMed/mmbones.jpg" alt="" width="400" /></p>
<p>More about CODEX SERAPHINIANUS <a href="http://en.wikipedia.org/wiki/Codex_Seraphinianus">here</a>.</p>
<p><a href="http://www.archinode.com/">Mitchell Joaquim</a>&#8216;s generative architecture projects include an <a href="http://archinode.blogspot.com/2008/08/in-vitro-meat-habitiat.html">&#8220;In Vitro Meat Habitat&#8221;</a> and <a href="http://www.archinode.com/peristalcity.html">Peristaltic City</a></p>
<p><img src="http://agreenliving.org/wp-content/uploads/2010/07/82f3a8e815new-42-500x293.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/other-emergentgenerative-worlds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umbilicus: Differing Perspectives</title>
		<link>http://interactive.usc.edu/2011/11/07/umbilicus-differing-perspectives/</link>
		<comments>http://interactive.usc.edu/2011/11/07/umbilicus-differing-perspectives/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 19:26:58 +0000</pubDate>
		<dc:creator>Jason Mathias</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12248</guid>
		<description><![CDATA[I&#8217;ve always enjoyed explaining my Indian roots to friends and strangers. It feels like I&#8217;m opening a bond with another...<br /><a class="more-link" href="http://interactive.usc.edu/2011/11/07/umbilicus-differing-perspectives/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always enjoyed explaining my Indian roots to friends and strangers. It feels like I&#8217;m opening a bond with another first-world native, and I become this portal to another lifetime, a key to visualizing a world they only read about in newspapers or saw glimpses of in <em>Slumdog Millionaire</em>.</p>
<p>For this reason, I have begun to see the revealing of Umbilicus as one told by a veteran of the space &#8211; Perhaps, like the white man in <em>The Last King of Scotland</em> or the sailor in <em>Heart of Darkness</em>, a person that has seen the soul of Umbilicus and lived to tell about it. But perhaps not that heavy; Rather, I prefer to think of it as Mowgli, sitting in a large book-filled den in England, offering a glimpse of the jungles of India to an enraptured best friend.</p>
<p>For Umbilicus, the central defining moment has always been the blocking of the bridge for the poor, the Oche. So I imagine this native, telling his story in a house, starting with an explanation of the bridge.</p>
<p><em>&#8220;The Bridge was everything, our connection to the jungles that provided us with food and wood. And when one side blocked the other from accessing it out of fear, the bridge became everything we were terrified of.&#8221; </em></p>
<p>Thus, I saw it fitting to imagine the view from the path of the Oche, looking up at this bridge. A might slab of rock created by the entire community, the Oche are now forced to look up at it as if it was a wall forcibly separating them from the Vilna.</p>
<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/BridgeWall1.png"><img class="alignleft size-large wp-image-12258" title="BridgeWall" src="http://interactive.usc.edu/wp-content/uploads/2011/11/BridgeWall1-1024x466.png" alt="" width="1024" height="466" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>From the view of the Vilna, however, the act was necessary and preventative. And the community continued to document the Oche, separating them from mentally and socially from Vilna culture, eyeing their activities with suspicion. When the Oche created a path into the jungles themselves, out of a dam they created at the foot of the bridge, the path was considered a smuggler&#8217;s route, a thing of illegality and dangerous activity. The Oche, in an act of solidarity and defiance, would light torches as they passed through the route at night, so that there could be no denying that people were traversing through it. Thus, Vilna looking at the path from the bridge would eye it frustratedly, worried about what weapons and dangers were being brought through that route, yet knowing that their government was entirely unable to address this. <a href="http://interactive.usc.edu/wp-content/uploads/2011/11/Opening-POV1.png"><img class="alignright size-large wp-image-12256" title="Opening POV" src="http://interactive.usc.edu/wp-content/uploads/2011/11/Opening-POV1-1024x471.png" alt="" width="1024" height="471" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/umbilicus-differing-perspectives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>port-au-prince postcard</title>
		<link>http://interactive.usc.edu/2011/11/07/port-au-prince-postcard/</link>
		<comments>http://interactive.usc.edu/2011/11/07/port-au-prince-postcard/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 19:26:03 +0000</pubDate>
		<dc:creator>Sanghee Oh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[haiti]]></category>
		<category><![CDATA[postcard]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12253</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/Haiti-PC.jpg"><img class="aligncenter size-full wp-image-12254" title="Port-au-Prince, Haiti Postcard" src="http://interactive.usc.edu/wp-content/uploads/2011/11/Haiti-PC.jpg" alt="" width="800" height="565" /></a></p>
<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/Haiti-PC-2.jpg"><img class="aligncenter size-full wp-image-12266" title="Haiti PC 2" src="http://interactive.usc.edu/wp-content/uploads/2011/11/Haiti-PC-2.jpg" alt="" width="795" height="560" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/port-au-prince-postcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brittle Hollow System Postcard</title>
		<link>http://interactive.usc.edu/2011/11/07/brittle-hollow-system-postcard/</link>
		<comments>http://interactive.usc.edu/2011/11/07/brittle-hollow-system-postcard/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 17:13:14 +0000</pubDate>
		<dc:creator>Alexander Beachum</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[postcard]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12239</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/kettlecraft_postcard.jpg"><img class="alignnone size-large wp-image-12246" title="kettlecraft_postcard" src="http://interactive.usc.edu/wp-content/uploads/2011/11/kettlecraft_postcard-1024x660.jpg" alt="" width="1024" height="660" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/brittle-hollow-system-postcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scryptyria Postcard</title>
		<link>http://interactive.usc.edu/2011/11/07/scryptyria-postcard/</link>
		<comments>http://interactive.usc.edu/2011/11/07/scryptyria-postcard/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 15:16:27 +0000</pubDate>
		<dc:creator>Sarah Scialli</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[532]]></category>
		<category><![CDATA[World-building]]></category>

		<guid isPermaLink="false">http://interactive.usc.edu/?p=12233</guid>
		<description><![CDATA[This postcard showcases several locals of Scryptyria, and tries to entice writers to come and visit. It does so in...<br /><a class="more-link" href="http://interactive.usc.edu/2011/11/07/scryptyria-postcard/">Read More</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://interactive.usc.edu/wp-content/uploads/2011/11/postcard1.jpg"><img class="alignnone size-full wp-image-12236" title="postcard" src="http://interactive.usc.edu/wp-content/uploads/2011/11/postcard1.jpg" alt="" width="432" height="288" /></a></p>
<p>This postcard showcases several locals of Scryptyria, and tries to entice writers to come and visit. It does so in a fairly conventional way, treating the land as if it were a vacation spot. In a way, it does serve as a vacation spot, where writers take a break from writing, and try to figure out what next to write about.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://interactive.usc.edu/2011/11/07/scryptyria-postcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

