I am developing on Qt, I have tried translate and rotate an .obj model.
I would like to know is there any possibility to do programmatically animate in Qt.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
If you want to do animations, .obj is the wrong format for you. But, never-the-less:
You can do that with mesh-keyframing, or Skeletal animation. Skeletal animation is the typical, newer, choice. But mesh-keyframing still has it's place, and is easy to implement.
Mesh-Keyframing: Is when you have a whole bunch of meshes that represent a model doing certain thing's, when strung together. So, doing it with OBJ models, you might have something like:
Person_Standing.obj Person_Crouching.obj Person_LayingDown.obj ...
Where each model has all the same data, just different places for the vertices. You then loop through, blending between two model's, and you have a smooth animation! Though, typically, people use
.md2 files for that. There is plenty of documentation on it.
Skeletal Animation: Is when you have a hierarchy much like a skeleton in the human world, your hand's connected to your arm, which is connected to your torso, which is also connected to by your head, other arm, and leg's. You then "bind" the vertices of the mesh to their respective bone, and work out a system in which moving the bone moves the vertices bound to it. Collada files are typically used for this (
.dae I believe.)
Here's a couple use-full references for you:
Edit: Some source code for you to reference.