hi everybody,
i have a weird problem with a code. i tried to create lines from the values of a fft analysis of a sound file.
my problem is an ArrayIndexOutOfBoundException...
parts of my code:
int num = 100;
int pastNum = 40;
[...]
for(int dr=0; dr<num; dr++) {
p[dr].go(); //exception at 180.000 and more
}
[...]
void go(){
PangleX += rotSpeedX;
PangleY += rotSpeedY;
PangleZ += rotSpeedZ;
drawPast();
}
void drawPast() {
for(int i=0; i<pastNum-1; i++) {
[...]
if(i != 0) {
line(mousePast[i].x, mousePast[i].y,
mousePast[i-1].x, mousePast[i-1].y);
//in the stack trace this part is mentioned too
}
}
}
the whole exception:
java.lang.ArrayIndexOutOfBoundsException: 180424
at BLine.drawLine_plain_alpha_spatial(BLine.java:862)
at BLine.draw(BLine.java:410)
at BGraphics.draw_lines(BGraphics.java:2848 )
at BGraphics.endShape(BGraphics.java:2107)
at BGraphics.line(BGraphics.java:3296)
at BApplet.line(BApplet.java:2840)
at Temporary_3767_6751$PLine.drawPast(Temporary_3767_6751.java:106)
at Temporary_3767_6751$PLine.go(Temporary_3767_6751.java:90)
at Temporary_3767_6751.loop(Temporary_3767_6751.java:63)
at BApplet.nextFrame(BApplet.java:498 )
at BApplet.run(BApplet.java:428 )
at java.lang.Thread.run(Thread.java:536)
so i can't see what i've done wrong. any ideas? are the arguments for line limited? or is it a bug?
thx h4nni