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 › PGraphics and bezierVertex
Page Index Toggle Pages: 1
PGraphics and bezierVertex (Read 538 times)
PGraphics and bezierVertex
Oct 28th, 2006, 12:24pm
 
When I try to draw an bezierVertex on a PGraphics2D object if got the error:

java.lang.RuntimeException: A call to vertex() must be used before bezierVertex()
at processing.core.PGraphics.bezierVertex(PGraphics.java:1004)
at processing.core.PGraphics.bezierVertex(PGraphics.java:978)
at Temporary_782_6492.draw(Temporary_782_6492.java:21)
at processing.core.PApplet.handleDisplay(PApplet.java:1311)
at processing.core.PGraphics.requestDisplay(PGraphics.java:568)
at processing.core.PApplet.run(PApplet.java:1406)
at java.lang.Thread.run(Thread.java:613)

and with PGraphicsJava2D if got the following error:

java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster.
java:427)
at processing.core.PGraphicsJava2D.updatePixels(PGraphicsJava2D.java:1064)
at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:578)
at processing.core.PGraphics.image(PGraphics.java:1997)
at processing.core.PApplet.image(PApplet.java:7074)
at Temporary_3080_1244.draw(Temporary_3080_1244.java:23)
at processing.core.PApplet.handleDisplay(PApplet.java:1311)
at processing.core.PGraphics.requestDisplay(PGraphics.java:568)
at processing.core.PApplet.run(PApplet.java:1406)
at java.lang.Thread.run(Thread.java:613)

with PGraphics3D it works but there is the fill bug.

Quote:


import processing.opengl.*;
PGraphics     pg = createGraphics(100, 100, P3D);

void setup(){
 size(400,400);
 
 pg.beginDraw();
 pg.translate(pg.width/2,pg.height/2);
 pg.stroke(0);
 pg.background(255);
 pg.beginShape();
 pg.vertex(30, 20);
 pg.bezierVertex(80, 0, 80, 75, 30, 75);
 pg.bezierVertex(50, 80, 60, 25, 30, 20);
 pg.endShape();
 pg.endDraw();
}

void draw(){

 image(pg,random(width),random(height));

}


Re: PGraphics and bezierVertex
Reply #1 - Oct 28th, 2006, 2:43pm
 
this is a known bug. P3D is working ok but JAVA2D has some problems that will be fixed shortly. P2D is not yet implemented.

edit: the link to the bug report is here:
http://dev.processing.org/bugs/show_bug.cgi?id=419
Page Index Toggle Pages: 1