Something about glut keyboard input

I am currently using MD2 model and try using keyboard function callback to capture from user in order to set the model into different animations. However, I am wondering how to set the model into static standing state when user did not input anything. Did glut provide such function to detect if user did not input anything? Or, do you guys have any suggestions on this structure?

Since you have your own rendering function then its COMPLETELY up to you what you render.

So, your main rendering function will look like this:

  1. Has user pressed a key? What animation it should cause
  2. Can this animation cause current animation to end immediately? If yes, then start new animation
  3. Is current animation over? If yes then start idle animation.
  4. Render next frame of current animation

Note #3 - this means that if you are playing idle animation and it ends it gets restarted.

MD2 models are awesome, because they’re humorous and stencil shadows work great with them (except some of the weapon models). Actually I haven’t tested them all, just the ones from Quake2. MD3s were much trickier :slight_smile: I haven’t even tried them with MD5s.

The hardest part of key frame animation, I think, is getting the sequence transitions right, so it’s all in sync with game play or whatever’s going on and doesn’t look like a mannequin on angel dust :wink:

"it’s all in sync with game play "
Thanks, you are right, I have fixed it
I use some boolean and integer to do the synchronization. It works fine!