<?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>AquilaX's development blog &#187; Processing</title>
	<atom:link href="http://dev.horemag.net/category/java/processing-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.horemag.net</link>
	<description>code and so on...</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:29:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Chasing balls with faiding tails</title>
		<link>http://dev.horemag.net/2008/03/03/chasing-balls-with-faiding-tails/</link>
		<comments>http://dev.horemag.net/2008/03/03/chasing-balls-with-faiding-tails/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 10:56:51 +0000</pubDate>
		<dc:creator>AquilaX</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://dev.horemag.net/2008/03/03/chasing-balls-with-faiding-tails/</guid>
		<description><![CDATA[
Another very simple Processing script. Nothing fancy just three points with circle orbits and blur on every step to ensure the fading of the "tails" but still looks nice.
&#160;
int R = 20;  //radius
int speed = 2;  // speed
&#160;
int t = 0;
float x;
float y;
int offx = 0;
int offy = 0;
&#160;
void setup&#40;&#41;&#123;
  size&#40;80,80&#41;;
  [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://dev.horemag.net/wp-content/uploads/rotor.png' alt='Rotor' /><br />
Another very simple Processing script. Nothing fancy just three points with circle orbits and blur on every step to ensure the fading of the "tails" but still looks nice.</p>
<pre class="java">&nbsp;
<span style="color: #993333;">int</span> R = <span style="color: #cc66cc;">20</span>;  <span style="color: #808080; font-style: italic;">//radius</span>
<span style="color: #993333;">int</span> speed = <span style="color: #cc66cc;">2</span>;  <span style="color: #808080; font-style: italic;">// speed</span>
&nbsp;
<span style="color: #993333;">int</span> t = <span style="color: #cc66cc;">0</span>;
<span style="color: #993333;">float</span> x;
<span style="color: #993333;">float</span> y;
<span style="color: #993333;">int</span> offx = <span style="color: #cc66cc;">0</span>;
<span style="color: #993333;">int</span> offy = <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  size<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">80</span>,<span style="color: #cc66cc;">80</span><span style="color: #66cc66;">&#41;</span>;
  offx = width/<span style="color: #cc66cc;">2</span>;
  offy = height/<span style="color: #cc66cc;">2</span>;
  background<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
  strokeWeight<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  filter<span style="color: #66cc66;">&#40;</span>BLUR,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
  stroke<span style="color: #66cc66;">&#40;</span>#FF0000<span style="color: #66cc66;">&#41;</span>;
  x = sin<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offx;
  y = cos<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offy;
  point <span style="color: #66cc66;">&#40;</span>x,y<span style="color: #66cc66;">&#41;</span>;
  stroke<span style="color: #66cc66;">&#40;</span>#00FF00<span style="color: #66cc66;">&#41;</span>;
  x = sin<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #cc66cc;">+120</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offx;
  y = cos<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #cc66cc;">+120</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offy;
  point <span style="color: #66cc66;">&#40;</span>x,y<span style="color: #66cc66;">&#41;</span>;
  stroke<span style="color: #66cc66;">&#40;</span>#0000FF<span style="color: #66cc66;">&#41;</span>;
  x = sin<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #cc66cc;">+240</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offx;
  y = cos<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span>t<span style="color: #cc66cc;">+240</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>*R+offy;
  point <span style="color: #66cc66;">&#40;</span>x,y<span style="color: #66cc66;">&#41;</span>;
  t += speed;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.horemag.net/2008/03/03/chasing-balls-with-faiding-tails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spirograph with Processing</title>
		<link>http://dev.horemag.net/2008/03/03/spirograph-with-processing/</link>
		<comments>http://dev.horemag.net/2008/03/03/spirograph-with-processing/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 10:07:57 +0000</pubDate>
		<dc:creator>AquilaX</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[spirograph]]></category>

		<guid isPermaLink="false">http://dev.horemag.net/2008/03/03/spirograph-with-processing/</guid>
		<description><![CDATA[
I continue my tests with Processing. Today's project is simple Spirograph. The formulas are taken from here.
&#160;
int R = 130;         //Outer radius
int r = 15;          //Iner radius
int O = 7;         [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://dev.horemag.net/wp-content/uploads/spiro.png' alt='Spirograph' /><br />
I continue my tests with <a href="http://processing.org/" onclick="javascript:urchinTracker('/outbound/article/http://processing.org/');">Processing</a>. Today's project is simple <a href="http://en.wikipedia.org/wiki/Spirograph" onclick="javascript:urchinTracker('/outbound/article/http://en.wikipedia.org/wiki/Spirograph');">Spirograph</a>. The formulas are taken from <a href="http://wordsmith.org/~anu/java/spirograph.html" onclick="javascript:urchinTracker('/outbound/article/http://wordsmith.org/~anu/java/spirograph.html');">here</a>.</p>
<pre class="java">&nbsp;
<span style="color: #993333;">int</span> R = <span style="color: #cc66cc;">130</span>;         <span style="color: #808080; font-style: italic;">//Outer radius</span>
<span style="color: #993333;">int</span> r = <span style="color: #cc66cc;">15</span>;          <span style="color: #808080; font-style: italic;">//Iner radius</span>
<span style="color: #993333;">int</span> O = <span style="color: #cc66cc;">7</span>;           <span style="color: #808080; font-style: italic;">//Offset</span>
<span style="color: #993333;">float</span> swidth = <span style="color: #cc66cc;">0.2</span>;  <span style="color: #808080; font-style: italic;">// Stroke width</span>
<span style="color: #993333;">int</span> iter = <span style="color: #cc66cc;">500</span>;      <span style="color: #808080; font-style: italic;">// Numer of iterations</span>
&nbsp;
<span style="color: #993333;">float</span> x;
<span style="color: #993333;">float</span> y;
<span style="color: #993333;">float</span> ox = <span style="color: #cc66cc;">0</span>;
<span style="color: #993333;">float</span> oy = <span style="color: #cc66cc;">0</span>;
<span style="color: #993333;">int</span> offx;
<span style="color: #993333;">int</span> offy;
<span style="color: #993333;">int</span> t = <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  size<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">400</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
  offx = width/<span style="color: #cc66cc;">2</span>;
  offy = height/<span style="color: #cc66cc;">2</span>;
  colorMode<span style="color: #66cc66;">&#40;</span>HSB, iter<span style="color: #66cc66;">&#41;</span>;
  strokeWeight<span style="color: #66cc66;">&#40;</span>swidth<span style="color: #66cc66;">&#41;</span>;
  background<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
  smooth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t &lt;= iter<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    x = <span style="color: #66cc66;">&#40;</span>R+r<span style="color: #66cc66;">&#41;</span>*cos<span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> - <span style="color: #66cc66;">&#40;</span>r+O<span style="color: #66cc66;">&#41;</span>*cos<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>R+r<span style="color: #66cc66;">&#41;</span>/r<span style="color: #66cc66;">&#41;</span>*t<span style="color: #66cc66;">&#41;</span>+offx;
    y = <span style="color: #66cc66;">&#40;</span>R+r<span style="color: #66cc66;">&#41;</span>*sin<span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> - <span style="color: #66cc66;">&#40;</span>r+O<span style="color: #66cc66;">&#41;</span>*sin<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>R+r<span style="color: #66cc66;">&#41;</span>/r<span style="color: #66cc66;">&#41;</span>*t<span style="color: #66cc66;">&#41;</span>+offy;
    stroke<span style="color: #66cc66;">&#40;</span>t, iter/<span style="color: #cc66cc;">1.5</span>, iter<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">//point (x, y);  //&lt;- points</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>ox != <span style="color: #cc66cc;">0</span> &amp;&amp; oy != <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
      line <span style="color: #66cc66;">&#40;</span>ox, oy, x, y<span style="color: #66cc66;">&#41;</span>;  <span style="color: #808080; font-style: italic;">//&lt;-lines</span>
    <span style="color: #66cc66;">&#125;</span>
    ox = x;
    oy = y;
    t++;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.horemag.net/2008/03/03/spirograph-with-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple terrain generator in Processing</title>
		<link>http://dev.horemag.net/2008/03/02/simple-terrain-generator-in-processing/</link>
		<comments>http://dev.horemag.net/2008/03/02/simple-terrain-generator-in-processing/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 09:49:39 +0000</pubDate>
		<dc:creator>AquilaX</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[perlin noise]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[terrain]]></category>
		<category><![CDATA[terrain generartor]]></category>

		<guid isPermaLink="false">http://dev.horemag.net/2008/03/02/simple-terrain-generator-in-processing/</guid>
		<description><![CDATA[Here is simple processing script for generating random terrains using Perlin noise. The good thing is that Processing has integrated noise() function and all you have to do is call it with the coordinates as parameters. Then assign the colors depending on the "height" of the point and add some randomness to the snow to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dev.horemag.net/wp-content/uploads/terros.png" title="Generated terrain" ><img src="http://dev.horemag.net/wp-content/uploads/terros.thumbnail.png" alt="Generated terrain" style="float:left; margin-right:5px"/></a>Here is simple processing script for generating random terrains using <a href="http://en.wikipedia.org/wiki/Perlin_noise" onclick="javascript:urchinTracker('/outbound/article/http://en.wikipedia.org/wiki/Perlin_noise');">Perlin noise</a>. The good thing is that <a href="http://processing.org/" onclick="javascript:urchinTracker('/outbound/article/http://processing.org/');">Processing</a> has integrated <a href="http://processing.org/reference/noise_.html" onclick="javascript:urchinTracker('/outbound/article/http://processing.org/reference/noise_.html');">noise()</a> function and all you have to do is call it with the coordinates as parameters. Then assign the colors depending on the "height" of the point and add some randomness to the snow to make it look more dispersed.</p>
<pre class="java">&nbsp;
<span style="color: #993333;">float</span> noiseScale=<span style="color: #cc66cc;">0.02</span>;
<span style="color: #993333;">int</span> tsize = <span style="color: #cc66cc;">250</span>;
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  size<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">640</span>, <span style="color: #cc66cc;">480</span>, P3D<span style="color: #66cc66;">&#41;</span>;
  background<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
  rotateX<span style="color: #66cc66;">&#40;</span>radians<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">45</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  beginShape<span style="color: #66cc66;">&#40;</span>POINTS<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> x=<span style="color: #cc66cc;">0</span>; x &lt; tsize; x++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> y=<span style="color: #cc66cc;">0</span>; y &lt; tsize; y++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
      <span style="color: #993333;">float</span> noiseVal = noise<span style="color: #66cc66;">&#40;</span>x*noiseScale, y*noiseScale<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #993333;">int</span> t = <span style="color: #993333;">int</span><span style="color: #66cc66;">&#40;</span>noiseVal*<span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>;
      stroke<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">165</span>, <span style="color: #cc66cc;">80</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t &gt;<span style="color: #cc66cc;">180</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        stroke<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, t<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
      <span style="color: #808080; font-style: italic;">// add some randomness to the snow to make it more realistic</span>
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t &lt;<span style="color: #cc66cc;">60</span> +random<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        stroke<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
      vertex<span style="color: #66cc66;">&#40;</span>width/<span style="color: #cc66cc;">2</span>+x-tsize/<span style="color: #cc66cc;">2</span>, height/<span style="color: #cc66cc;">2</span>+y-tsize/<span style="color: #cc66cc;">2</span>, -noiseVal*<span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
  endShape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.horemag.net/2008/03/02/simple-terrain-generator-in-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

