SAITO
YaBB Newbies
Offline
Posts: 22
Los Angeles
|
polygon rendering bug?
Apr 22nd, 2005, 10:36am
hello
a polygon perpendicular to z-axis is always not correctly rendered. i can see the border lines but the polygon is not filled. polygons that are not perpendicular to z-axis are correctly rendered.
----
import processing.opengl.*;
float rotX; float rotY;
void setup() { size(200, 200, OPENGL); framerate(30); }
void draw() { background(51); fill(200); stroke(200); lights();
pushMatrix(); translate(width/2, height/2, 0); rotateX(rotY); rotateY(rotX); //a polygon perpendicular to z-axis beginShape(POLYGON); vertex(0.0, -50.0, -50.0); vertex(0.0, 50.0, 50.0); vertex(0.0,50.0, -50.0); endShape(); // not perpendicular beginShape(POLYGON); vertex(-50.0, -50.0, 0.0); vertex(50.0, -50.0, 0.0); vertex(-50.0,50.0, 0.0); endShape();
popMatrix(); }
void mouseDragged(){ rotX += (mouseX - pmouseX) * 0.01; rotY += (mouseY - pmouseY) * 0.01; }
|