Best approach to do OpenGL 3D Animation

Hey all,

I am new to OpenGL. So far, I went through some basic stuff and I can create simple geometries and textures now. Next up, I want to create some simple animations (e.g. walk-cycle). I did some hours of google search and what I found so far is, that you can do either a keyframe or a skeleton animation. Since keyframe animation seems to be easier and totally sufficient for my needs, I tend to go with that. What I know so far is, that you store vertices, normals and texture-coordinates of at least 2 different states and interpolate between them.
Now here are my questions:

  1. Is it better to hardcode each keyframe or to use some 3D modelling software (e.g.Blender) exports? What is the RIGHT way to do it? I know it probably depends on what you want to do, but if you were to make a character walk cycle animation, which approach would you choose?
  2. In both cases, can anyone supply me with some resources on how to do it exactly?

Thank you very much in advance

If it’s 2D, take a look at Spine. Otherwise, I would go with bone animation in whatever 3D modeler you’re comfortable with.

Its 3D, but I read that bone or skeleton animation is only recommended for fancy animations, with real physics and so on. A standard walk cycle should be faster and easier with keyframe animation (thats what i read)

I think you’ll find that the animations for walking are fancier than you might think, in the sense that you’ll probably to constantly tweak them just to get them right. You don’t necessarily need kinematics at runtime, but so you’re probably going to want bones in your model just to pose it for each keyframe. Beats having to model every pose by hand.

Ok, I see. You got any tip for me on where to start? I can do some basic modeling, but have no idea on the data type I have to export from my 3d software. And also I don’t know how to import it with Java and OpenGL :frowning:

Consensus seems to be that COLLADA is a good format when you need flexibility, but not something you ultimately want your game assets to be using. That about taps out my modeling knowledge, and I’m not sure what formats are good for export, especially when they contain animations. Dealing with models is something an engine like jMonkeyEngine or Ardor3D would take care of, so you’d have to see what model formats they support.

ok, thank you! I’ll check out the engines and start from there

I’m guessing you’re using Blender. In which case, you can export to *.X3D, which is an XML file.
The layout is pretty easy to understand and can be observed using a plain text program like Notepad.

There’s always the option to write a small program to read the X3D file. I use this method to import models and stuff them into my own file, so there’s no processing during loading, just simple file I/O.
However, I’m sure the engines have a really nice solution for importing models. So it’s really a matter of will you be using a preexisting engine, or making your own.