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 › Filling a trapezoid
Page Index Toggle Pages: 1
Filling a trapezoid? (Read 686 times)
Filling a trapezoid?
Nov 30th, 2009, 2:40pm
 
Hey guys, newbie here. I just have a quick question for a problem that is driving me insane, I can't seem to find the information anywhere!

I have a drawing. It is essentially an upside down trapezium (trapezoid). It is made up of lines. I want to fill the inside with a colour. How can I do this?

line(460,145,430,20);
line(430,20,580,20);
line(550,145,580,20);
line(460,145,550,145);

Am I going about making this shape the wrong way? I've searched the site (including forum) for the answer but no joy Sad

thanks in advance.
Re: Filling a trapezoid?
Reply #1 - Nov 30th, 2009, 2:45pm
 
http://processing.org/reference/quad_.html
Re: Filling a trapezoid?
Reply #2 - Nov 30th, 2009, 2:47pm
 
> Am I going about making this shape the wrong way?

yes, pretty much 8) you're drawing 4 lines but it has no way of knowing they are a shape.

try fill() and quad() with your 4 corner positions.

(too slow!)

Re: Filling a trapezoid?
Reply #3 - Nov 30th, 2009, 4:48pm
 
Ah thanks a lot! I guess I didn't look hard enough Undecided
Page Index Toggle Pages: 1