I am using osgEarth to show a 3d model of a quadcopter drone flying over the terrain. I was wondering whether it is possible to make the model's propellers spin while the drone is flying (and, eventually, what is the best/recommended way to do that).
I can explode the model in Blender and separate the propelles from the frame but I don't know if the right way to animate them is to assign every propeller to a different ModelNode and move/rotate them on the map independently (it seems quite a complex task) or if there's a way to create an animated model and import it in a single ModelNode.
After all, I don't need to control the spinning, it would be just good to be able to import two different models of the drone: one "static" model and another one with the spinning propellers.
This is more of an OpenSceneGraph question. You would set up your model (in the modeling software) so each rotor geometry is in a separate scene graph group under a transform. Then you app can locate those transforms and update them each frame -- perhaps with an UpdateCallback, or in the frame loop. Good luck!
Ok, I see. But do you think that it is better for me to use "ModelNode"s or generic "osg::Node"s for the rotors?
I found the two alternatives here: http://docs.osgearth.org/en/osgearth-2.4/faq.html I was asking for a suggestion about which one is easier to use.
but there's something wrong with the altitude.
If I place both the ModelNode and the osg::Node at the same GeoPoint, the altitude of the ModelNode is correct while the osg::Node is way lower that the ModelNode.
Now, I am studying the SimpleModelSource class to understand what I did wrong...