# openGL-Draw Circle??

This topic is 4038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

openGL - I try to code the effect that when I click mouse, it create 3 circle, which the center of 3 circles is the position of mouse click. But I code it, it draw 3 circle but it has a line run through 3 circle. But I draw just 1 circle then there is no line run through. I dont understand how is it this happen? Help please here is the picture http://img.photobucket.com/albums/v59/Rinoaheartilly/battleship.gif Here is how I draw the 3 circle the u[][] tell me how to shift the circle


glBegin(GL_LINE_LOOP);
int i;
glColor3f(1.0, 0.5, 0.7);
for(i=0; i<360; i++){
glVertex2f(circle1[0] + u[circleVisited[row][col]][0] + 0.2,
circle1[1] + u[circleVisited[row][col]][1] + 0.2);
}
//glColor3f(0.0, 0.9, 0.3);
//for(i=0; i<360; i++){
//	glVertex2f(circle2[0] + u[circleVisited[row][col]][0] + 0.2,
//	circle2[1] + u[circleVisited[row][col]][1] + 0.2);
//}
glColor3f(1.0, 0.5, 0.0);
for(i=0; i<360; i++){
glVertex2f(circle3[0] + u[circleVisited[row][col]][0] + 0.2,
circle3[1] + u[circleVisited[row][col]][1] + 0.2);
}
glEnd();


void drawCircle1(){
int i;
for(i=0; i<360; i++){
float deg = i*DEG2RAD;
}
}

[Edited by - KingdomHeart on October 28, 2007 6:29:59 PM]

##### Share on other sites
I may be slightly wrong only just picking up OpenGL but if I understand correctly when using GL_LINE_LOOP the first point and last point will be connected together. See if drawing each circle separately (as in 3 glBegin() glEnd()) will solve the problem.

##### Share on other sites
Thank you so much. that fixed it.

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5

• 16
• 18
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633360
• Total Posts
3011524
• ### Who's Online (See full list)

There are no registered users currently online

×