Wednesday, January 26, 2005

well, today I begun learning how to use processing. A program I usually avoid (due to the fact you need to code stuff), however so far I've found it quite nice and friendly... ish, but whats a few OutOfMemory messages between friends.

So far Ive managed to get it to read my log file, ignore the crap, turn the strings into numbers and put them all in a lovely array of usable floats (in order of course).

Heres the code. And please please, if anyone can do this more efficiently I'd love to know how, cuz I'm sure I shouldnt be doing this the way I have (theres probably a rediculously simple way).


size (200,200);

String intarr [] = loadStrings("UT2004.log");
int len = intarr.length;
String justnum [] = new String [len];


for (int i=0; i < len; i++) {

String temp[] =splitStrings(intarr[i]);
justnum[i] = temp[3];

}

String formatted = join(justnum, " ");
float thelist[] = splitFloats(formatted);

println(thelist[100]); //just checking


God I hate code, I mean its not exactly pretty to look at is it! Anyway there it is so far, and as for my lego animation... well, lets call that "on hold" shall we (this is far more exciting).

By the way I keep putting my code on here incase for some reason I should lose the working version, At least I know the good working stuff exists here. and also just incase someone else needs the same thing done as me (this thingy up here for example I'm sure will be useful to someone).

Oh yeah thanks RegularX on the beyondunreal forums, most helpful :)

1 Comments:

Blogger Alison said...

Thanks quasimondo, I'll do that. :)

2:28 am  

Post a Comment

<< Home