How can I render consistent and smooth moving animation on iPhone / iPod / iPhone simulator?

0 votes
asked Apr 7, 2010 by shakthi

I am trying render a simple animation (object movement animation) on iPhone. I used OpenGL for object rendering. Movements appear to be smooth on the simulator. But if I use the same code on the iPod, the object movement is slower. In the iPhone, it is still slower.

I googled a bit and found 'frame rate independent rendering method', which taught me the concept of 'time interval' and object movement based on it. However, the result is very unpleasant. There is a lot of jerk in the animation even when the FPS remains above 20.


The following code fragment is used for calculation of the time interval between successive frames and I am using that to move my animation.

NSTimeInterval  GetTimeIntervals(NSTimeInterval * inLastElapsedTime )
{
    NSTimeInterval intervalTime = 0;

    NSTimeInterval currentTime = [NSDate timeIntervalSinceReferenceDate];

    if(*inLastElapsedTime != 0 )
    {
        intervalTime =  currentTime - *inLastElapsedTime;
    }

    *inLastElapsedTime = currentTime;

    return intervalTime;
}

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...