I'm making a program to get the midpoint of a line. However i'm running into a problem.
What i need to be able to do is have as many points as i want, and dimensions. However i have no idea how to do this
So let me give you an idea of what i want to do.
points[point][x]=1; points[point][y]=2; points[point][z]=3;
See what i'm getting at? This is what i currently have
public float[][] points={{}};
And when i want to write to it
for(int i=0; i<parts.length;i++){
points[currentPoint][i]=Float.valueOf(parts[i]);
}
java.lang.ArrayIndexOutOfBoundsException: 0
So how can i do this?