Bug 1168 : point ArrayIndexOutOfBoundsException
Last modified: 2009-02-23 12:58




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
XLd
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-02-22 15:33
Error in 1.0.2, Win XP SP3, Thinkpad T43p
Sketch works fine in 1.0.1
//Code
for (int i = 1; i < steps; i++){

point( (width/steps) * i, (height/2) + random(-rand, rand), -20);
rand += random(-10, 10);
}
//Error Detail
Exception in thread "Animation Thread"
java.lang.ArrayIndexOutOfBoundsException: 787408
at processing.core.PGraphics3D.renderPoints(PGraphics3D.java:980)
at processing.core.PGraphics3D.endShape(PGraphics3D.java:636)
at processing.core.PGraphics.endShape(PGraphics.java:1153)
at processing.core.PGraphics.point(PGraphics.java:1400)
at processing.core.PApplet.point(PApplet.java:6938)
at buddaAll4$Stars.<init>(buddaAll4.java:545)
at buddaAll4.earthBig1(buddaAll4.java:485)
at buddaAll4.draw(buddaAll4.java:145)
at processing.core.PApplet.handleDraw(PApplet.java:1423)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Unknown Source)
Additional Comment #1 From fry 2009-02-23 05:18
hm, that's not enough code for me to reproduce the problem. i need your
size() line, and the values for rand and step. i tried other values and the
code worked fine.
Additional Comment #2 From XLd 2009-02-23 12:48
Here are the rest:

float steps = 301;
float rand = 0;
size(1024, 768, P3D);

//example
float steps = 301;
float rand = 0;

void setup() {
size(1024, 768, P3D);
background(0);
stroke(255);
}

void draw() {
for (int i = 1; i < steps; i++) {
point( (width/steps) * i, (height/2) + random(-rand, rand), -20);
rand += random(-10, 10);
}
}
Additional Comment #3 From fry 2009-02-23 12:58
Thanks, already found and fixed this one earlier today while dealing with
another issue. Will be fixed for 1.0.3.