PDA

View Full Version : Rotate camera without the idle function



gottijay
08-03-2011, 01:05 PM
Noob question.....can anyone please tell me how to do this without the idle function...

void idle(){
rY += 0.05;
}

glutidlefunction(idle);

i want to be able to rotate the camera continously while the display function is running but without the idle function.


thank you

gottijay
08-03-2011, 01:21 PM
sorry fixed it...

Ehsan_Liverpool
08-04-2011, 03:37 AM
how did you do fix it?

gottijay
08-04-2011, 06:28 AM
void timer(int v) {
if (animate) {
rY2 += 0.05;
if (rY2 > 360.0) {
rY2 -= 360.0;
}
glutPostRedisplay();
}
glutTimerFunc(1000/FPS, timer, v);
}


then in your main instead of glutIdleFunction(idle)

just put glutTimerFunc(100, timer, 0);

declare FPS and set as 60 or anything you want....hope it helps