Hi, I have this function which draws each number around the clock, but somehow it only draws “12” and not the rest. Is there anything wrong with my code?
this is the drawing function:
void drawText(const char * message,float x,float y)
{ /* Written by John McCormack
/* raster pos sets the current raster position
* mapped via the modelview and projection matrices
*/
glRasterPos2f(x, y);
/*
* write using bitmap and stroke chars
*/
while (*message) {
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *message);
glutStrokeCharacter(GLUT_STROKE_ROMAN,*message++);
}
}
this is the drawing number function:
void draw_number(void)
{
int i;
glLoadIdentity();
for(i=0;i<=12;i++)
{
if(i==0){ drawText("12",-0.09,0.78);}
if(i==1){ glRotatef(30,0,0,-1);drawText("1",-0.09,0.78);}
if(i==2){ glRotatef(30,0,0,-1);drawText("2",-0.09,0.78);}
if(i==3){glRotatef(30,0,0,-1); drawText("3",-0.09,0.78);}
if(i==4){ glRotatef(30,0,0,-1);drawText("4",-0.09,0.78);}
if(i==5){ glRotatef(30,0,0,-1);drawText("5",-0.09,0.78);}
if(i==6){glRotatef(30,0,0,-1); drawText("6",-0.09,0.78);}
if(i==7){ glRotatef(30,0,0,-1);drawText("7",-0.09,0.78);}
if(i==8){ glRotatef(30,0,0,-1);drawText("8",-0.09,0.78);}
if(i==9){glRotatef(30,0,0,-1); drawText("9",-0.09,0.78);}
if(i==10){ glRotatef(30,0,0,-1);drawText("10",-0.09,0.78);}
if(i==11){ glRotatef(30,0,0,-1);drawText("11",-0.09,0.78);}
}
}