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 › smooth() circle (noob)
Page Index Toggle Pages: 1
smooth() circle (noob) (Read 5014 times)
smooth() circle (noob)
Jun 17th, 2010, 2:41am
 
Hi,
I'm trying to have a smooth drawing of a circle. For now I'm not using OPENGL but just the smooth() function.

I find the quality of drawing extremely disappointing, but I'm shure it is because of the implementation, just adding OPENGL doesn't change anything

Can anyone advice me on how to get stuff really smooth, I've looked in the discourse, but the related topics are mostly old ones.

here is a small sketch with what I'm doing(really a sketch!):

// import processing.opengl.*;


float a;
float b;
float x;
float y;
float d;
float angle;
boolean onCircle=false;
color c;
float[] center= new  float[2];

void setup(){
 smooth();
 size(400,400);
//size(400,400,OPENGL);
 background(0);
 frameRate(100);
 a=random(width);
 b=random(height);
 d=60;
 angle=0;
 c=color(200,200,255,255);
 center[0]=width/2;
 center[1]=height/2;
 println("centerPoint: "+center[0]+"_"+center[1]);


}

void draw(){
 noStroke();
 fill(0,0,0,10);
 rect(0,0,width,height);
 ellipseMode(CENTER);
 noFill();
 stroke(c);
 //strokeWeight(1);
 ellipse(a,b,d,d);
 x=a+cos(radians(angle))*d/2;
 y=b+sin(radians(angle))*d/2;
 line(a,b,x,y);
 stroke(128);
 line(a,b,center[0],center[1]);
 noStroke();
 fill(c);
 ellipse(x,y,5,5);


 angle+=1;

}

void mouseInteraction(){

}

void mousePressed(){
 if(onCircle){

 }
}

thx

Pieter
Page Index Toggle Pages: 1