FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   issue drawing concave polygons?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: issue drawing concave polygons?  (Read 617 times)
linefeed


issue drawing concave polygons?
« on: Aug 18th, 2003, 2:30pm »

i am tracking this issue since build 0055, but probably it existed already in previous builds. just downloaded 0058 and it persists, so i guess this is the right place to post about it. im using it on macosx 1.2.6, if it turns out to be platform dependent.
 
i tried to create a simple little mouse follower/rotator and ran into an issue. the shape should just move around, scale and rotate, but with fill on and stroke off it also changes shape (near the 'handles') depending on the rotation. this doesnt happen when fill is off and stroke is on. if both stroke and fill are on, it gets weirder still - the stroke is scaled a few times too big, not overlappitng the fill at all. the 'workaround' shape, which uses a rect and two triangles to draw the same thing, works without this problem.
 
hopefully its not too impossible to track down, the source begins here so you can hopefully reproduce it too:
 
// a flying bag
// (c) LF <luka@ljudmila.org>
// Move the mouse...
 
void setup()
{
  size(480, 360);
  background(255,15,15);
  colorMode(RGB, 255, 255, 255, 100);
  stroke(0,0,240);
  //noStroke();
  fill(240);
  //noFill();
  rectMode(CORNER);
  smooth();
}
 
void shape()
{
  // Drawing this way exposes the bug
  beginShape(POLYGON);
  vertex(-50, -50);
  vertex(-35, -15);
  vertex(30, -15);
  vertex(50, -50);
  vertex(50, 50);
  vertex(-50, 50);
  vertex(-50, -50);
  endShape();
}
 
void shape_workaround() {
  // This works around the bug
  rect(-50,-15,100,65);
  triangle(-50,-14,-50,-50,-35,-14);
  triangle(30,-14,50,-50,50,-14);
}
 
void loop()
{
  translate(mouseX,mouseY);
  rotateZ(mouseX/50.0+millis()/(PI*500.0));
  scale(mouseY/100.0);
 
  shape();
  //shape_workaround();
}
 
arielm

WWW
Re: issue drawing concave polygons?
« Reply #1 on: Aug 18th, 2003, 3:05pm »

i think it's a known proce55ing bug that concave polygons don't draw properly!
 

Ariel Malka | www.chronotext.org
fry


WWW
Re: issue drawing concave polygons?
« Reply #2 on: Jun 11th, 2004, 7:08pm »

not any more.. just ran across this doing some spring cleaning on the bugs section..
 
Pages: 1 

« Previous topic | Next topic »