void drawElipse( int points, Vec2d center,float strechx, float strechy){
Vec2d cp; //circle points as vector
Vec2d pointlist[points];
for (int i = 0; i<points; i++){
float angle = ((2*PI)/points)*i; //2*pi is 360 divided into degree segments based on points multiplied by what point your on
cp.x= cos(angle) * strechx; //gets the length of x and muiltiplies by stretch
cp.y= sin(angle) * strechy; //gets the length of y and muiltiplies by stretch
cp = cp+center; //sets the offset center point operator overload
//cp.print();//debug
drawCircle(10, 30, cp);
//cp.x += 300; //adds in the of set
//cp.y += 300; //adds in the of set
//glVertex2f(cp.x,cp.y);
}
}
void drawCircle(float radius, int points, Vec2d center){
Vec2d cp; //circle points as vector
glBegin(GL_TRIANGLE_FAN);
for (int i = 0; i<points; i++){
float angle = ((2*PI)/points)*i; //2*pi is 360 divided into degree segments based on points multiplied by what point your on
cp.x= cos(angle) * radius; //gets the length of x and muiltiplies by stretch
cp.y= sin(angle) * radius; //gets the length of y and muiltiplies by stretch
cp = cp+center; //sets the offset center point
//cp.x += 300; //adds in the of set
//cp.y += 300; //adds in the of set
glColor3f( (mouseX/windowW),(mouseY/windowH),0.0f);
printf( "%f \n", mouseX );
glVertex2f(cp.x,cp.y);
}
glEnd( );
}