i found how to use "bones" to animate a model.
but i need to know names of bones.
Apparently i can to use ogreXmlconverter to create *.xml files from my *.mesh & *.skeleton files and read the name of bones from there.
but when i try to use ogreXmlconverter, and read the names from there and insert in my code i see that the visual studio says the names are incorrect.
(I have same problem with animations too! )
what is the problem?
you can to see my xml file of entity here:
Code: Select all
<skeleton>
<bones>
<bone id="0" name="ValveBiped.Bip01_Pelvis">
<position x="0" y="1.03838" z="0.0143666" />
<rotation angle="4.71239">
<axis x="-1" y="-0" z="-0" />
</rotation>
<scale x="1" y="1" z="1" />
</bone>
<bone id="1" name="ValveBiped.Bip01_L_Thigh">
<position x="0.104746" y="0" z="0" />
<rotation angle="4.22162">
<axis x="0.569096" y="0.566199" z="0.596279" />
</rotation>
<scale x="1" y="1" z="1" />
</bone>
.
.
.
Code: Select all
Bone mRobotBone;
#region phoneix
Entity mPhoneixEntity = mSceneMgr.CreateEntity("Phoneix", "phoneix.mesh");
SceneNode mPhoneixNode = mSceneMgr.RootSceneNode.CreateChildSceneNode("PhoneixNode");
mPhoneixEntity.SetMaterialName("t_phoenix.tga");
mPhoneixEntity.DisplaySkeleton = false;
mPhoneixNode.SetPosition(5750f, 0, 500f);
mPhoneixNode.Scale(new Vector3(100, 100, 100));
mPhoneixNode.AttachObject(mPhoneixEntity);
Skeleton mPhoneixSkeleton = mPhoneixEntity.Skeleton;
mPhoneixBone =mPhoneixSkeleton.GetBone("ValveBiped.Bip01_L_Thigh");
mPhoneixBone.SetManuallyControlled(true);
#endregion phoneix
""Object reference not set to an instance of an object."'
thanks you very much for your answers.
(Note: I'm so sorry for my bad English)