ofusion animation problem...

samsamsam

11-05-2010 07:04:20

hello...
i used ofusion for a year ago...
now am using it, but am having a problem in activating the animation...
please i ll show u how am doing it, and u judge :?
i designed a car in 3ds max...
i build an object animation for wheels,( making a rotation for every wheel through frames)
i make the wheels as childrens for the car body...
then i exported it...
the *osm looks like:

<entity name="wheel3" hidden="false" filename="wheel3.mesh" parent="body" CastShadows="yes" ReceiveShadows="yes">
<position x="0" y="0.38" z="-0.30000001" />
<rotation x="0" y="0" z="-0" w="-1" />
<scale x="1" y="1" z="1" />
<animations>
<animation name="run " loop="false" length="6">
<keyframe time="0">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-1" x="-0" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
<keyframe time="0.0666667">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-0.999848" x="-0.0174524" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
<keyframe time="0.133333">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-0.999391" x="-0.0348995" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
<keyframe time="0.2">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-0.99863" x="-0.052336" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
<keyframe time="0.266667">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-0.997564" x="-0.0697565" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
<keyframe time="0.333333">
<position x="0" y="0.38" z="-0.3" />
<rotation w="-0.996195" x="-0.0871557" y="-0" z="0" />
<scale x="1" y="1" z="1" />
</keyframe>
.......

now i tryed to activate that in my ogre application like this:

// when adding the car i did that:
Ogre::SceneManager::AnimationIterator animationIt = m_scene_manager->getAnimationIterator();
animation = animationIt.getNext();
// then in every frame i did that:
currentTime1 += evt.timeSinceLastFrame;
animation->apply(currentTime1);

now what happens is that the wheels fly far a way from the car... :shock:
so please, first of all i need to know what is the best way for designing the objects in 3ds max ( objects of car kind )
and its animation, in a way that makes it easy in ogre ( cause it makes it difficult having a 10 meshes for every object...)
seconed, is my way for activating animation is true?
third... why my wheels are flying?
maybe am asking too much... but i hope from those who make an effort and read this long question, to give an advice...
and thanks in advantage :roll:

Lioric

11-06-2010 03:47:14

I thought that I answered this but it seems that the reply was not posted, anyway, what it might be happening with the objects incorrectly animated is that they are linked to helper objects and they are not being exported (either by not selecting the option or because you are using the CE version) and when loaded they are animated in relation to other object that is not the correct parent, review that your scene hierarchy in your application is the same as you created it