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 & HelpPrograms › newbie, java.lang.InternalError
Page Index Toggle Pages: 1
newbie, java.lang.InternalError (Read 673 times)
newbie, java.lang.InternalError
Oct 14th, 2005, 5:50pm
 
Hi.

I am a new user interested in computational fluid dynamics.

while trying to run this simple script:

void setup()
{
 size(500,500);
 framerate(30);
}

void draw()
{
 background(204);

 //create grid
 for(float i=1; i<500; i=i+20) {
   for(float j=1; j<500; j=j+20) {


 pushMatrix();
 

//find slope, then rotate
translate(i,j);
float slope =(j-mouseY)/(i-mouseX);

rotate(slope);
 line(0, 0, 10, 10);
 popMatrix();
 
}
}


}

I get the following error codes:
java.lang.InternalError: Unable to Stroke shape (setPenT4: invalid pen transformation (singular))


at sun.java2d.pipe.LoopPipe.getStrokeSpans(Unknown Source)


at sun.java2d.pipe.LoopPipe.draw(Unknown Source)


at sun.java2d.pipe.ValidatePipe.draw(Unknown Source)


at sun.java2d.SunGraphics2D.draw(Unknown Source)


at processing.core.PGraphics2.stroke_shape(PGraphics2.java:383)


at processing.core.PGraphics2.line(PGraphics2.java:411)


at processing.core.PApplet.line(PApplet.java:5827)


at Temporary_9210_1234.draw(Temporary_9210_1234.java:27)


at processing.core.PApplet.display(PApplet.java:1116)


at processing.core.PGraphics.requestDisplay(PGraphics.java:362)


at processing.core.PApplet.run(PApplet.java:951)


at java.lang.Thread.run(Unknown Source)

From reading the documentation, it seems as if this should work. Am I doing something wrong??

Thanks,
Meg
UMCP
http://www.megmitchell.com/eyecandy/
Re: newbie, java.lang.InternalError
Reply #1 - Oct 14th, 2005, 7:05pm
 
my guess is that sometimes (i - mouseX) is zero, and the result is that you're dividing by zero, which is undefined or negative infinity or something like that.

just add something to make sure that you're not doing that. or in some cases your slope might be enormous, which could also cause a similar problem.
Page Index Toggle Pages: 1