In the g3d format animation isn't handled frame by frame, but by effective time. You are counting keyframes, that is the moments in time where the movement change in direction (or orientation or size), that's not what you want. But you can get the animation length in the last keyframe (keytime field, given in ms), and multiply it by your fps to convert this in frames.
In the g3d format animation isn't handled frame by frame, but by effective time. You are counting keyframes, that is the moments in time where the movement change in direction (or orientation or size), that's not what you want. But you can get the animation length in the last keyframe (keytime field, given in ms), and multiply it by your fps to convert this in frames.
For example I have this from the anim json file: ANIMATION FRAMES 32 ANIMATION TIME 1033 How would I go to get the number of ticks needed to complete a whole animation?
Knowing that the animation was exported at 30fps (I believe) from mixamo and the app is configured to run at 30fps.
What is the math please ? NUMBER OF TICKS = ANIMATION TIME / ANIMATION FRAMES NUMBER OF TICKS = ANIMATION TIME / 30 (FPS)
The problem is I never get a full loop (either too long or to short)
--for i = 1, self.totalframes do -- /1.3 magik? XXXfor i =1, self.totaltime/30do-- /1.3 magik? XXX
D3Anim.tick()
self.imgid +=1end
SOLUTION: I wasn't getting the correct length of the animation. Each bone can have different animation length. So make sure you pick the longest keytime.
Wow, nice work Paul! Feel free to improve the 3DLib, it will benefit to everyone. The highlight can be changed (specular value) in the shader, all we need is to make it configurable from lua, through a shader constant.
I am trying to get rid of (or at least lower down) the highlight too but I cannot find any specular value in the shaders code. Can somebody tell me where I can change its value please ?
Comments
Likes: MoKaLux
ANIMATION FRAMES 32
ANIMATION TIME 1033
How would I go to get the number of ticks needed to complete a whole animation?
Knowing that the animation was exported at 30fps (I believe) from mixamo and the app is configured to run at 30fps.
What is the math please
NUMBER OF TICKS = ANIMATION TIME / ANIMATION FRAMES
NUMBER OF TICKS = ANIMATION TIME / 30 (FPS)
The problem is I never get a full loop (either too long or to short)
More info on the forumlas: https://learnopengl.com/Lighting/Basic-Lighting
Likes: MoKaLux
PS: I should commit some changes to 3dbase soon
Oh and I need to read the learnopengl pdf I downloaded just a couple of days ago