adzer2
YaBB Newbies
Offline
Posts: 15
Ireland
Polygons
Nov 23rd , 2005, 2:19am
Hi, whenever I create some of my polygons, they never get filled in, the fill method has been called and the points appear, but it never fills it? import processing.opengl.*; float x = 0; void setup() { size(800,600, OPENGL); } void draw() { translate(width/2, height/2); background(255); lights(); rotateZ(0); rotateY(x); rotateX(0); //noStroke(); scale(3); fill (120, 120, 120); beginShape(POLYGON); vertex(5, 5, 0); vertex(-5, 5, 0); vertex(-5, -5, 0); vertex(5, -5, 0); endShape(); translate (0, 50, 18); //main front wing box(60, 5, 20); //side of wing fill (120, 120, 120); beginShape(POLYGON); vertex(30, -10, 15); vertex(30, 5, 15); vertex(30, 0, 0); vertex(30, 5, -15); vertex(30, -10, -15); vertex(30, -5, -5); vertex(30, -10, 15); endShape(); beginShape(POLYGON); vertex(-30, -10, 15); vertex(-30, 5, 15); vertex(-30, 0, 0); vertex(-30, 5, -15); vertex(-30, -10, -15); vertex(-30, -5, -5); vertex(-30, -10, 15); endShape(); //wing holders translate (-5, -5, 0); box(5, 10, 5); translate (10, 0, 0); box(5, 10, 5); translate (-5, -10, 0); translate (0, 0, 18); beginShape (POLYGON); vertex(-15, 5, -10); vertex(-15, 5, 15); vertex(-30, 5, 25); vertex(-35, 5, 25); vertex(-35, 5, 80); vertex(-30, 5, 80); vertex(-30, 5, 100); vertex(30, 5, 100); vertex(30, 5, 80); vertex(35, 5, 80); vertex(35, 5, 25); vertex(30, 5, 25); vertex(15, 5, 15); vertex(15, 5, -10); //vertex(0, 5, -30); endShape(); fill(255, 255, 255); beginShape(POLYGON); vertex(0, 5, -30); vertex(15, 5, -10); vertex(10, 0, -10); endShape(); beginShape(POLYGON); vertex(0, 5, -30); vertex(-15, 5, -10); vertex(-10, 0, -10); endShape(); beginShape(POLYGON); vertex(10, 0, -10); vertex(-10, 0, -10); vertex(0, 5, -30); endShape(); beginShape(POLYGON); vertex(10, 0, 25); vertex(15, 5, 25); vertex(15, 5, -10); vertex(10, 0, -10); endShape(); beginShape(POLYGON); vertex(-10, 0, 25); vertex(-15, 5, 25); vertex(-15, 5, -10); vertex(-10, 0, -10); endShape(); beginShape(POLYGON); vertex(-15, 5, 25); vertex(-15, 5, -10); vertex(15, 5, -10); vertex(15, 5, 25); endShape(); beginShape(POLYGON); vertex(-10, 0, 25); vertex(-10, 0, -10); vertex(10, 0, -10); vertex(10, 0, 25); endShape(); fill (255); translate (0, 10, 52.5); box (70, 20, 55); translate (0, 0, 32.5); box (60, 20, 30); x = x + 0.01; }