int sum = 10;
const float coef = 2.0f *(float)M_PI/sum;
CCPoint *vertices = newCCPoint[sum];
//底部圆
for(unsigned int i = 0;i <sum; i++)
{
float rads =i*coef;
GLfloat j =2.0 * cosf(rads) + point.x;
GLfloat k =2.0 * sinf(rads) + point.y;
vertices[i].x=j;
vertices[i].y=k;
}
ccDrawColor4F(0/255.0,51/255.0, 154/255.0, 0.5);
cc DrawPoly( vertices,sum,true);
//上面的小圆
for(unsigned int i = 0;i <sum; i++) {
float rads =i*coef;
GLfloat j =1.5 * cosf(rads) +point.x;
GLfloat k =1.5 * sinf(rads) +point.y;
vertices[i].x=j;
vertices[i].y=k;
}
//ccDrawColor4F(109/255.0,255/255.0, 250/255.0, 1.0);
ccDrawSolidPoly( vertices,sum,ccc4FFromccc4B(ccc4(109, 255, 250, 220)));
delete []vertices;
vertices = NULL;