Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
3D Animation - Page 4 - Gideros Forum

3D Animation

124»

Comments

  • hgy29hgy29 Maintainer
    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.

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • Thank you, didn't think of that way ;)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited January 10
    SOLVED :)
    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? XXX
    for i = 1, self.totaltime/30 do -- /1.3 magik? XXX
    	D3Anim.tick()
    	self.imgid += 1
    end
    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.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited 5:54AM
    hgy29 said:

    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 :) ?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    edited 7:15AM
    In the 3dbase library, 3DShaders.lua file around line 160, you should see something like
    spec = pow(nh, 32.0)*shadow
    . Either set spec to 0, change the value 32 to something lower or apply a scale factor to attenuate it.
    More info on the forumlas: https://learnopengl.com/Lighting/Basic-Lighting

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    edited 7:56AM
    marvellous mister hgy29, in my case setting it to zero looks good, thank you a bunch for your help.

    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 :)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
Sign In or Register to comment.