raylib icon indicating copy to clipboard operation
raylib copied to clipboard

[rmodels] `LoadModelAnimationsGLTF()` computes poses interpolating between the anim duration and fixed 60 fps (`GLTF_ANIMDELAY`)

Open raysan5 opened this issue 1 year ago • 4 comments

It does not consider scenarios where animation is created at 24 fps or game does not run at 60 fps.

Model can already contain a fixed number of poses (keyframes) with a defined frame delay between each one (and also a expected interpolation between keyframes). That information is not considered at the moment.

raysan5 avatar Oct 24 '24 09:10 raysan5

Related to this feature, a future improvement could be using float values for frame request to get interpolated poses between key-frame poses:

void UpdateModelAnimation(Model model, ModelAnimation anim, float frame);

frame could be a value between 0.0f and 1.0f to get interpolation.

raysan5 avatar Nov 03 '24 13:11 raysan5

Hi @raysan5, I've implemented a simple function to blend between two animations and an example using GPU skinning. https://github.com/Kirandeep-Singh-Khehra/raylib/commit/8808a3958a705120bea516cf8d50155e5b9d8725

It helped me for smooth transitioning/interpolation between two animations(For ex: smoothly moves from walking to running) and blending(For ex: blending between move forward animation and move rightwards animation by a given factor to have all intermediate movement animation). I was planning to raise a PR for it. But you might be trying to add void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); with frame as float instead of int.

Could you please share if usingfloat for frame is finalized or not. I would like to contribute on animation part.

Edit: Raised a PR here https://github.com/raysan5/raylib/pull/4578

Kirandeep-Singh-Khehra avatar Dec 04 '24 17:12 Kirandeep-Singh-Khehra

Hi @raysan5, I've implemented a simple function to blend between two animations and an example using GPU skinning. Kirandeep-Singh-Khehra@8808a39

It helped me for smooth transitioning/interpolation between two animations(For ex: smoothly moves from walking to running) and blending(For ex: blending between move forward animation and move rightwards animation by a given factor to have all intermediate movement animation). I was planning to raise a PR for it. But you might be trying to add void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); with frame as float instead of int.

Could you please share if usingfloat for frame is finalized or not. I would like to contribute on animation part.

Edit: Raised a PR here #4578

so is this done because in the PR it states that it needs still approval?

CodingMadness avatar Jan 05 '25 04:01 CodingMadness

Hi @CodingMadness, There are discussions going on for animation system. So, all new additions to animation are halted by maintainers.

This is the discussion page https://github.com/raysan5/raylib/discussions/4606

Kirandeep-Singh-Khehra avatar Jan 05 '25 07:01 Kirandeep-Singh-Khehra