Animating nodes objects

hi guys :slight_smile:

i am traying to make animation movement in opengl by making frames list each animation just like this

A- animation contains number of channels
B- channels contains 3dNode and number of keyFrames ;
C- keyFrames contains transform(location,rotation,scale) and Frame State (in which frame exactly)
D- each frame will be between two keyframe means it’s contains Right Keyframe and Left KeyFrame

but i need your recommendation how to play animation in the games. i have two way to do it

1 - Create Transform Per Frame
by getting frame Avrage Between the two Keyframes. playing animation means the node will get the transform From The current Frame

2- calculate Transform Per Frame
just like #1. but the deffrent is: playing Animation means the node will calculate the Avrage in the real time

booth are working but #1 is more memory size and less processing and #2 is less Memory Size and More processing

so when i need to play Animation in Games which one will be better??

thank you :smiley:

Is this for skeletal animation? I’ll answer presuming it is. #2. You typically wouldn’t do #1. It takes a lot of space – much more than you need to reconstruct joint transforms for typical animated characters on-the-fly quickly with reasonable accuracy. Also, #1 predetermines your frame rate, which is undesirable. Re your comment on averaging transforms, I’d highly recommend reading up on dual quaternions. Also the Animation section of Jason Gregory’s Game Engine Architecture is a great primer for this (though it predates common use of dual quats in skeletal animation).

yes i’ll use it for skeleton also for animating my 3d objects (car,air plane,…)wich moves static movement. so #2 will be better in gaming. thank you so much for helping :slight_smile: