|
Author |
Topic: a smooth and filled worm quest (Read 862 times) |
|
lunetta
|
a smooth and filled worm quest
« on: Mar 26th, 2005, 5:50pm » |
|
hello all I'm working in some wiggle patterns, but I'm facing fill and smooth issues; If anyone want to take a look, paste this, it's just 5 seconds: Quote: int i,j,k,l; void setup() { size(500,500); background(255); smooth(); strokeWeight(1); } void draw() { stroke(0); fill(0); beginShape(POLYGON); for(i =0; i<11; i++) { j = (i%2)*50 + 200; curveVertex(50*i,j); } vertex(50*(i-2),240); for(k = (i-1); k>-1; k--) { int l = (k%2)*50 + 190; curveVertex(50*k, l); } endShape(); } |
| So, my questions are 1) Is there a trick to make the polygon fill work in a shape like this? I have tried different point orders, but no success so far... 2) Is there a way to make this look smooth? the smooth() command is really not working in this case... is there any easy implementation or trick for a antialiased visual? well, thanks for any ideas...
|
|
|
|
bsr
|
Re: a smooth and filled worm quest
« Reply #1 on: Mar 26th, 2005, 6:37pm » |
|
can't help but here's a pretty accident courtesy of the strokeWeight command: Code: int i,j,k,l,sw; void setup() { size(500,500); background(255); smooth(); } void loop() { background(255); sw++; stroke(0,25); beginShape(POLYGON); for(i =0; i<11; i++) { j = (i%2)*50 + 200; curveVertex(50*i,j); } vertex(50*(i-2),240); for(k = (i-1); k>-1; k--) { int l = (k%2)*50 + 190; curveVertex(50*k, l); } endShape(); strokeWeight(sw); } |
|
|
http://hippocamp.net
|
|
|
lunetta
|
Re: a smooth and filled worm quest
« Reply #2 on: Mar 26th, 2005, 10:28pm » |
|
|
|
|
|
|