TherioN - 15 July 2008 12:31 PM
Good work
Nice to see somebody else messing with Processing, instead of always Flash, WPF, or Python =)
thanks
There’s a lot of stuff going on in multi-touch land at the moment, and i wanted to find a way to contribute.
Processing had been on my mind for a while allready, because of JMyron, Arduino and Wiring, and the active user group.
and i just love how easy and lightweight processing is at the same time.
i do flash too, but i’ve been around ActionScript 1 and 2.0, and i just find 3.0 horribly confusing.
i looked at VVVV but it gave me headaches
because I have mostly been working with java, and am currently learning C#, i like languages like processing from the get-go.
(yay, laziness!
)
So i fixed JMyron, submitted the patch to SourceForge and i’m writing my own little blob handling sketch.
here’s a screenie (sorry, i don’t have an FTIR yet, i’m trying to get it to work with a MTMini :( )
::edit::
don’t use my JMyron replacement yet, it’s still quirky :(
it works fine when displaying an uneven number of blobs now, however it makes up artifact blobs when it finds an even number.
stay posted, i will have a new replacement soon.
::edit::
--UPDATE--
JMyron blob-center tracking now works as it should, tested 100% :D
The problem was, that myron returned the coordinates in a normal array of integers, and added an empty zero at the end of that array for every blob.
It took me a while to figure it out though.
this fixed it :
public int[][] globCenters(){
int b[] = native_globCenters();
//returnArray[] should be b.length/3 instead of b.length/2
int returnArray[][] = new int[b.length/3][2];
//Myron natively returns three (3)
//coordinates per-glob...
//since the last coordinate is added
//as a single zero at the end of native_globcenters[]
//we itterate through one third of the number
//of coordinates
//(we fetch two coordinates each time, so we actually
// get two third of the coordinates this way)
//id will point at the 'glob' whose coordinates we are getting
int id = 0;
//itterate through one third of the available coordinates
for(int i=0;i<b.length/3;i++){
returnArray[i][0] = b[id*2 ];
returnArray[i][1] = b[id*2+1];
//increment id
id++;
}
return returnArray;
}
the fixed JMyron.jar is attached to this post.
enjoy it, and start making stuff! :D