pretty sure it's related to SAITO's post ( http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1114158993;start=0 ), but it looks like P3D and openGL are having a bit of trouble filling shapes.
Code:
import processing.opengl.*;
float rx, rz = 0; //x, z current rotation
float tgtX, tgtZ = 0; //x, z target rotation
float rSpeed = .06f; //rotation speed
float zoomVal = 0; //zoom value
float zoomInc = 10; //zoom increment (per keypress)
float tgtZoom = 0; //target zoom value
float zoomSpeed = .06f; //zoom speed
void setup () {
size(800, 800, OPENGL);
//size(800, 800, P3D);
}
void draw () {
background(0);
pushMatrix();
zoom();
rotateCamera();
drawCurve();
popMatrix();
}
void drawCurve () {
//-----------CURVE ONE-----------//
stroke(0, 0, 0);
fill(0.3333*255, 0.5569*255, 0.6667*255);
beginShape();
vertex(253.0698, height-673.2793);
bezierVertex(163.5347,height-629.0933, 163.5347,height-629.0933, 171.6743,height-582.5815);
bezierVertex(179.814,height-536.0698, 230.9766,height-461.6509, 285.6279,height-502.3486);
bezierVertex(340.2793,height-543.0464, 386.79,height-569.7905, 354.2324,height-618.6279);
bezierVertex(321.6748,height-667.4653, 283.3022,height-684.9072, 253.0698,height-673.2793);
endShape();
//----------CURVE THREE----------//
stroke(0.7882*255, 0.1843*255, 0*255);
fill(0.9569*255, 0.698*255, 0.1176*255);
beginShape();
vertex(272.8374,height-212.8145);
vertex(203.0698,height-215.1396);
vertex(201.9067,height-151.1865);
bezierVertex(229.8135,height-102.3477, 263.5347,height-120.9531, 263.5347,height-120.9531);
bezierVertex(297.2559,height-139.5586, 329.8135,height-187.2324, 329.8135,height-187.2324);
bezierVertex(326.3262,height-238.3945, 308.8838,height-240.7207, 308.8838,height-240.7207);
bezierVertex(291.4419,height-243.0469, 272.8374,height-212.8145, 272.8374,height-212.8145);
endShape();
}
void rotateCamera () {
translate(width/2, height/2);
if (mousePressed) {
tgtZ = ((float)(mouseX-width/2)/(width/2)*PI);
tgtX = ((float)(mouseY-height/2)/(height/2)*PI);
}
rx += (tgtX-rx) * rSpeed;
rz += (tgtZ-rz) * rSpeed;
rotateX(-rx);
rotateZ(-rz);
translate(-width/2, -height/2);
}
void zoom () {
if (keyPressed) {
if (key == 'a') { tgtZoom += zoomInc; }
else if (key == 'z') { tgtZoom -= zoomInc; }
}
zoomVal += (tgtZoom - zoomVal) * zoomSpeed;
translate(0, 0, zoomVal);
}
in openGL, poly edges are visible in the middle of the shapes. this may be something intrinsic to openGL, i dunno....
in both openGL and P3D, the orange shape doesn't completely fill. i tried taking polygons off the xy-plane (perp to z-axis) per SAITO's suggestion in the above post, but no luck getting that lower-left corner on the orange shape to fill in either openGL or P3D.
oh, and all of this works great in P2D.
-d