Export animations : Rotate, Scale, Move ?

compvis

08-12-2009 06:45:37

hi,

i have a model in 3ds max, this has animations: rotate, scale, move

Is it possible to export these animation to mesh file ?

Thanks

benjamin0624

19-08-2010 04:54:31

you'd better export the animations with models in .osm files.
then implement the codes as follow:

Animation* animation =mSceneMgr->getAnimation("AB");
mAnimState = mSceneMgr->createAnimationState("AB");
mAnimState->setEnabled(true);
mAnimState->setLoop(false);

mAnimState->addTime( evt.timeSinceLastFrame);


....
also , you can use the animation::apply(), such as
(quote from oFusion Scene Loader CE Demo Application FILE: oSceneLibDemo.h) :

SceneManager::AnimationIterator animationIt = mSceneMgr->getAnimationIterator();
static Real currentTime = 0;

while(animationIt.hasMoreElements()) {
Animation* animation = animationIt.getNext();

const Animation::NodeTrackList& trackList = animation->_getNodeTrackList();

Animation::NodeTrackList::const_iterator it = trackList.begin();
Animation::NodeTrackList::const_iterator iend = trackList.end();

for(; it != iend; ++it) {
const Ogre::NodeAnimationTrack* track = it->second;
track->getAssociatedNode()->resetToInitialState();
}

currentTime += evt.timeSinceLastFrame;
animation->apply(currentTime);
}

There is a url you can refer to (to see posts by Lioric ):
http://www.ogre3d.org/addonforums/viewtopic.php?f=5&t=7988&hilit=animation