Camera Flickering when rotating alot?
Posted: Wed May 09, 2007 3:23 pm
Hi guys,
I'm rotating the camera around my object but the screen keeps flickering a bit, it's hard to describe but it's like it is trying to refresh too often..
I have tried slowing it down aswell as limiting the number of positions on the rotation but it still happens.
here's the code:
Any help would be greatly appreciated
Nomis.
I'm rotating the camera around my object but the screen keeps flickering a bit, it's hard to describe but it's like it is trying to refresh too often..
I have tried slowing it down aswell as limiting the number of positions on the rotation but it still happens.
here's the code:
Code: Select all
// get vectors
core::vector3df cp = camera->getPosition();
core::vector3df cr = camera->getRotation();
core::vector3df bp = bananaNode->getPosition();
core::vector3df br = bananaNode->getRotation();
// THEN ROTATE AROUND THE BANANA RISING UP.
if (loopme <= 95)
{
time_now = (double)clock()/(double)CLOCKS_PER_SEC;
if (time_now - time_last > 0.025)
{
cp.X = (bp.X + cos(loopme/10)*75);
cp.Z = (bp.Z + sin(loopme/10)*75);
camera->setPosition(cp);
camera->setTarget(bp);
printf("CAMSWIVEL: %d x %lf z %lf\n", loopme, cp.X, cp.Z);
time_last = (double)clock()/(double)CLOCKS_PER_SEC;
loopme++;
}
}
Nomis.