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 & HelpOpenGL and 3D Libraries › fill() between two ellipses()
Page Index Toggle Pages: 1
fill() between two ellipses() (Read 610 times)
fill() between two ellipses()
Mar 20th, 2009, 12:44pm
 
Simple question (I think):

is it possible to create a 'surface' (so to use fill()) between two ellipses?

And if not: what would be a good way to create surfaces between two ellipses? By 'cutting' the ellipses in several line-elements and create rectangles between the corresponding elements of the two lines?

Script would be like this I think:
Code:

/*
- The coordinates of all ellipses are already known and in another array, lets say ellipses[]
- Each ellipse in ellipses[] will be cut into a number of elements, which is variable 'curveElements'
*/

pushStyle();
fill(180);
for (int e=1; e<ellipses.size(); e++){
for (int t=1; t<(curveElements+1); t++){

beginShape();
vertex( xElement[e][t], yElement[e][t], zElement[e][t] );
vertex( xElement[e][t-1], yElement[e][t-1], zElement[e][t-1] );
vertex( xElement[e-1][t-1], yElement[e-1][t-1], zElement[e-1][t-1] );
vertex( xElement[e-1][t], yElement[e-1][t], zElement[e-1][t-1] );
endShape(CLOSE);

}
}
popStyle();

Page Index Toggle Pages: 1