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 & HelpSyntax Questions › trouble with curveVertex shapes
Page Index Toggle Pages: 1
trouble with curveVertex shapes (Read 336 times)
trouble with curveVertex shapes
Dec 13th, 2008, 4:25pm
 
Somehow I just can't seemed to get this right. I'm drawing a simple shape using curveVertex, which vaguely resembles a rounded rectangle (not trying to create a perfect rounded rectangle). But no matter what kind of shape I try, the last line the curveVertex function draws is always in a straigt line instead of a nice curved line. Does anyone know why this is?

Here is a simple curveVertex shape. As you can see, the last line (which is drawn on the top left). Is a perfect straight.

 beginShape();
 curveVertex(100,  200);
 curveVertex(100,  100);
 curveVertex(200,  100);
 curveVertex(200,  200);
 curveVertex(100,  200);
 curveVertex(90,   120);
 curveVertex(100,  100);
 endShape();
Re: trouble with curveVertex shapes
Reply #1 - Dec 13th, 2008, 5:33pm
 
If you draw with default settings, like:
Code:
void setup()
{
size(300, 300);
smooth();
noLoop();
beginShape();
curveVertex(100, 200);
curveVertex(100, 100);
curveVertex(200, 100);
curveVertex(200, 200);
curveVertex(100, 200);
curveVertex(90, 120);
curveVertex(100, 100);
endShape();
}

you would see immediately the issue: you didn't closed the shape. You can do that with endShape(CLOSE); but obviously it is still a straight line.
I am not too sure how to finish it properly, I prefer to use bezierVertex over curveVertex... Smiley

I show Re: Simple form tweening how to make a rounded rectangle.
Page Index Toggle Pages: 1