First of all, this is Mesh:
http://leebyron.com/else/mesh
Now, my problem when I try to put anything into a "Voronoi" type variable. I get:
ArrayIndexOutOfBoundsException: 0.
From what I was told in another post, that means my "Voronoi" array is size 0 and I'm trying to put something into it, which of course... doesnt fit.
But I can't manage to give it a size :S
I've tried:
In the header.
float [][] centroid = new float [20][2];
Voronoi myVoronoi = new Voronoi(centroid);In the "setup" function:
Header --> Voronoi myVoronoi;
float [][] centroid = new float [20][2];
Setup ---> myVoronoi = new Voronoi (centroid);In the "draw" function itself:
Header --> Voronoi myVoronoi;
float [][] centroid = new float [20][2];
Draw ----> myVoronoi = new Voronoi( centroid );With every method I get the same error :S Array size = 0...
Does anyone know why this might be happening?
Thanks for your help. Once again....
PD: Actually the whole error is this, in case it helps:
ArrayIndexOutOfBoundsException : 0
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 0
at megamu.mesh.IntArray.add(IntArray.java:22)
at megamu.mesh.Voronoi.<init>(Voronoi.java:127)
at sketch_aug29a.draw(sketch_aug29a.java:163)
at processing.core.PApplet.handleDraw(PApplet.java:1406)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Unknown Source)