Hi,
I want to render the object continuously.
For example, after every 10 sec, the new object will be appear. But how i can get the every 10 sec?..
Here the logic idea of my code.
for (int p=2; p<7; p++)
{
if (timer.GetTime()/1000 > 0 && timer.GetTime()/1000 < 10 )
{
draw( object[i].model_id, object[i].trans, shadowsNo );
}
if (timer.GetTime()/1000 > 10 ||timer.GetTime()/1000 >= 20||timer.GetTime()/1000 >= 30 )
{
shadowsNo=pow(2.0,p);
draw( object[i].model_id, object[i].trans,shadowsNo );
}
}
so, how i want to know the current time is already 10 sec, more than 10 second. Any idea how i can retrive the value.
i also print the current time …
//Print time
static char timeString[32];
float t= timer.GetTime()/1000;
sprintf_s(timeString," Time %.2f",t);
glColor3f( 0.0, 0.0, 0.0 );
x = -0.5;
y = -0.98;
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( x, y, 0.0 );
/* draw red text on the polygon */
glColor3f(0.75, 0.0, 0.0);
glRasterPos2i(0.0, 0.0);
for (int i=0; i<(int)strlen(timeString); i++) {
if(timeString[i] != ’
’ ) {
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, timeString[i]);
}
else {
glTranslatef(0.0, -0.07, 0.0);
glRasterPos2i(0.0, 0.0);
}
}
Anybody can help me?