<rss version="2.0" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel>
	<title>roxlu.com (openframeworks, projects, arduino, processing)</title>
	<link>http://www.roxlu.com</link>
	<description>roxlu.com: openFrameworks, processing, visual effects, opengl, arduino, hardware, projects, installations </description>
	<generator>WAFCMS</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
<item>
		<title>Sphere and particles</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>072b030ba126b2f4b2374f342be9ed44guid</guid>
		<description><![CDATA[<p>While learning openGL I try to recreate stunning visualisations I found here, on Vimeo. Now, it's time for flight404. Flight404 videos are awesome! Technically impressive and just beautiful. In this video I've tried to add physics to the particles, which are textured quads, that face the center of a sphere. I've used perlin noise for the motion, added some trails and random forces. I've had some help from Robert, but I'm not sure how he implements his gravitational/magnetism physics. I tried to use <a href="http://en.wikipedia.org/wiki/Newton's_law_of_universal_gravitation">Newtons law of gravitation</a> but this didn't gave me the results I wanted. When <a href="http://vimeo.com/646107">Roberts video</a> is all magnetism based I definitely want to find out how he did it ;-). Especially if the particles rotate based on attraction. Im using standard Euler based particles and stiff springs to keep the particles on the sphere.</p>

<p><object width="572" height="429"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9978869&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00ADEF&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9978869&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00ADEF&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="572" height="429"></embed></object></p>]]></description>
</item><item>
		<title>Attiny2313, AVRdude and Arduino & AVRisp</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>093f65e080a295f8076b1c5722a46aa2guid</guid>
		<description><![CDATA[<p>Today I've tested the avrdude, avrisp and arduino &amp; avrisp toolchain (AAAA-toolchain) to program avr chips, especially the attiny2313 chip.  <a href="http://www.arduino.cc">Arduino</a> is a very robust board used in various hardware projects. Using the arduino programming environment you can easily program the chip.  With the AAAA-toolchain you can use your arduino board to program other AVR chips.  Below I'll describe the steps necessary to program an attiny2313 chip to blink a led.</p>

<h3>What you need</h3>

<ul>
<li><a href="http://www.arduino.cc/">arduino ide</a> version 0.018 - <a href="http://www.arduino.cc/">download</a>    </li>
<li><a href="http://mega-isp.googlecode.com/">mega-isp</a> version 0.3 - <a href="http://mega-isp.googlecode.com/files/avrisp.03.zip">download</a>     </li>
<li><a href="http://savannah.nongnu.org/projects/avrdude/">avrdude</a> version 5.10. <a href="http://sourceforge.net/projects/winavr/files/WinAVR/20100110/WinAVR-20100110-install.exe/download">Download WinAVR version 2010.01.10</a> which includes avrdude for windows.</li>
</ul>

<h3>Installation</h3>

<p><strong>Arduino</strong><br />
Simply unpack the arduino zip file. Copy the arduino-0018 directory to a place you like, I used C:\Program Files\arduino-0018</p>

<p><strong>Mega-isp</strong><br />
Unpack the zip which contains the avrisp.pde file. This is the Arduino project file which you need to burn to your Arduino.</p>

<p><strong>WinAVR</strong></p>

<ul>
<li>Follow the installation wizard    </li>
<li>Add the binary path to your system PATH variable. On windows, I used the default installation directory (C:\WinAVR-20100110\bin). By adding this to your PATH environment variable you're able to execute the "avrdude" command from any CMD window, in any path. <a href="http://www.google.nl/search?q=windows+path+environment+variable&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:nl:official&amp;client=firefox-a">Google</a> for a description on how to set your PATH environment variable.</li>
</ul>

<h3>The hardware</h3>

<p>Okay, when you've downloaded and installed all necessary files you're ready to create your circuit. But first some info, so you know what you're doing. Using the AAAA-toolchain you use the arduino to program another AVR chip. The arduino uses ICSP (in circuit serial programming) for this.  Basically this means that you need to connect a couple of wires <strong>from</strong> the arduino <strong>to</strong> your AVR chip (attiny2313).  We need to connect the standard MOSI, MISO, SCK, RST wires for ICSP. Use this wiring:</p>

<p><strong>Programming wires</strong></p>

<table border="0">
<tr><th>Arduino</th><th>Attiny2313</th></tr>
<tr><td>Pin 10 </td><td>Pin 1 - RST</td></tr>
<tr><td>Pin 11</td><td>Pin 17 - MOSI</td></tr>
<tr><td>Pin 12</td><td>Pin 18 - MISO</td></tr>
<tr><td>Pin 13</td><td>Pin 19 - SCK</td></tr>
<tr><td>Vcc (+5V)</td><td>Pin 20 - Vcc </td></tr>
<tr><td>Gnd</td><td>Pin 10</td></tr>
</table>

<h3>Prepping the Arduino</h3>

<p>Start the Arduino IDE and open the avrisp.pde file you <a href="http://mega-isp.googlecode.com/files/avrisp.03.zip">downloaded</a> before. Connect your Arduino, select the correct board and COM port and upload the avr-isp code to the arduino. I'll not explain this more thoroughly as it's basic arduino programming. When you've uploaded avrisp to the arduino you're ready to create the "hello world", blinking led application to test this avr-isp programming method.</p>

<h3>Programming the attiny2313</h3>

<p>When you want to program your attiny2313, you need to understand that we use different steps to get the program-code on the chip. To program the attiny2313 you need to use "avrdude", which is also used by Arduino (under the hood, if I'm correct).  AVRDude is able to put the program-code on the chip using the avrisp programming method.  WinAVR is set of tools you need to program an attiny (or other avr) without Arduino, using avrdude.  The steps you need to take are:</p>

<p>● write the application code in C<br />
● compile the code for the attiny2313 chip using avr-gcc<br />
● upload the compiled code (hex file) to your attiny2313 using avrdude</p>

<p><strong>Application code</strong><br />
I just googled for a attiny2313 blinking led example that I'll use. Connect pin 12 of your attiny2313 to a led with a current limiting resistor.
Copy and paste this code in a file named <strong>blinking_led_2313.c</strong>.</p>

<pre class="c"><span style="color: #339933;">#define F_CPU 1000000UL</span>
<span style="color: #339933;">#include &lt;avr/io.h&gt;</span>
<span style="color: #339933;">#include &lt;util/delay.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    DDRB |= <span style="color: #cc66cc;">1</span>&lt;&lt;PB0; <span style="color: #808080; font-style: italic;">/* set PB0 to output */</span>
    <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        PORTB &amp;= ~<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>&lt;&lt;PB0<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">/* LED on */</span>
        _delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
        PORTB |= <span style="color: #cc66cc;">1</span>&lt;&lt;PB0; <span style="color: #808080; font-style: italic;">/* LED off */</span>
        _delay_ms<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">900</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<p><strong>Compile the code to a hex file</strong><br />
Create a new file in the same directory of your blinking_led_2313.c file with the name "Makefile" and put this code in it (see below). You can easily reuse this makefile for other projects by changing the  "PRJSRC" variable.</p>

<pre class="bash"><span style="color: #808080; font-style: italic;"># See: http://electrons.psychogenic.com/modules/arms/view.php?<span style="color: #007800;">w=</span>art&amp;<span style="color: #007800;">idx=</span><span style="color: #000000;">8</span>&amp;<span style="color: #007800;">page=</span><span style="color: #000000;">2</span></span>
<span style="color: #808080; font-style: italic;">##### This Makefile will <span style="color: #c20cb9; font-weight: bold;">make</span> compiling Atmel AVR </span>
<span style="color: #808080; font-style: italic;">##### micro controller projects simple with Linux </span>
<span style="color: #808080; font-style: italic;">##### or other Unix workstations and the AVR-GCC </span>
<span style="color: #808080; font-style: italic;">##### tools.</span>
<span style="color: #808080; font-style: italic;">#####</span>
<span style="color: #808080; font-style: italic;">##### It supports C, C++ and Assembly <span style="color: #7a0874; font-weight: bold;">source</span> files.</span>
<span style="color: #808080; font-style: italic;">#####</span>
<span style="color: #808080; font-style: italic;">##### Customize the values <span style="color: #c20cb9; font-weight: bold;">as</span> indicated below and :</span>
<span style="color: #808080; font-style: italic;">##### make</span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">make</span> disasm </span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">make</span> stats </span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">make</span> hex</span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">make</span> writeflash</span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">make</span> gdbinit</span>
<span style="color: #808080; font-style: italic;">##### or <span style="color: #c20cb9; font-weight: bold;">make</span> clean</span>
<span style="color: #808080; font-style: italic;">#####</span>
<span style="color: #808080; font-style: italic;">##### See the http://electrons.psychogenic.com/ </span>
<span style="color: #808080; font-style: italic;">##### website <span style="color: #000000; font-weight: bold;">for</span> detailed instructions</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">####################################################</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">#####              Configuration               #####</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">##### Customize the values <span style="color: #000000; font-weight: bold;">in</span> this section <span style="color: #000000; font-weight: bold;">for</span> #####</span>
<span style="color: #808080; font-style: italic;">##### your project. MCU, PROJECTNAME and       #####</span>
<span style="color: #808080; font-style: italic;">##### PRJSRC must be setup <span style="color: #000000; font-weight: bold;">for</span> all projects,   #####</span>
<span style="color: #808080; font-style: italic;">##### the remaining variables are only         #####</span>
<span style="color: #808080; font-style: italic;">##### relevant to those needing additional     #####</span>
<span style="color: #808080; font-style: italic;">##### include <span style="color: #7a0874; font-weight: bold;">dirs</span> or libraries and those      #####</span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #c20cb9; font-weight: bold;">who</span> wish to use the avrdude programmer   #####</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">##### See http://electrons.psychogenic.com/    #####</span>
<span style="color: #808080; font-style: italic;">##### <span style="color: #000000; font-weight: bold;">for</span> further details.                     #####</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">####################################################</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#####         Target Specific Details          #####</span>
<span style="color: #808080; font-style: italic;">#####     Customize these <span style="color: #000000; font-weight: bold;">for</span> your project     #####</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Name of target controller </span>
<span style="color: #808080; font-style: italic;"># <span style="color: #7a0874; font-weight: bold;">&#40;</span>e.g. </span><span style="color: #ff0000;">'at90s8515'</span>, see the available avr-<span style="color: #c20cb9; font-weight: bold;">gcc</span> mmcu 
<span style="color: #808080; font-style: italic;"># options <span style="color: #000000; font-weight: bold;">for</span> possible values<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
<span style="color: #007800;">MCU=</span>attiny2313
&nbsp;
<span style="color: #808080; font-style: italic;"># Name of our project</span>
<span style="color: #808080; font-style: italic;"># <span style="color: #7a0874; font-weight: bold;">&#40;</span>use a single word, e.g. </span><span style="color: #ff0000;">'myproject'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">PROJECTNAME=</span>blinking_led_2313
&nbsp;
<span style="color: #808080; font-style: italic;"># Source files</span>
<span style="color: #808080; font-style: italic;"># List C/C++/Assembly <span style="color: #7a0874; font-weight: bold;">source</span> files:</span>
<span style="color: #808080; font-style: italic;"># <span style="color: #7a0874; font-weight: bold;">&#40;</span>list all files to compile, e.g. </span><span style="color: #ff0000;">'a.c b.cpp as.S'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>:
<span style="color: #808080; font-style: italic;"># Use .<span style="color: #c20cb9; font-weight: bold;">cc</span>, .<span style="color: #c20cb9; font-weight: bold;">cpp</span> or .C suffix <span style="color: #000000; font-weight: bold;">for</span> C++ files, use .S </span>
<span style="color: #808080; font-style: italic;"># <span style="color: #7a0874; font-weight: bold;">&#40;</span>NOT .s !!!<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> assembly <span style="color: #7a0874; font-weight: bold;">source</span> code files.</span>
<span style="color: #007800;">PRJSRC=</span>blinking_led_2313.c
&nbsp;
<span style="color: #808080; font-style: italic;"># additional includes <span style="color: #7a0874; font-weight: bold;">&#40;</span>e.g. -I/path/to/mydir<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
<span style="color: #007800;">INC=</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># libraries to <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>e.g. -lmylib<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
<span style="color: #007800;">LIBS=</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Optimization level, </span>
<span style="color: #808080; font-style: italic;"># use s <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">size</span> opt<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> or <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>off<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
<span style="color: #007800;">OPTLEVEL=</span>s
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#####      AVR Dude </span><span style="color: #ff0000;">'writeflash'</span> options       <span style="color: #808080; font-style: italic;">#####</span>
<span style="color: #808080; font-style: italic;">#####  If you are using the avrdude program</span>
<span style="color: #808080; font-style: italic;">#####  <span style="color: #7a0874; font-weight: bold;">&#40;</span>http://www.bsdhome.com/avrdude/<span style="color: #7a0874; font-weight: bold;">&#41;</span> to write</span>
<span style="color: #808080; font-style: italic;">#####  to the MCU, you can <span style="color: #000000; font-weight: bold;">set</span> the following config</span>
<span style="color: #808080; font-style: italic;">#####  options and use </span><span style="color: #ff0000;">'make writeflash'</span> to program
<span style="color: #808080; font-style: italic;">#####  the device.</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># programmer id--check the avrdude <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">complete</span> list</span>
<span style="color: #808080; font-style: italic;"># of available opts.  These should include stk500,</span>
<span style="color: #808080; font-style: italic;"># avr910, avrisp, bsd, pony and <span style="color: #c20cb9; font-weight: bold;">more</span>.  Set this to</span>
<span style="color: #808080; font-style: italic;"># one of the valid </span><span style="color: #ff0000;">&quot;-c PROGRAMMER-ID&quot;</span> values 
<span style="color: #808080; font-style: italic;"># described <span style="color: #000000; font-weight: bold;">in</span> the avrdude info page.</span>
<span style="color: #808080; font-style: italic;"># </span>
<span style="color: #007800;">AVRDUDE_PROGRAMMERID=</span>avrisp
&nbsp;
<span style="color: #808080; font-style: italic;"># port--serial or parallel port to <span style="color: #c20cb9; font-weight: bold;">which</span> your </span>
<span style="color: #808080; font-style: italic;"># hardware programmer is attached</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #007800;">AVRDUDE_PORT=</span>com12
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">####################################################</span>
<span style="color: #808080; font-style: italic;">#####                Config Done               #####</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">##### You should not need to edit anything      #####</span>
<span style="color: #808080; font-style: italic;">##### below to use the makefile but may wish   #####</span>
<span style="color: #808080; font-style: italic;">##### to override a few of the flags           #####</span>
<span style="color: #808080; font-style: italic;">##### nonetheless                              #####</span>
<span style="color: #808080; font-style: italic;">#####                                          #####</span>
<span style="color: #808080; font-style: italic;">####################################################</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">##### Flags ####</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># HEXFORMAT -- format <span style="color: #000000; font-weight: bold;">for</span> .hex <span style="color: #c20cb9; font-weight: bold;">file</span> output</span>
<span style="color: #007800;">HEXFORMAT=</span>ihex
&nbsp;
<span style="color: #808080; font-style: italic;"># compiler</span>
<span style="color: #007800;">CFLAGS=</span>-I. $<span style="color: #7a0874; font-weight: bold;">&#40;</span>INC<span style="color: #7a0874; font-weight: bold;">&#41;</span> -g -<span style="color: #007800;">mmcu=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>MCU<span style="color: #7a0874; font-weight: bold;">&#41;</span> -O$<span style="color: #7a0874; font-weight: bold;">&#40;</span>OPTLEVEL<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    -fpack-struct -fshort-enums             \
    -funsigned-bitfields -funsigned-char    \
    -Wall -Wstrict-prototypes               \
    -Wa,-<span style="color: #007800;">ahlms=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>firstword                  \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.lst, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;:.<span style="color: #007800;">c=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">c++</span> specific flags</span>
<span style="color: #007800;">CPPFLAGS=</span>-fno-exceptions               \
    -Wa,-<span style="color: #007800;">ahlms=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>firstword         \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.lst, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;:.<span style="color: #007800;">cpp=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>\
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.lst, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;:.<span style="color: #007800;">cc=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.lst, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;:.<span style="color: #007800;">C=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># assembler</span>
ASMFLAGS =-I. $<span style="color: #7a0874; font-weight: bold;">&#40;</span>INC<span style="color: #7a0874; font-weight: bold;">&#41;</span> -<span style="color: #007800;">mmcu=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>MCU<span style="color: #7a0874; font-weight: bold;">&#41;</span>        \
    -x assembler-with-<span style="color: #c20cb9; font-weight: bold;">cpp</span>            \
    -Wa,-gstabs,-<span style="color: #007800;">ahlms=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>firstword   \
        $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;:.<span style="color: #007800;">S=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>&lt;.<span style="color: #007800;">s=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># linker</span>
<span style="color: #007800;">LDFLAGS=</span>-Wl,-Map,$<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>.map -<span style="color: #007800;">mmcu=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>MCU<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    -lm $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">##### executables ####</span>
<span style="color: #007800;">CC=</span>avr-<span style="color: #c20cb9; font-weight: bold;">gcc</span>
<span style="color: #007800;">OBJCOPY=</span>avr-objcopy
<span style="color: #007800;">OBJDUMP=</span>avr-objdump
<span style="color: #007800;">SIZE=</span>avr-<span style="color: #c20cb9; font-weight: bold;">size</span>
<span style="color: #007800;">AVRDUDE=</span>avrdude
<span style="color: #007800;">REMOVE=</span>rm -f
&nbsp;
<span style="color: #808080; font-style: italic;">##### automatic target names ####</span>
<span style="color: #007800;">TRG=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>PROJECTNAME<span style="color: #7a0874; font-weight: bold;">&#41;</span>.out
<span style="color: #007800;">DUMPTRG=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>PROJECTNAME<span style="color: #7a0874; font-weight: bold;">&#41;</span>.s
&nbsp;
<span style="color: #007800;">HEXROMTRG=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>PROJECTNAME<span style="color: #7a0874; font-weight: bold;">&#41;</span>.hex 
<span style="color: #007800;">HEXTRG=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXROMTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PROJECTNAME<span style="color: #7a0874; font-weight: bold;">&#41;</span>.ee.hex
<span style="color: #007800;">GDBINITFILE=</span>gdbinit-$<span style="color: #7a0874; font-weight: bold;">&#40;</span>PROJECTNAME<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Define all object files.</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Start by splitting <span style="color: #7a0874; font-weight: bold;">source</span> files by type</span>
<span style="color: #808080; font-style: italic;">#  C++</span>
<span style="color: #007800;">CPPFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.<span style="color: #c20cb9; font-weight: bold;">cpp</span>, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRJSRC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">CCFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.<span style="color: #c20cb9; font-weight: bold;">cc</span>, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRJSRC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">BIGCFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.C, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRJSRC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #808080; font-style: italic;">#  C</span>
<span style="color: #007800;">CFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.c, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRJSRC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #808080; font-style: italic;">#  Assembly</span>
<span style="color: #007800;">ASMFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.S, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRJSRC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># List all object files we need to create</span>
<span style="color: #007800;">OBJDEPS=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFILES:.<span style="color: #007800;">c=</span>.o<span style="color: #7a0874; font-weight: bold;">&#41;</span>    \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CPPFILES:.<span style="color: #007800;">cpp=</span>.o<span style="color: #7a0874; font-weight: bold;">&#41;</span>\
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>BIGCFILES:.<span style="color: #007800;">C=</span>.o<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CCFILES:.<span style="color: #007800;">cc=</span>.o<span style="color: #7a0874; font-weight: bold;">&#41;</span>  \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>ASMFILES:.<span style="color: #007800;">S=</span>.o<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Define all lst files.</span>
<span style="color: #007800;">LST=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.lst, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDEPS:.<span style="color: #007800;">o=</span>.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># All the possible generated assembly </span>
<span style="color: #808080; font-style: italic;"># files <span style="color: #7a0874; font-weight: bold;">&#40;</span>.s files<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
<span style="color: #007800;">GENASMFILES=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>filter %.s, $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDEPS:.<span style="color: #007800;">o=</span>.s<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> 
&nbsp;
&nbsp;
.SUFFIXES : .c .<span style="color: #c20cb9; font-weight: bold;">cc</span> .<span style="color: #c20cb9; font-weight: bold;">cpp</span> .C .o .out .s .S \
    .hex .ee.hex .h .hh .hpp
&nbsp;
&nbsp;
.PHONY: writeflash clean stats gdbinit stats
&nbsp;
<span style="color: #808080; font-style: italic;"># Make targets:</span>
<span style="color: #808080; font-style: italic;"># all, disasm, stats, hex, writeflash/<span style="color: #c20cb9; font-weight: bold;">install</span>, clean</span>
all: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
disasm: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>DUMPTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> stats
&nbsp;
stats: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDUMP<span style="color: #7a0874; font-weight: bold;">&#41;</span> -h $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>SIZE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
&nbsp;
hex: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
writeflash: hex
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>AVRDUDE<span style="color: #7a0874; font-weight: bold;">&#41;</span> -c $<span style="color: #7a0874; font-weight: bold;">&#40;</span>AVRDUDE_PROGRAMMERID<span style="color: #7a0874; font-weight: bold;">&#41;</span>   \
     -p $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MCU<span style="color: #7a0874; font-weight: bold;">&#41;</span> -P $<span style="color: #7a0874; font-weight: bold;">&#40;</span>AVRDUDE_PORT<span style="color: #7a0874; font-weight: bold;">&#41;</span> -e        \
     -b <span style="color: #000000;">19200</span> \
     -U flash:<span style="color: #c20cb9; font-weight: bold;">w</span>:$<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXROMTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">install</span>: writeflash
&nbsp;
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>DUMPTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDUMP<span style="color: #7a0874; font-weight: bold;">&#41;</span> -S  $&lt; &gt; $@
&nbsp;
&nbsp;
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDEPS<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LDFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> -o $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDEPS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#### Generating assembly ####</span>
<span style="color: #808080; font-style: italic;"># asm from C</span>
%.s: %.c
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> -S $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $&lt; -o $@
&nbsp;
<span style="color: #808080; font-style: italic;"># asm from <span style="color: #7a0874; font-weight: bold;">&#40;</span>hand coded<span style="color: #7a0874; font-weight: bold;">&#41;</span> asm</span>
%.s: %.S
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> -S $<span style="color: #7a0874; font-weight: bold;">&#40;</span>ASMFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $&lt; &gt; $@
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># asm from C++</span>
.<span style="color: #c20cb9; font-weight: bold;">cpp</span>.s .<span style="color: #c20cb9; font-weight: bold;">cc</span>.s .C.s :
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> -S $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CPPFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $&lt; -o $@
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#### Generating object files ####</span>
<span style="color: #808080; font-style: italic;"># object from C</span>
.c.o: 
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> -c $&lt;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># object from C++ <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #c20cb9; font-weight: bold;">cc</span>, .<span style="color: #c20cb9; font-weight: bold;">cpp</span>, .C files<span style="color: #7a0874; font-weight: bold;">&#41;</span></span>
.<span style="color: #c20cb9; font-weight: bold;">cc</span>.o .<span style="color: #c20cb9; font-weight: bold;">cpp</span>.o .C.o :
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CPPFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> -c $&lt;
&nbsp;
<span style="color: #808080; font-style: italic;"># object from asm</span>
.S.o :
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>ASMFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> -c $&lt; -o $@
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#### Generating hex files ####</span>
<span style="color: #808080; font-style: italic;"># hex files from elf</span>
<span style="color: #808080; font-style: italic;">#####  Generating a <span style="color: #c20cb9; font-weight: bold;">gdb</span> initialisation <span style="color: #c20cb9; font-weight: bold;">file</span>    #####</span>
.out.hex:
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJCOPY<span style="color: #7a0874; font-weight: bold;">&#41;</span> -j .text                    \
        -j .data                       \
        -O $<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXFORMAT<span style="color: #7a0874; font-weight: bold;">&#41;</span> $&lt; $@
&nbsp;
.out.ee.hex:
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJCOPY<span style="color: #7a0874; font-weight: bold;">&#41;</span> -j .eeprom                  \
        --change-section-lma .<span style="color: #007800;">eeprom=</span><span style="color: #000000;">0</span> \
        -O $<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXFORMAT<span style="color: #7a0874; font-weight: bold;">&#41;</span> $&lt; $@
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#####  Generating a <span style="color: #c20cb9; font-weight: bold;">gdb</span> initialisation <span style="color: #c20cb9; font-weight: bold;">file</span>    #####</span>
<span style="color: #808080; font-style: italic;">##### Use by launching simulavr and avr-<span style="color: #c20cb9; font-weight: bold;">gdb</span>:   #####</span>
<span style="color: #808080; font-style: italic;">#####   avr-<span style="color: #c20cb9; font-weight: bold;">gdb</span> -x gdbinit-myproject           #####</span>
gdbinit: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;file $(TRG)&quot;</span> &gt; $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;target remote localhost:1212&quot;</span> \
                        &gt;&gt; $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;load&quot;</span>        &gt;&gt; $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;break main&quot;</span>  &gt;&gt; $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;continue&quot;</span>    &gt;&gt; $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    @<span style="color: #7a0874; font-weight: bold;">echo</span>
    @<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Use 'avr-gdb -x $(GDBINITFILE)'&quot;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#### Cleanup ####</span>
clean:
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>REMOVE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>TRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>.map $<span style="color: #7a0874; font-weight: bold;">&#40;</span>DUMPTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>REMOVE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJDEPS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>REMOVE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LST<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GDBINITFILE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>REMOVE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>GENASMFILES<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>REMOVE<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>HEXTRG<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">#####                    EOF                   #####</span></pre>

<p>After you've created this Makefile in the same directory as your blinking_led_2313.c file, open a CMD window and go to that directory where the makefile is located. Then type <strong>make</strong> (but be sure you've closed the Arduino-IDE before doing so!!).</p>

<p><strong>Upload the code to the chip</strong></p>

<p>In the same CMD window type: <strong>make install</strong> and you should see a blinking LED in a couple of seconds.</p>

<h2>Some helpfull links</h2>

<p><a href="http://dddanmar.net/?p=5">http://dddanmar.net/</a><br />
<a href="http://peterstuifzand.nl/i-programmed-my-first-attiny2313.html">blinking led</a></p>

<h2>Extra</h2>

<p>MCU names for avr-gcc</p>

<pre class="bash">avr2
at90s2313
at90s2323
at90s2333
at90s2343
attiny22
attiny26
at90s4414
at90s4433
at90s4434
at90s8515
at90c8534
at90s8535
at86rf401
attiny13
attiny2313
avr3
atmega103
atmega603
at43usb320
at43usb355
at76c711
avr4
atmega8
atmega48
atmega88
atmega8515
atmega8535
avr5
atmega16
atmega161
atmega162
atmega163
atmega165
atmega168
atmega169
atmega32
atmega323
atmega325
atmega3250
atmega64
atmega645
atmega6450
atmega128
at90can128
at94k
avr1
at90s1200
attiny11
attiny12
attiny15
attiny28</pre>]]></description>
</item><item>
		<title>3D Math </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>66f041e16a60928b05a7e228a89c3799guid</guid>
		<description><![CDATA[<p>I've been reading up with 3D math, openGL, physics etc.. for a while now and yes, finally I think I'm getting somewhere. The first results, although still extremely basic, but quite fun are ready to be shown.  I've created a sphere from ofxVec3f objects (3d vector objects, in C++), which get randomly distributed using a <a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/spherepoints/">simple spatial algorithm</a>.</p>

<p>Then, after I've calculated the positions for the points I create rectangles, actually just openGL GL_QUADS, but using the crossproduct to get the perpendicular lines/positions that make up de quad. When I've got the positions of the QUADs I use an alpha transparent image and put that as a texture on it.</p>

<p><strong>Calculating the points for the quad</strong><br />
Below is the code I've used to calculate the vertices for the QUAD. I'm not sure if this is the best solution, but it works perfect!</p>

<pre class="c"><span style="color: #993333;">void</span> TestQuad::<span style="color: #202020;">draw</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    ofEnableAlphaBlending<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
    glBegin<span style="color: #66cc66;">&#40;</span>GL_LINE_STRIP<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">0</span>; i &lt; tail.<span style="color: #202020;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ++i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #993333;">float</span> a = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">float</span><span style="color: #66cc66;">&#41;</span>tail.<span style="color: #202020;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-i<span style="color: #66cc66;">&#41;</span>/<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">float</span><span style="color: #66cc66;">&#41;</span>tail.<span style="color: #202020;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> * .<span style="color: #cc66cc;">2</span>;
        glColor4f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span>, <span style="color: #cc66cc;">0.0</span>, <span style="color: #cc66cc;">0.6</span>,a<span style="color: #66cc66;">&#41;</span>;
        glVertex3f<span style="color: #66cc66;">&#40;</span>tail.<span style="color: #202020;">at</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">x</span>, tail.<span style="color: #202020;">at</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">y</span>, tail.<span style="color: #202020;">at</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    glEnd<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    ofxVec3f normal = position - center;
    ofxVec3f up_vec<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
    ofxVec3f p1 = normal.<span style="color: #202020;">getCrossed</span><span style="color: #66cc66;">&#40;</span>up_vec<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">normalize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">scale</span><span style="color: #66cc66;">&#40;</span>size<span style="color: #66cc66;">&#41;</span>;
    ofxVec3f p2 = normal.<span style="color: #202020;">getCrossed</span><span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">normalize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">scale</span><span style="color: #66cc66;">&#40;</span>size<span style="color: #66cc66;">&#41;</span>;
    ofxVec3f p3 = normal.<span style="color: #202020;">getCrossed</span><span style="color: #66cc66;">&#40;</span>p2<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">normalize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">scale</span><span style="color: #66cc66;">&#40;</span>size<span style="color: #66cc66;">&#41;</span>;
    ofxVec3f p4 = normal.<span style="color: #202020;">getCrossed</span><span style="color: #66cc66;">&#40;</span>p3<span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">normalize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">scale</span><span style="color: #66cc66;">&#40;</span>size<span style="color: #66cc66;">&#41;</span>;
    ofxVec3f pp1 = position+p1;
    ofxVec3f pp2 = position+p2;
    ofxVec3f pp3 = position+p3;
    ofxVec3f pp4 = position+p4;
&nbsp;
&nbsp;
    glColor4f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span>,<span style="color: #cc66cc;">1.0</span>,<span style="color: #cc66cc;">1.0</span>,<span style="color: #cc66cc;">0</span>.9f<span style="color: #66cc66;">&#41;</span>;
    glEnable<span style="color: #66cc66;">&#40;</span>GL_TEXTURE_2D<span style="color: #66cc66;">&#41;</span>;
    glBindTexture<span style="color: #66cc66;">&#40;</span>GL_TEXTURE_2D,texture_id<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    glBegin<span style="color: #66cc66;">&#40;</span>GL_QUADS<span style="color: #66cc66;">&#41;</span>;
        glTexCoord2f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>.0f, <span style="color: #cc66cc;">0</span>.0f<span style="color: #66cc66;">&#41;</span>; glVertex3f<span style="color: #66cc66;">&#40;</span>pp1.<span style="color: #202020;">x</span>, pp1.<span style="color: #202020;">y</span>, pp1.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
        glTexCoord2f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>.0f, <span style="color: #cc66cc;">0</span>.0f<span style="color: #66cc66;">&#41;</span>; glVertex3f<span style="color: #66cc66;">&#40;</span>pp2.<span style="color: #202020;">x</span>, pp2.<span style="color: #202020;">y</span>, pp2.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
        glTexCoord2f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>.0f, <span style="color: #cc66cc;">1</span>.0f<span style="color: #66cc66;">&#41;</span>; glVertex3f<span style="color: #66cc66;">&#40;</span>pp3.<span style="color: #202020;">x</span>, pp3.<span style="color: #202020;">y</span>, pp3.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
        glTexCoord2f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>.0f, <span style="color: #cc66cc;">1</span>.0f<span style="color: #66cc66;">&#41;</span>; glVertex3f<span style="color: #66cc66;">&#40;</span>pp4.<span style="color: #202020;">x</span>, pp4.<span style="color: #202020;">y</span>, pp4.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>; 
    glEnd<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    glDisable<span style="color: #66cc66;">&#40;</span>GL_TEXTURE_2D<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<p><strong>Distributing points on a sphere</strong></p>

<pre class="c"><span style="color: #808080; font-style: italic;">// from: http://local.wasp.uwa.edu.au/~pbourke/geometry/spherepoints/</span>
<span style="color: #339933;">#include &quot;stdio.h&quot;</span>
<span style="color: #339933;">#include &quot;stdlib.h&quot;</span>
<span style="color: #339933;">#include &quot;math.h&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
   Create N points on a sphere aproximately equi-distant from each other
   Basically, N points are randomly placed on the sphere and then moved
   around until then moved around until the minimal distance between the
   closed two points is minimaised.
   Paul Bourke, July 1996
*/</span>
&nbsp;
<span style="color: #339933;">#define ABS(x) (x &lt; 0 ? -(x) : (x))</span>
&nbsp;
<span style="color: #993333;">typedef</span> <span style="color: #993333;">struct</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #993333;">double</span> x,y,z;
<span style="color: #66cc66;">&#125;</span> XYZ;
&nbsp;
<span style="color: #993333;">void</span> Normalise<span style="color: #66cc66;">&#40;</span>XYZ *,<span style="color: #993333;">double</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333;">double</span> Distance<span style="color: #66cc66;">&#40;</span>XYZ,XYZ<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/*
   Called with three arguments, the number of points to distribute, the
   radius of the sphere, and the maximum number of iterations to perform.
*/</span>
<span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span>argc,argv<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333;">int</span> argc;
<span style="color: #993333;">char</span> **argv;
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #993333;">int</span> i,j,n;
   <span style="color: #993333;">int</span> counter = <span style="color: #cc66cc;">0</span>,countmax = <span style="color: #cc66cc;">100</span>;
   <span style="color: #993333;">int</span> minp1,minp2;
   <span style="color: #993333;">double</span> r,d,mind,maxd;
   XYZ p<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#93;</span>,p1,p2;
&nbsp;
   <span style="color: #808080; font-style: italic;">/* Check we have the right number of arguments */</span>
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>argc &lt; <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      fprintf<span style="color: #66cc66;">&#40;</span>stderr,<span style="color: #ff0000;">&quot;Usage: %s npoints radius niterations<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>,argv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
      exit<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>n = atoi<span style="color: #66cc66;">&#40;</span>argv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
      n = <span style="color: #cc66cc;">3</span>;
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>r = atof<span style="color: #66cc66;">&#40;</span>argv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">0.001</span><span style="color: #66cc66;">&#41;</span>
      r = <span style="color: #cc66cc;">0.001</span>;
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>countmax = atoi<span style="color: #66cc66;">&#40;</span>argv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>
      countmax = <span style="color: #cc66cc;">100</span>;
&nbsp;
   <span style="color: #808080; font-style: italic;">/* Create the initial random cloud */</span>
   <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>;i&lt;n;i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
       p<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">x</span> = <span style="color: #66cc66;">&#40;</span>rand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>%<span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">-500</span>;
       p<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">y</span> = <span style="color: #66cc66;">&#40;</span>rand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>%<span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">-500</span>;
       p<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">z</span> = <span style="color: #66cc66;">&#40;</span>rand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>%<span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">-500</span>;
       Normalise<span style="color: #66cc66;">&#40;</span>&amp;p<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>,r<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>counter &lt; countmax<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">/* Find the closest two points */</span>
        minp1 = <span style="color: #cc66cc;">0</span>;
        minp2 = <span style="color: #cc66cc;">1</span>;
        mind = Distance<span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>,p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
        maxd = mind;
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>;i&lt;n<span style="color: #cc66cc;">-1</span>;i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>j=i<span style="color: #cc66cc;">+1</span>;j&lt;n;j++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>d = Distance<span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>,p<span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &lt; mind<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                   mind = d;
                   minp1 = i;
                   minp2 = j;
                <span style="color: #66cc66;">&#125;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>d &gt; maxd<span style="color: #66cc66;">&#41;</span>
                   maxd = d;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">/*
           Move the two minimal points apart, in this case by 1%
           but should really vary this for refinement
        */</span>
        p1 = p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>;
        p2 = p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">x</span> = p1.<span style="color: #202020;">x</span> + <span style="color: #cc66cc;">1.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">x</span> - p1.<span style="color: #202020;">x</span><span style="color: #66cc66;">&#41;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">y</span> = p1.<span style="color: #202020;">y</span> + <span style="color: #cc66cc;">1.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">y</span> - p1.<span style="color: #202020;">y</span><span style="color: #66cc66;">&#41;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">z</span> = p1.<span style="color: #202020;">z</span> + <span style="color: #cc66cc;">1.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">z</span> - p1.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">x</span> = p1.<span style="color: #202020;">x</span> - <span style="color: #cc66cc;">0.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">x</span> - p1.<span style="color: #202020;">x</span><span style="color: #66cc66;">&#41;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">y</span> = p1.<span style="color: #202020;">y</span> - <span style="color: #cc66cc;">0.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">y</span> - p1.<span style="color: #202020;">y</span><span style="color: #66cc66;">&#41;</span>;
        p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">z</span> = p1.<span style="color: #202020;">z</span> - <span style="color: #cc66cc;">0.01</span> * <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #202020;">z</span> - p1.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span>;
        Normalise<span style="color: #66cc66;">&#40;</span>&amp;p<span style="color: #66cc66;">&#91;</span>minp1<span style="color: #66cc66;">&#93;</span>,r<span style="color: #66cc66;">&#41;</span>;
        Normalise<span style="color: #66cc66;">&#40;</span>&amp;p<span style="color: #66cc66;">&#91;</span>minp2<span style="color: #66cc66;">&#93;</span>,r<span style="color: #66cc66;">&#41;</span>;
&nbsp;
        counter++;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">/* Write out the points in your favorite format */</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> Normalise<span style="color: #66cc66;">&#40;</span>p,r<span style="color: #66cc66;">&#41;</span>
XYZ *p;
<span style="color: #993333;">double</span> r;
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #993333;">double</span> l;
&nbsp;
   l = r / sqrt<span style="color: #66cc66;">&#40;</span>p-&gt;x*p-&gt;x + p-&gt;y*p-&gt;y + p-&gt;z*p-&gt;z<span style="color: #66cc66;">&#41;</span>;
   p-&gt;x *= l;
   p-&gt;y *= l;
   p-&gt;z *= l;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">double</span> Distance<span style="color: #66cc66;">&#40;</span>p1,p2<span style="color: #66cc66;">&#41;</span>
XYZ p1,p2;
<span style="color: #66cc66;">&#123;</span>
   XYZ p;
&nbsp;
   p.<span style="color: #202020;">x</span> = p1.<span style="color: #202020;">x</span> - p2.<span style="color: #202020;">x</span>;
   p.<span style="color: #202020;">y</span> = p1.<span style="color: #202020;">y</span> - p2.<span style="color: #202020;">y</span>;
   p.<span style="color: #202020;">z</span> = p1.<span style="color: #202020;">z</span> - p2.<span style="color: #202020;">z</span>;
   <span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span>sqrt<span style="color: #66cc66;">&#40;</span>p.<span style="color: #202020;">x*p</span>.<span style="color: #202020;">x</span> + p.<span style="color: #202020;">y*p</span>.<span style="color: #202020;">y</span> + p.<span style="color: #202020;">z*p</span>.<span style="color: #202020;">z</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>]]></description>
</item><item>
		<title>Buttons... buttons.... buttons...</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>9f61408e3afb633e50cdf1b20de6f466guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Trees</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>72b32a1f754ba1c09b3695e0cb6cde7fguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Compiling Code::Blocks from source on Mac</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>b53b3a3d6ab90ce0268229151c9bde11guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Touchtable prototype</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>d82c8d1619ad8176d665453cfb2e55f0guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>3D Math continued </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>a684eceee76fc522773286a895bc8436guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Parsing the maillogs ....</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>9a1158154dfa42caddbd0694a4e9bdc8guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>3D Math, HD video creation</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>2838023a778dfaecdc212708f721b788guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Perlin noise for vortex like animation</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c0c7c76d30bd3dcaefc96f40275bdc0aguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>LSystem update</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>f457c545a9ded88f18ecee47145a72c0guid</guid>
		<description><![CDATA[<p>I did a tiny update on my animated LSystem code... Created a LSystem generator and parser to create nice tree like structures.</p>]]></description>
</item><item>
		<title>Kerstboom-kast version 2.0 </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>642e92efb79421734881b53e1e1b18b6guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Animating LSystems </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>67c6a1e7ce56d3d6fa748ab6d9af3fd7guid</guid>
		<description><![CDATA[<p>I found an amazing article on animating LSystems which uses physics to apply forces to the trunk, branches and leafes of a tree. In the <a href="http://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc09/Hampshire/userGuideFull.pdf">thesis of Nicholas Hampshire</a> one can find a full description of the algorithm used to create some realistic motion. Interesting on this solution is the use of physics, particles and bend forces to create a tree which keeps its shape. When using regular particle systems, you need to create lots of springs to keep the shape together. In this thesis Nicholas describes a way to create this spring forces just from geometric data.</p>]]></description>
</item><item>
		<title>openFrameworks FreakDay #1</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>d9d4f495e875a2e075a1a4a6e1b9770fguid</guid>
		<description><![CDATA[<p>Last weekend we had our first openFrameworks FreakDay with a group of ~14 creative-developers. Some did already amazing things with oF others just came to learn to use it. After a wonderful introduction on oF by Theo everyone started with examples applications or their own projects. This was our first meeting so we had to figure out the format.. for the next meeting we're thinking to create interest-groups where you can participate on a certain subject and work as a group on a problem and try to help/figure out how to create things with oF. You can think of a interest-group "hardware&lt;>of" or visualisation/3D/openGL. We'll think about this format and start a mailing list where everyone can participate on this discussion.</p>]]></description>
</item><item>
		<title>Electricity plan + closet design</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>f7177163c833dff4b38fc8d2872f1ec6guid</guid>
		<description><![CDATA[<p>Just some images so I know where to put the electricty ;-) I'm currently working on my house and puttng all the electricity back into it's place; I'm also working on a closet design.</p>]]></description>
</item><item>
		<title>Exportscript for Illustrator</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>17e62166fc8586dfa4d1bc0e1742c08bguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Creating a separate preloader for your Flash website</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>d67d8ab4f4c10bf22aa353e27879133cguid</guid>
		<description><![CDATA[<h3>What you need to about preloaders</h3>

<p><em>What you need to know about preloaders when you create  a separate preloader.swf for your site.</em></p>

<p>I'll explain a couple of things which are important when you create a preloader for your Flash based website. First of all: use a separate preloader.swf, do not put your preloader code in your site.swf.  When I talk about site.swf, I'm talking about your big fat 2MB Flash based website and the preloader.swf is your slim and shiny tiny 2KB preloader.</p>

<h3>In your site.swf (pseude code)</h3>

<p>The important part is the ADDED_TO_STAGE event listener. Put this in de constructor of your Document class.  This event is fired when the preloader.swf loads in site.swf and adds it as a child.</p>

<pre class="actionscript"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageAlign</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageScaleMode</span>;
package <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Site <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Site<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
   <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #808080; font-style: italic;">//  create your children here!</span>
        <span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
        <span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span> = StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
   <span style="color: #66cc66;">&#125;</span>
 <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>

<h3>In your preloader.swf (pseudo code)</h3>

<p>After you've loaded your site.swf, you can start the intro tweens etc..</p>

<p>When you need to call a function on the loaded swf use:</p>

<pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> myLoader:Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> myUrlReq:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>”<span style="color: #0066CC;">data</span>.<span style="color: #006600;">swf</span>”<span style="color: #66cc66;">&#41;</span>;
myLoader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>myUrlReq<span style="color: #66cc66;">&#41;</span>;
myLoader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, onLoaded<span style="color: #66cc66;">&#41;</span>;</pre>

<p>...and the complete handler...</p>

<pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> onLoaded<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> Square:<span style="color: #000000; font-weight: bold;">Class</span> = event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">applicationDomain</span>.<span style="color: #006600;">getDefinition</span><span style="color: #66cc66;">&#40;</span>”Square”<span style="color: #66cc66;">&#41;</span> as <span style="color: #000000; font-weight: bold;">Class</span>
    <span style="color: #000000; font-weight: bold;">var</span> mySquare:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> Square<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">MovieClip</span>;
    addChild<span style="color: #66cc66;">&#40;</span>mySquare<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>]]></description>
</item><item>
		<title>Blender scripting</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>3416a75f4cea9109507cacd8e2f2aefcguid</guid>
		<description><![CDATA[<p>Scripting a 3D object in Blender</p>

<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> Blender 
<span style="color: #ff7700;font-weight:bold;">from</span> Blender.<span style="color: black;">Object</span> <span style="color: #ff7700;font-weight:bold;">import</span> *
<span style="color: #ff7700;font-weight:bold;">from</span> Blender <span style="color: #ff7700;font-weight:bold;">import</span> Window,Scene,Material
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;font-weight:bold;">import</span> *
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
scn = Scene.<span style="color: black;">GetCurrent</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
num_rows = <span style="color: #ff4500;">10</span>
num_objects = <span style="color: #ff4500;">19</span>
angle_per_obj = <span style="color: black;">&#40;</span>pi * <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>/num_objects
radius = <span style="color: #ff4500;">10.4</span>
angle = <span style="color: #ff4500;">0</span> 
z = <span style="color: #ff4500;">0</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> row <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>num_rows<span style="color: black;">&#41;</span>:
    angle += angle_per_obj/<span style="color: #ff4500;">2</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> x <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>num_objects<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> x
        Blender.<span style="color: black;">Object</span>.<span style="color: black;">Duplicate</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        active = scn.<span style="color: black;">objects</span>.<span style="color: black;">active</span>
        x = cos<span style="color: black;">&#40;</span>angle<span style="color: black;">&#41;</span> * radius
        y = sin<span style="color: black;">&#40;</span>angle<span style="color: black;">&#41;</span> * radius
        active.<span style="color: black;">LocX</span> = x
        active.<span style="color: black;">LocY</span> = y  
        active.<span style="color: black;">LocZ</span> = z
        active.<span style="color: black;">RotZ</span> = angle + pi/<span style="color: #ff4500;">2</span>
        angle += angle_per_obj
    z+= <span style="color: #ff4500;">3</span></pre>]]></description>
</item><item>
		<title>Creating  a GUI for openFrameworks</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>a5771bce93e200c36f7cd9dfd0e5deaaguid</guid>
		<description><![CDATA[<p>Just a note to myself:</p>

<p>When defining a bounding box it's wise to use members variables like:</p>

<pre class="c">min_x  
min_y  
max_x  
max_y</pre>

<p>and <strong>not</strong> variable like</p>

<pre class="c">x  
y  
width  
height</pre>

<p><strong>Why not?</strong><br />
Because using the min_x/max_x variant reduces the number of calculations you have to do for both collision detection and drawing; For example this is how we check the bounding box collision using the min_x variant:</p>

<pre class="c"><span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>nX &gt; min_x<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>nX &lt; max_x<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>nY &gt; min_y<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>nY &lt; max_y<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre>

<p>where this is the x/y/width/height variant:</p>

<pre class="c"><span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>tx &gt; x<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>tx &lt; x + width<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>ty &gt; y<span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span>ty &lt; y + height<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre>

<p>Do you see we need to accumulate a couple of things over there? Well these are just 2  calculations which are dont around 60 times per second when you've a framerate of 60 for each visual object you have.</p>]]></description>
</item><item>
		<title>Making Electronic Thingies In Amsterdam</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>a5bfc9e07964f8dddeb95fc584cd965dguid</guid>
		<description><![CDATA[<p>Yesterday was the first time I visited META; a group of developers, designers, artists, mediatechnologists who get-together and talk about interesting projects and hardware related thingies. I've to say it was really fantastic to meet up with other people who dream about interactive/electronic installations.  Adriaan of <a href="http://fourcelabs.com/waterleven/">Waterleven</a> had a small talk about his project; you can see some <a href="http://fourcelabs.com/waterleven/beeld.html">photos over here</a>.</p>

<p><a href="http://www.blendid.nl">Tim Olden</a> showed us some pictures of his "light installation" (what's the name?) he showed at LowLands 2009.</p>

<p>Just as a reminder, this book, <a href="http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/073560505X">The Hidden Language of Computer Hardware and Software</a>  passed along; maybe or probably it's interesting to read.</p>]]></description>
</item><item>
		<title>Export your Illustrator work to separate PDF files</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>1c383cd30b7c298ab50293adfecb7b18guid</guid>
		<description><![CDATA[<p>This weekend I had to create a user interface design for which I used Illustrator. The document has about 200 layers separated over ~30 pages. For each page I created a main layer that contains all the elements for that specific page. Well, after I finished the UID I wanted to export the pages to a PDF. I couldn't find  a multi page option for the export and therefore I had to export each layer (the page layers) one at a time. By default the settings of the PDF printer exports everything, even hidden layers. <strong>You should disable this option</strong> when you want to export your pages.  Another thing I did was to create a crop area around the visuals in my document that I wanted to export. Using this crop area only the visible/necessary elements are exported. Then I tweaked the size properties in such a way that the page size of the pdf matches exactly the size of the crop area.</p>

<p><em>Have a look at the screenshots for the important settigns I changed after doing File > Print ...</em></p>]]></description>
</item><item>
		<title>3D math</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>19ca14e7ea6328a42e0eb13d585e4c22guid</guid>
		<description><![CDATA[<p>Playing around with 3D rotations.. I'm rotating vertices around several axis to create a peristaltic movement in the figures you can see in the image below. They just use basic sin/cos functions.</p>]]></description>
</item><item>
		<title>YouCube at Lowlands 2009 Biddinghuizen, The Netherlands</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>e369853df766fa44e1ed0ff613f563bdguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Tidy rules</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>6364d3f0f495b6ab9dcf8d3b5c6e0b01guid</guid>
		<description><![CDATA[<p>Yes, Tidy rules!</p>

<p>I'm working on lot's of projects at the moment which is why this blog hasn't been updated in a while. Though I haven't been doing nothing ;-). As you maybe know I'm building my house and we just finished the kitchen! Besides working on my house I'm working on the YouCube project which is due at 20 august when we go to LowLands 2009! Before we go to LowLands I want to finish a website for some clients. After these projects I will start working on my house again ;-) .. and hopefully I'm ready at the end of september when I can start working on some really nice projects I'm looking forwarrd to.</p>

<p>I've been working on some features for our companies (<a href="http://www.apollomedia.nl">ApolloMedia</a>) internally used Flash library. It now has some nice plugin system which is able to load assets files from different locations and initializes a website based on a XML file. All transisitions between the states in the site can be defined in the XML file. Using this "recursive state model" (as how I called it) we will be able to create flash websites in a flash ;-)  To make these websites maintainable I've been working on a new module for our CMS which is able to administrate things like menu/menu-items, images, videos, carousels etc..</p>

<p>.. for this module I used tidy to format the XML.. so just as a reminder for myself:</p>

<pre class="php"><span style="color: #808080; font-style: italic;">// tidy rules!!</span>
<span style="color: #0000ff;">$a_config</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span>
    <span style="color: #ff0000;">'indent'</span>       =&gt; <span style="color: #000000; font-weight: bold;">true</span>
    ,<span style="color: #ff0000;">'input-xml'</span>   =&gt; <span style="color: #000000; font-weight: bold;">true</span>
    ,<span style="color: #ff0000;">'output-xml'</span>  =&gt; <span style="color: #000000; font-weight: bold;">true</span>
    ,<span style="color: #ff0000;">'wrap'</span>        =&gt; <span style="color: #cc66cc;">200</span>
<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$o_tidy</span> = <span style="color: #000000; font-weight: bold;">new</span> tidy;
<span style="color: #0000ff;">$o_tidy</span>-&gt;<span style="color: #006600;">parseString</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$s_xml</span>, <span style="color: #0000ff;">$a_config</span>, <span style="color: #ff0000;">'utf8'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$o_tidy</span>-&gt;<span style="color: #006600;">cleanRepair</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$s_xml</span> = <span style="color: #66cc66;">&#40;</span>string<span style="color: #66cc66;">&#41;</span><span style="color: #0000ff;">$o_tidy</span></pre>]]></description>
</item><item>
		<title>In progress: YouCube </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c16a5320fa475530d9583c34fd356ef5guid</guid>
		<description><![CDATA[<p>I've been too busy the last couple of days... I'm still trying to finish my home but received lots of new clients and projects last week so I've been writing proposals en doing bits of work on my house whenever possible. Meanwhile we at <a href="http://www.apollomedia.nl">ApolloMedia</a> are working on a tetris-like game that will be controlled using a physical installation at <a href="http://www.lowlands.nl">LowLands 2009</a>.  These screenshots are just rough sketches that give you some idea of how it's going to look like.</p>]]></description>
</item><item>
		<title>Glowies</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>6ea9ab1baa0efb9e19094440c317e21bguid</guid>
		<description><![CDATA[<p>Today I created a video to visualize a concept of us at <a href="http://www.apollomedia.nl">ApolloMedia</a> for interactive garbage cans. We want to create a second version of our interactive garbage cans called "Brullenbakken". These garbage cans should light up when someone throws something into them. Hopefully we will start building these "Glowies" in a short time.</p>

<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5450790&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5450790&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>

<p><a href="http://vimeo.com/5450790">Glowies</a> from <a href="http://vimeo.com/user1790965">roxlu</a> on <a href="http://vimeo.com">Vimeo</a>.</p>]]></description>
</item><item>
		<title>openFrameworks.info</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>02e74f10e0327ad868d138f2b4fdd6f0guid</guid>
		<description><![CDATA[<p>Recently I created a website where I can publish articles on the framework to which I got addicted <a href="http://www.openframeworks.cc">openFrameworks</a>. It's really an amazing frameworks which removes barriers to get started with C++. Although I had some experience with C++, openFrameworks was just that little step I wanted to start using it for visualisations / applications.</p>]]></description>
</item><item>
		<title>Flocking a la Craig Reynolds</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>33e75ff09dd601bbe69f351039152189guid</guid>
		<description><![CDATA[<p>Created my first article on flocking at  <a href="http://openframeworks.info/prog_tech/flocking/28">openframeworks.info</a> based on the paper by <a href="http://www.red3d.com/cwr/">Graig Reynolds</a>. I really like the natural motion of these tiny boids. This was also an experiment on blending with openGL.</p>

<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5352863&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5352863&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>

<p><a href="http://vimeo.com/5352863">Flocking with openFrameworks</a> from <a href="http://vimeo.com/user1790965">roxlu</a> on <a href="http://vimeo.com">Vimeo</a>.</p>]]></description>
</item><item>
		<title>Inverse kinematics</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>8e296a067a37563370ded05f5a3bf3ecguid</guid>
		<description><![CDATA[<p><a href="http://www.flickr.com/photos/hahakid/3186279816/">Movie of inverse kinematics on Flickr</a>, seems interesting to use for some nice motion of maybe flowers when used together with perlin noise (?!) If you click through the <a href="http://www.flickr.com/photos/hahakid/">photos of hahakid</a> you see some other interestings topics like <strong>super quick optical flow test</strong>.</p>]]></description>
</item><item>
		<title>Rol Je Rot Rolstoel Race back from Paramaribo</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>4e732ced3463d06de0ca9a15b6153677guid</guid>
		<description><![CDATA[<p>Our <a href="http://www.roljerot.nl">Rol Je Rot</a> project is back from Paramaribo.  It was lot's of fun as you can see on the photos!</p>]]></description>
</item><item>
		<title>Those sweet jellies</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>1ff1de774005f8da13f42943881c655fguid</guid>
		<description><![CDATA[<p>Tried some different techniques to simulate soft bodies. Basically there are a couple of ways to create soft bodies. I found a paper <a href="http://panoramix.ift.uni.wroc.pl/~maq/soft2d/howtosoftbody.pdf">describing soft bodies using a pressure force</a> which was worked quite nice. Other techniques describe point masses/particles which are connected with spring forces. The particles technique looks more natural to me as the pressure force is more like a ... hmm very soft plastic thing. Maybe I used the incorrect properties, but I had lot's of fun anyway ;-)</p>

<p>Next thing I want to do is adding a force which follows a person when walking in front of the webcam.  When you walk by you're followed by these sweet jellies!</p>

<p>BTW, the best results I found using a somewhat adjusted ofxBox2dSoftBody object; see <a href="http://www.openframeworks.info/addons">www.openframeworks.info</a> for a spring based soft body which seemed to work very well.</p>]]></description>
</item><item>
		<title>Busy Busy Busy.... </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>b6d767d2f8ed5d21a44b0e5886680cb9guid</guid>
		<description><![CDATA[<p>Hi there, haven't added something to this blog in a week now, though I've been very busy with <a href="http://www.sugarcity.com">sugarcity</a>.  Last monday the site went online which I designed and developed. Together with <a href="http://www.brandwriters.nl">BrandWriters</a> with whom I worked together we're very happy with the result. <a href="http://www.brandwriters.nl">BrandWriters</a> is responsible for the texts and social media around the website.</p>

<p><img src="/assets/uploaded/34-sugarcity_screenshot.png" alt="sugarcity_screenshot.png" class="" title="sugarcity_screenshot.png"></p>]]></description>
</item><item>
		<title>Physics engines & openFrameworks</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>37693cfc748049e45d87b8c7d8b9aacdguid</guid>
		<description><![CDATA[<p>Working on  a demo using openCV to detect motion in openFrameworks. When motion is detected I apply a force on a couple of "posters".  Users are able to wave around and make the posters spin.
I've done some tests with ofxMSAPhysics, ofxRuiPhysics2d and ofxBox2d.  All engines are easily integrated in a oF project, though Box2d gave me the best natural result. ofxMSAPhysics and ofxRuiPhysics2d are also great btw!</p>

<p><strong>Rigid bodies</strong></p>

<p><img src="/assets/uploaded/36-box2d_2.jpg" alt="box2d_2.jpg" class="" title="box2d_2.jpg"></p>

<p><strong>Demo (I only use T-Mobile as an example; I'm not (yet) hired by T-Mobile</strong></p>

<p><img src="/assets/uploaded/35-box2d_1.jpg" alt="box2d_1.jpg" class="" title="box2d_1.jpg"></p>]]></description>
</item><item>
		<title>OpenGL</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>3c59dc048e8850243be8079a5c74d079guid</guid>
		<description><![CDATA[<p>I spent some time playing around with OpenGL. Some notes to myself:</p>

<pre class="c">gluLookAt<span style="color: #66cc66;">&#40;</span>camX, camY, camZ, eyeX, eyeY, eyeZ, upX, upY, upZ<span style="color: #66cc66;">&#41;</span></pre>

<blockquote><p><strong>camX/Y/Z</strong>: Position of the camera<br />
  <strong>eyeX/Y/Z</strong>: Camera looks at this position<br />
   <strong>upX/Y/Z</strong>: The up vector, mostly use: 0,1,0 (what's the top of the camera</p>
</blockquote>]]></description>
</item><item>
		<title>Brullenbakken on place</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>98f13708210194c475687be6106a3b84guid</guid>
		<description><![CDATA[<p>Today we've "installed" our brullenbakken project at location.</p><p><img src="/modules/files/uploaded/31-brullenbakken0092.jpg" alt="" class="" title=""></p>]]></description>
</item><item>
		<title>Brullenbakken</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>1f0e3dad99908345f7439f8ffabdffc4guid</guid>
		<description><![CDATA[<p>Working on some interactive garbage cans.  Using light we create a time based game.</p><p><img src="/modules/files/uploaded/27-brullenbakkenadobe052.jpg" alt="Brullenbakken " class="" title="Brullenbakken "></p><p><img src="/modules/files/uploaded/28-brullenbakkenadobe031.jpg" alt="Brullenbakken " class="" title="Brullenbakken "></p><p><img src="/modules/files/uploaded/29-brullenbakkenadobe032.jpg" alt="Brullenbakken " class="" title="Brullenbakken "></p><p><img src="/modules/files/uploaded/30-brullenbakkenadobe035.jpg" alt="Brullenbakken " class="" title="Brullenbakken "></p>]]></description>
</item><item>
		<title>Grass animation</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>6f4922f45568161a8cdf4ad2299f6d23guid</guid>
		<description><![CDATA[<p>My first vimeo movie :>. (not really happy with the quality though)</p><p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4773265&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4773265&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p><p><a href="http://vimeo.com/4773265">Experimenting with Grass animation</a> from <a href="http://vimeo.com/user1790965">roxlu</a> on <a href="http://vimeo.com">Vimeo</a>.</p>]]></description>
</item><item>
		<title>Perlin noise </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>70efdf2ec9b086079795c442636b55fbguid</guid>
		<description><![CDATA[<p>I finally took my chance to do some tests with perlin noise and I'm happy I did. Perlin noise gives you a natural random number that I use to create some smooth and natural motion.  Below you see some screenshots from the application I've created to do some tests with perlin noise an natural motion.</p><p><img src="/modules/files/uploaded/23-screenshot211.png" alt="" class="" title=""></p><p><img src="/modules/files/uploaded/24-screenshot210.png" alt="" class="" title=""></p><p><img src="/modules/files/uploaded/25-screenshot209.png" alt="" class="" title=""></p><p><img src="/modules/files/uploaded/26-screenshot208.png" alt="" class="" title=""></p>]]></description>
</item><item>
		<title>Choosing a transistor</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c74d97b01eae257e44aa9d5bade97bafguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Rol Je Rot Rolstoel Race goes to Paramaribo!!</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>9bf31c7ff062936a96d3c8bd1f8f2ff3guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Rol Je Rot Rolstoel Race & 3D</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>aab3238922bcc25a6f606eb525ffdc56guid</guid>
		<description><![CDATA[<p>Currently I'm doing some tests with a great 3D engine called <a href="http://www.ogre3d.org">Ogre3D</a> and the <a href="http://www.bulletphysics.com/Bullet/wordpress/">Bullet</a> physics engine <a href="http://www.roljerot.nl">Rol Je for Rot Rolstoel Race</a> and other interactive installation we're working on. Below you see an image of my first test with Bullet and Ogre</p><p><img src="/modules/files/uploaded/22-ninja.png" alt="Ninja" class="" title="Ninja"></p><p>While googling on Bullet I found these sites which seems interesting:</p>

<ul>
<li><a href="http://www.rchoetzlein.com/art/index.htm">http://www.rchoetzlein.com/art/index.htm</a></li>
</ul><p>Video of an algoritm found on above site
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3899908&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3899908&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p><p><a href="http://vimeo.com/3899908">water simulation</a> from <a href="http://vimeo.com/user856298">arturo</a> on <a href="http://vimeo.com">Vimeo</a>.</p>]]></description>
</item><item>
		<title>Springs</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c51ce410c124a10e0db5e4b97fc2af39guid</guid>
		<description><![CDATA[<p>It was a very busy week but finally got some time to continue my expirments with <a href="http://www.openframeworks.cc">openframeworks</a> and programming motion.
<img src="/modules/files/uploaded/21-screenshot191.png" alt="Sentinel" class="" title="Sentinel"></p><p>This images show a couple of springs tied up. The squares have multiple springs connected so the stay in their 'square like' shape. This could be used to create jelly like surfaces.</p><p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/SvqY_pgA6DU&hl=nl&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SvqY_pgA6DU&hl=nl&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>]]></description>
</item><item>
		<title>Steering behaviors</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>d3d9446802a44259755d38e6d163e820guid</guid>
		<description><![CDATA[<p>A couple of weeks ago I bought the book <a href="http://www.friendsofed.com/book.html?isbn=9781430216087">Advanced Actionscript 3 Animation</a> and currently I'm playing around with with some of the fancy techniques like steering behavior.</p><p>As a reminder for myself these are some things I'm working on:</p>

<ul>
<li>Center of mass (visualisation)</li>
<li>Angle between two vectors (visualisation)</li>
<li>Steering behavior: separation</li>
<li>Steering behavior: cohesion</li>
<li>Steering behavior: alignment</li>
</ul>]]></description>
</item><item>
		<title>Mixed media part 2</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c20ad4d76fe97759aa27a0c99bff6710guid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Opentoko</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>6512bd43d9caa6e02c990b0a82652dcaguid</guid>
		<description><![CDATA[]]></description>
</item><item>
		<title>Natural motion</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>45c48cce2e2d7fbdea1afc51c7c6ad26guid</guid>
		<description><![CDATA[<p>One of the things which get's me excited are visualisations with some sort of natural motion.  I'm playing with different ways to visualize 'natural' motion. 
<img src="/modules/files/uploaded/15-screenshot187.png" alt="Grass" class="" title="Grass"></p><p>Above you can see an example of grass which I created using Spring physics. It's a quick sketch using <a href="http://www.processing.org">processing</a>.  When I've played
around with enough visualization techniques I'll continue on my "Flickr Hunt" application.</p><p>Some interesting project I found while googling for natural algorithms is Carnival Aquarium. See <a href="http://www.flickr.com/photos/51035749109@N01/3364454826">carnival @ flickr</a></p>]]></description>
</item><item>
		<title>Reactivision Fiducial markers</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>c9f0f895fb98ab9159f51fd0297e236dguid</guid>
		<description><![CDATA[<p>Reactivision created a new kind of fiducial marker for their <a href="http://www.reactable.com">reactable</a>. After reading their paper and videos it seemed like a solid solution for marker recognition. Though after doing some tests with it, using custom code created using <a href="http://www.openframeworks.cc">OpenFrameworks</a> the results didn't seem so wonderful.</p><p>I can probably improve the results when I use infrared and a table like reatable with better lightning conditions. But, it would be very nice to use these marker on my iphone and the x/y/z sensor.... (this will be continued)</p><p><img src="/modules/files/uploaded/14-screenshot135.png" alt="Reactivision" class="" title="Reactivision"></p>]]></description>
</item><item>
		<title>Mixed media research (part 2)</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>8f14e45fceea167a5a36dedd4bea2543guid</guid>
		<description><![CDATA[<p>Ah that's nice. You probably also into mixed media like I do. Therefore you can admire some of my works below.  <strong>Do you think you can make a better mixed media project?  Please show me :></strong></p><p><img src="/modules/files/uploaded/9-007.jpg" alt="Mixed Media Research 1" class="" title="Mixed Media Research 1">
<img src="/modules/files/uploaded/10-008.jpg" alt="Mixed Media Research 2" class="" title="Mixed Media Research 2">
<img src="/modules/files/uploaded/11-009.jpg" alt="Mixed Media Research 3" class="" title="Mixed Media Research 3">
<a href=""
                                     title=""></a>
<img src="/modules/files/uploaded/13-012.jpg" alt="Mixed Media Research 5" class="" title="Mixed Media Research 5"></p>]]></description>
</item><item>
		<title>Mixed media research</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>1679091c5a880faf6fb5e6087eb1b2dcguid</guid>
		<description><![CDATA[<p>I'm diving into the wonderful world of <a href="http://nl.wikipedia.org/wiki/Mixed_media">mixed media</a>. Currently I've been doing some research into a very interesting combination of two or more media. I'll post an update tomorrow and show you one of the incredible amazing projects I'm working on. I'm sure you'll be amazed by the way I'm combining <a href="http://nl.wikipedia.org/wiki/Mixed_media">multiple media</a>.</p><p>Stay tuned....</p>]]></description>
</item><item>
		<title>Rol Je Rot Rolstoel Race at Cinekid </title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>e4da3b7fbbce2345d7772b0674a318d5guid</guid>
		<description><![CDATA[<p>I'm happy to announce that <a href="http://www.sparkl.nu">our</a> Rol Je Rot Rolstoel Race (RJRRR) is featured at <a href="http://www.cinekid.nl/nl">Cinekid Zoetermeer</a>.  RJRRR is a game which is controlled by wheelchairs.<br />
<a href=""
                                     title=""></a></p><p>Another very interesting and funny project called <a href="http://www.blockblazers.com">BlockBlazers</a> is presented. In this pervasive game you use Wii remotes to control a 2D platform game which is spread over two screens. The screens are positioned with their back against each other. When your game character runs to the left of the screen it pops up in the other screen and you've to run around the screen. See <a href="http://fourcelabs.com/">FourceLabs</a> for more information about the creators of BlockBlazers.</p><p><img src="/modules/files/uploaded/8-bb_4blocks_250px.png" alt="Cinekid Blockblazers" class="" title="Cinekid Blockblazers"></p><p>Next to <a href="http://www.blockblazers.com">BlockBlazers</a> you can try out <a href="http://julianoliver.com/levelhead">LevelHead</a> which is a augmented reality game. You control a cube with <a href="http://www.hitl.washington.edu/artoolkit/">ARToolkit</a> markers. Best way to explain this is to have a look at this video:</p><p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/5ks1u0A8xdU&hl=nl&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5ks1u0A8xdU&hl=nl&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p><p>A picture of the installation at <a href="http://www.cinekid.nl/nl">Cinekid Zoetermeer</a>.
<img src="/modules/files/uploaded/7-cinekid_levelhead.jpg" alt="Cinekid levelHead" class="" title="Cinekid levelHead"></p><p>And if this wasnt enough, we have <a href="http://www.globe4d.com/">Globe4D</a>.  Globe4D is a project of <a href="http://www.companje.nl">Rick Companje</a>, Nico van Dijk, Hanco Hogenbirk, Danica Mast and Dirk Jansen.  Globe4D is an interactive, four-dimensional globe. It’s a projection of the Earth’s surface on a physical sphere. It shows the historical movement of the continents as its main feature, but it is also capable of displaying all kinds of other geographical data such as climate changes, plant growth, radiation, rainfall, forest fires, seasons, airplane routes, and more.</p><p><img src="/modules/files/uploaded/5-cinekid_globe4d.jpg" alt="Cinekid Globe4D" class="" title="Cinekid Globe4D"></p>

<h1>Rol Je Rot Rolstoel Race</h1><p>And of course some pictures of our project:</p><p><img src="/modules/files/uploaded/2-cinekid_roljerot.jpg" alt="Cinekid RJRR " class="" title="Cinekid RJRR ">
<img src="/modules/files/uploaded/3-cinekid_roljerot2.jpg" alt="Cinekid RJRR " class="" title="Cinekid RJRR ">
<img src="/modules/files/uploaded/4-cinekid_roljerot3.jpg" alt="Cinekid RJRR " class="" title="Cinekid RJRR "></p>]]></description>
</item><item>
		<title>Finally</title>
		<link>http://www.roxlu.com</link>
		<pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>
		<guid>a87ff679a2f3e71d9181a67b7542122cguid</guid>
		<description><![CDATA[<p>It's been a while since I had my own site though I'll give it a shot again. I hope I'll blog longer than a couple of months this time :></p><p>I'll try to post on a two daily basis about internet, design, marketing, technology, science and my favorite <a href="http://mediatechnology.leiden.edu/">Media Technology</a> related topics.</p>]]></description>
</item></channel>
</rss>
