<?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>Computational Artwork &#187; walking lines</title>
	<atom:link href="http://matthewbrown.net.au/tag/walking-lines/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewbrown.net.au</link>
	<description>by Matthew Brown</description>
	<lastBuildDate>Sun, 20 Jun 2010 02:37:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Walking Lines 3 &#8211; Processing</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-3-processing/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-3-processing/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 00:51:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-3-processing/</guid>
		<description><![CDATA[I received some feedback on my earlier versions of the walking lines in the form of a trackback from Alex. The feedback was part of a practice peer review, but he went into some detail on how i could fix up my current code so that the lines follow on from each other and how [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://matthewbrown.net.au/wp-content/uploads/2008/08/semi_random_line3.png' title='Walking Lines 3, joining lines.'><img src='http://matthewbrown.net.au/wp-content/uploads/2008/08/semi_random_line3.thumbnail.png' alt='Walking Lines 3, joining lines.' class="alignright" /></a>I received some feedback on my earlier versions of the walking lines in the form of <a href="http://alexkkb210.wordpress.com/2008/08/17/peer-review-1/" title="Walking Lines Feedback">a trackback from Alex</a>.</p>
<p>The feedback was part of a practice peer review, but he went into some detail on how i could fix up my current code so that the lines follow on from each other and how to reduce the load on the CPU per cycle with the same effect. The advice is greatly appreciated.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/semi_random_lines_3/index.html" title="Walking Lines 3">View the new version online here.</a></p>
<p>The changes and source code are after the jump.</p>
<p><span id="more-53"></span></p>
<p>Originally I had:</p>
<pre class="brush: java;">
float x = random(width);
float y = random(height);
float x2 = random(width);
float y2 = random(height);void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{
x += int(random(width*2)-width);
y += int(random(height*2)-height);
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
stroke(random(255));
line(x, y, x2, y2);
}
</pre>
<p>Now I have:</p>
<pre class="brush: java;">

float x = random(width);
float y = random(height);
float x2 = 0;
float y2 = 0;
float tempx = 0;
float tempy = 0;

void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{

x2 = random(-width, width);
y2 = random(-height, height);
stroke(random(255));
line(x, y, x2, y2);
x = x2;
y = y2;
}
</pre>
<p>The main changes are assigning the results of the random set of coordinates to the original coordinates with:</p>
<pre class="brush: java;">
x = x2;
y = y2;
</pre>
<p>These variables (x, y) were assigned 0 values initially and this is then replaced by the new coordinates at the end of every draw() cycle.</p>
<p>The other main change is the reduced load on the CPU with:</p>
<pre class="brush: java;">
x2 = random(-width, width);
y2 = random(-height, height);
</pre>
<p>This is in place of:</p>
<pre class="brush: java;">
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
</pre>
<p>Thats about it, ideally I should fix the colour changes as well so that they aren&#8217;t sharp changes with each line, but a gradual fade from one to another. I&#8217;ll see how I go experimenting with that and throw it up here as well when I get a chance.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-3-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Walking Lines 2</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-2/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-2/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 10:33:14 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-2/</guid>
		<description><![CDATA[Continuing on from the original walking lines I did in Processing, I went on to develop this version of it. This is done effectively the same way as the original, but the code is cleaner and it provides for more variation. It also runs slower. This version should allow further development to make the lines [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/wp-content/uploads/2008/08/semi-random-lines.png" title="Walking lines 2"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/08/semi-random-lines.thumbnail.png" class="alignright" alt="Walking lines 2" /></a>Continuing on from the original <a href="http://matthewbrown.net.au/programming/walking-lines-1/" title="The original walking lines.">walking lines</a> I did in Processing, I went on to develop this version of it. This is done effectively the same way as the original, but the code is cleaner and it provides for more variation. It also runs slower.</p>
<p>This version should allow further development to make the lines even more random by separating all the variables, where the original was more limited since the numbers were largely defined within the line parameters.</p>
<p>This version is also technically more stochastic then the first one as well as the lines are added to and built on using the += command to add the new line position to the previous line position. Unfortunately this still draws a new line every frame that is not necessarily joined to the line from the previous frame.</p>
<p><span id="more-51"></span>
<pre class="brush: java;">
float x = random(width);
float y = random(height);
float x2 = random(width);
float y2 = random(height);

void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{
x += int(random(width*2)-width);
y += int(random(height*2)-height);
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
stroke(random(255));
line(x, y, x2, y2);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Walking Lines 1</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-1/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-1/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 01:26:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[computational arts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[kkb211]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-1/</guid>
		<description><![CDATA[In the week 2 tutorial for KKB211 &#8211; Computational Arts 2, we are looking at doing walking lines in our chosen development tool. Walking lines are effectively randomly generated paths that the lines follow to create a random image. I have been using Processing for this particular focus. Thus far I have random lines, however [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/wp-content/uploads/2008/07/semi-random-sketch.png" title="Semi-random lines sketch"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/07/semi-random-sketch.thumbnail.png" class="alignright" alt="Semi-random lines sketch" /></a>In the week 2 tutorial for KKB211 &#8211; Computational Arts 2, we are looking at doing walking lines in our chosen development tool.</p>
<p>Walking lines are effectively randomly generated paths that the lines follow to create a random image.</p>
<p>I have been using Processing for this particular focus. Thus far I have random lines, however they don&#8217;t follow any particular path as of yet. This is effectively still walking lines as the position of the lines is added to and built on. Unfortunately this actually draws a new line every frame that is not necessarily joined to the line from the previous frame.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/semi_random_sketch/index.html" title="Walking Lines 1">Have a look at it online here.</a></p>
<p>The code used to do this is extremely simple and just involves a few random variables based on the width and height of the canvas. I don&#8217;t believe this is entirely stochastic because the randoms are tightly controlled, but it is random within its boundaries (unless you want to get into the nitty gritty of it, which I don&#8217;t).</p>
<p>The source code is available after the jump.</p>
<p><span id="more-48"></span></p>
<pre class="brush: java;">
void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(0);
}

void draw()
{
float r = random(0, height);
float x = random(0, width);
stroke(r, 100);
line(random(r), random(width), random(x*2), random(height));
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

