PDA

View Full Version : delay time in Glut commands



Scorpio
04-18-2011, 03:01 PM
Hi ,
I am using glut commands for creating different objects.
and I want them to have a delays for next object to be created.
what is happening is all objects display together. , But my requirement is to have a time delay for next object.


glPushMatrix();
glScalef( 0.1,0.1,0.1 );
glutSolidSphere(5,10,10);
glPopMatrix();


glPushMatrix();
glScalef( 0.1,0.1,0.1 );
glutSolidSphere(10,10,10);
glPopMatrix();

McLeary
04-18-2011, 03:16 PM
You gonna need to manager in what time each object should appear. AFAIK there is no command to do want you want.

In your rendering loop, when the time reach a specific amount you draw the first object. On the next iteration timer counter will not reach the second mark and the second object will not appear. When your timer reach on the second mark, you draw the second object and so on.

You need to keep in mind that you cannot have blocking calls like the one you want and still have the display updated.

Scorpio
04-20-2011, 04:29 AM
Can anyone post some example for understanding the timer concept.. So that objects should appear in the scene with some time gap.

ZbuffeR
04-20-2011, 04:31 AM
Search for "timer" here : http://www.opengl.org/resources/faq/technical/glut.htm