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 & HelpOpenGL and 3D Libraries › P3D/OPENGL crappity smacks up my torus.
Page Index Toggle Pages: 1
P3D/OPENGL crappity smacks up my torus. (Read 502 times)
P3D/OPENGL crappity smacks up my torus.
Sep 11th, 2006, 1:17pm
 
I drew a torus with bezierVertexes, but if I start the sketch with P3D/OPENGL the filling of it gets crapped. Anybody help the newbs?

----------->

import processing.opengl.*;

void setup()
{
 size(400, 400, OPENGL);
 framerate(13);
 colorMode(RGB, 100);
 fill(0);
}

void draw()
{
 background(100);
 stroke(0);
 
 pushMatrix();
 translate(width/2, height/2);
 scale(2);
 
 beginShape();
 vertex(-50, 0);
 bezierVertex(-50, -27, -27, -50, 0, -50);
 bezierVertex(27, -50, 50, -27, 50, 0);
 vertex(25, 0);
 bezierVertex(25, -13, 13, -25, 0, -25);
 bezierVertex(-13, -25, -25, -13, -25, 0);
 vertex(-50, 0);
 endShape();
 
 rotate(PI);
 beginShape();
 vertex(-50, 0);
 bezierVertex(-50, -27, -27, -50, 0, -50);
 bezierVertex(27, -50, 50, -27, 50, 0);
 vertex(25, 0);
 bezierVertex(25, -13, 13, -25, 0, -25);
 bezierVertex(-13, -25, -25, -13, -25, 0);
 vertex(-50, 0);
 endShape();
 
 popMatrix();
}
Page Index Toggle Pages: 1