Reverse loop animation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Noiecity
Posts: 315
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Reverse loop animation

Post by Noiecity »

Irrlicht allows me to activate the animation loop correctly, but what if my model would like to repeat the loop first forward, then backward? Example in frames:
1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 6 -> 5 ->4 ->3 ->2 ->1->2->3... etc
What solution would I have? I mean, I'm finishing building the models that I plan to upload to the forum, I will upload them in md2 format, but this question arose when it comes to animate them, in terms of size is more advantageous to make irrlicht reverse the loop at the end of the animation ... or else I would have to create it inverted from the model and increase the size of the model itself.

Image

It would be great if md2 type animations could have an overloaded value of true or false for loop reverse animation, it would be useful for many animations, and for others it would not.
Like "node->setMD2Animation(scene::EMAT_STAND, TRUE);"
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, for free. CC0 man.

Image
**
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Reverse loop animation

Post by CuteAlien »

You could add more animation frames and second part has the reverse.
Otherwise you probably have to do your own loop - so play once - wait for end - play reverse - wait for end - repeat.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Noiecity
Posts: 315
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Reverse loop animation

Post by Noiecity »

CuteAlien wrote: Sun Jun 01, 2025 9:53 pm You could add more animation frames and second part has the reverse.
Otherwise you probably have to do your own loop - so play once - wait for end - play reverse - wait for end - repeat.
Yes, the first is a viable option, it was the option I was going to choose if there was no separate solution, there is a program I have called QME, it allows me to separate the frames and name them in a .md2 file.... quite useful since irrlicht literally has support for internal animation names in md2 format.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, for free. CC0 man.

Image
**
Post Reply