Hey,
I've recently drawn a simple circle in OpenGL, but I have some questions about it...
Since it uses vertexes (vecteurs...), I've made the last position - new position in the x and y coordinates.
Though once I'm coloring it, it is coloring not from the center, but the bottom, I don't understand this, isn't it supposed to show it from the center of the circle?
Here's a picture:
And here's the code:
glBegin(GL_POLYGON);
static float lstx = 1.0f, lsty = 0.0f;
for (int i = 1; i <= 360; i++) {
float xx = 10 * PI * cos(i * PI / 180);
float yy = 10 * PI * sin(i * PI / 180);
glVertex2f(lstx - xx, lsty - yy);
glColor3f((rand() % 99) / 10.0f, (rand() % 99) / 10.0f, (rand() % 99) / 10.0f);
lstx = xx;
lsty = yy;
}
glEnd();
And another question, why does the circle gets bended on the left side when I remove the static prefix from lstx and lsty?
Thanks in advance.