Updated Processing works

I updated all the processing works to use a more common code base. Additionally i added start/stop functionality to the small versions displayed directly in the blog.
I also fixed a few minor (and some major) issues in the Sand Traveler project.
In the original code you will find the following line:

float tinc = ot+(1.1-t/num)*2*t*TWO_PI/num;

which i ported to:

var tinc:Number = ot + ( 1.1 - cityIdx / NUM_CITIES ) * 2 * cityIdx * MathHelper.TWO_PI / NUM_CITIES;

Now cityIdx (t) and NUM_CITIES (num) are both integers. Java (Processing) will correctly do the integer division (which always results in 0). Thus the whole term “(1.1-t/num)” always equals 1.1.
Now the Flex compiler has a different opinion on how this should be evaluated. The presence of 1.1 makes it cast cityIdx and NUM_CITIES to Number as well.

This whole drama led to further errors in the original port. You can grab the fixed source from svn://dirty-motherfucker.org:8888/processing/trunk

Here are the new stand alone versions:
Buddahbrot
Happy Place
Sand Traveler
Substrate

Leave a Reply

You must be logged in to post a comment.