We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › problems with arguments for line() ?
Page Index Toggle Pages: 1
problems with arguments for line() ?? (Read 1057 times)
problems with arguments for line() ??
May 2nd, 2005, 2:58pm
 
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? Sad

thx h4nni
Re: problems with arguments for line() ??
Reply #1 - May 2nd, 2005, 3:37pm
 
What version of Processing are you using? That looks like a 69 stack dump. (We shouldn't be seeing BApplet etc, it should be PApplet)

Are you using the P2D renderer? If so, I'm not sure if it's been officially blessed as usable yet.
Re: problems with arguments for line() ??
Reply #2 - May 2nd, 2005, 3:46pm
 
hi...yes i'm using 69 version..is this a kown bug?!
and i'm not using the p2d renderer...
Re: problems with arguments for line() ??
Reply #3 - May 2nd, 2005, 5:29pm
 
please upgrade to the newest version from the download page and give that a try instead. lots of these things have been fixed so we're no longer supporting the old version.
Page Index Toggle Pages: 1