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.
IndexSuggestions & BugsSoftware Bugs › polygon rendering bug
Page Index Toggle Pages: 1
polygon rendering bug? (Read 2743 times)
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;
}

Re: polygon rendering bug?
Reply #1 - Apr 22nd, 2005, 12:22pm
 
here is more info.

the revision number: 0085)
MacOSX 10.3 Powerbook G4 17inch.
the same issue happens on windows boxes too.
I don't see any kind of error message on the debug frame.
the same issue happens in P3D mode as well as in OPENGL mode.
i noticed this problem while i was coding a .obj file loader library.
i checked the FAQ, but couldn't find anything related to this issue.
am I missing something??

Re: polygon rendering bug?
Reply #2 - Apr 28th, 2005, 3:15am
 
just got a chance to confirm this.. looks like a bug. i'm guessing it's something to do with the clipping math, we'll look into it.
Re: polygon rendering bug?
Reply #3 - Apr 30th, 2005, 8:43pm
 

just follow-up:

if i change 'beginShape(POLYGON)' to 'beginShape(TRIANGLES)', it shows both of the polygons.

i am guessing drawing in POLYGON mode has the plane clipping bug..

Re: polygon rendering bug?
Reply #4 - May 1st, 2005, 7:48am
 
ah, that's helpful.. that means it's a problem in triangulation, not in just the clipping..
Re: polygon rendering bug?
Reply #5 - May 2nd, 2005, 3:48am
 
yea.. i was just thinking that triangulate_polygon() in PGraphics3 smells.

anyways, thanks for the repsonce.
Re: polygon rendering bug?
Reply #6 - May 2nd, 2005, 3:58am
 
well, deodorizing contributed fixes are welcomed with open arms.
Re: polygon rendering bug?
Reply #7 - Jul 28th, 2005, 2:55pm
 
now tracking as bug 111:
http://dev.processing.org/bugs/show_bug.cgi?id=111
Page Index Toggle Pages: 1