Menu

#5 gdn_Animation Class

DirectX
open
5
2001-09-13
2001-09-13
No

I have had several problems when using the
gdn_Animation class, It's possible that most or all of
them is due to my improper use (maybe?):

When defining an animation from file (*.ANM) - the
animation doesn't seem to be updating based on time
settings and frame definitions correctly.

The attached files are the (*.ANM) and (*.BMP) file
used for my testing purposes. Please verify that I am
or am not defining the animation file correctly.

** NOTE **
I've tried Both Animation types (NORMAL/REPEAT) with
similar results.

Discussion

  • J.W. Heikkila, Jr.

    Animation Files for Logo Animation Test

     
  • Andrew Craig

    Andrew Craig - 2001-09-13
    • milestone: --> DirectX
    • assigned_to: nobody --> acraig
     
  • Andrew Craig

    Andrew Craig - 2001-09-13

    Logged In: YES
    user_id=82367

    I've tried your .anm file and .bmp and it appears to work
    ok. They animation file is correct.

    The problem maybe when you draw the animation. You need to
    pass in the time from the last time the animation was
    updated.

    gdn_Timer clock;
    while ( window->Pump() == OK )
    {
    oldTime = clock.GetTime();
    Animation.Draw(delta, 100,100);
    manager->Flip();
    delta = clock.GetTime() - oldTime;
    }

     
  • J.W. Heikkila, Jr.

    Logged In: YES
    user_id=152715

    Ok, but your explanation doesn't make sense. I think the
    animation class should keep track of the last time it was
    told to draw. Not the outside program (ie: your while loop
    example).

    I'm sure you have a reason, but why are you requiring the
    outside program to keep track of the time?

    Regards,
    Jumpster

     
  • Andrew Craig

    Andrew Craig - 2001-09-15

    Logged In: YES
    user_id=82367

    Right now the gdn_Animation stores how long it's been at
    the current frame. When you call Draw(delta,...) it adds
    that delta to the elapsed time and if it is greater then
    the step time it moves onto the next frame.

    A better option may be to add a gdn_Timer to the
    gdn_Animation class so that all of the animation timing is
    handled internally. I'll make that a feature request.

     

Log in to post a comment.

MongoDB Logo MongoDB