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
   Software Bugs
(Moderator: fry)
   more of a 'feature' than a bug (ellipse -y)
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: more of a 'feature' than a bug (ellipse -y)  (Read 440 times)
alexic

Email
more of a 'feature' than a bug (ellipse -y)
« on: Jan 29th, 2005, 9:57am »

using an ellipse with an inverse radius and an offset will give you a decent n-gon, much easier than doing it mathematically. it might be a bug, but i'm not that adept to know where it comes from, and it would be a decent cheat if you could use the same code to produce the effect 'legally'.  
 
quote:
 
// oddity: n-gons with negative ellipse radius //
 
int dim = 600;
int r=200;
int xpos=dim/2;
int ypos=dim/2;
 
void setup() {
size(dim,dim);
ellipseMode(CENTER_RADIUS);  
}
 
void draw() {
 
background(0);
color bg = color(33, 66, 66, 66);
fill(bg);
noStroke();
translate(xpos,ypos);
 
ellipse(0, 0, r, -r +0.0); // 4-gon
ellipse(0, 0, r, -r +0.3); // 5-gon
ellipse(0, 0, r, -r +0.5); // 6-gon      
ellipse(0, 0, r, -r +1.0); // 7-gon  
ellipse(0, 0, r, -r +2.0); // 8-gon etc.
 
}
 
:endquote
 
Pages: 1 

« Previous topic | Next topic »