enity position when exporting from 3DSmax [SOLVED]

aida

10-08-2007 09:11:48

Hi
I have an animation defined in a 3DSmax file. Its position is 0,0,0.
When I export it using ofusion, the entity position in the osm file is x="-40.8565" y="34.819" z="34.877"

I don't know why. I just want it to be at its first position. I tried to modify it in Ogre :


OSMScene::EntityList entList = oScene.getEntityList();
Entity * character = entList[0];
SceneNode * charNode = pSceneManager->getSceneNode(character->getName());
charNode->setPosition(Vector3(22.292f,0,71.3004));
charNode->rotate(Vector3(0,1,0), Radian(3.14));


but it has no effect.

Can someone help me please??

aida

10-08-2007 14:51:53

I didn't manage to set the entity position for the export from 3DSmax. But anyway, I think it's better to place and scale the object in Ogre3D. The problem is I couldn't do it neither!

Here is what I do :

OSMScene oScene(pSceneManager,pRenderWindow);
oScene.initialise("characterAnimation.osm");
oScene.createScene(pSceneManager->getRootSceneNode());
OSMScene::EntityList entList = oScene.getEntityList();
Entity * character = entList[0];

SceneNode * characterNode= pSceneManager->getSceneNode(character->getName());
SceneNode * OldParent = characterNode->getParentSceneNode();
OldParent->removeChild(characterNode);

SceneNode *viewNode = pSceneManager->getRootSceneNode()->createChildSceneNode("ViewNode");
viewNode->setPosition(22.292f,0,72.3004);

viewNode->addChild(characterNode);

characterNode->setPosition(0,0,0);
characterNode->setScale(1,1,1);
characterNode->rotate(Vector3(0,1,0), Radian(3.14));


When I do that, the character (which is an animation - walking character) doesn't appear at all!
The Ogre.log tells that the osm scene is loaded.

What is the right way to load an animation in Ogre3D from an osm file and scale, translate it?

Please help me, I've been stuck for two days now!

Lioric

10-08-2007 17:32:35

What is the objects position when in figure or pose mode (this is the initial position of the object)?

If the animation start is different from the figure location, this creates a movement of the root bone (is not the objects that is in that position, is the root bone and this moves all of the object vertices), this will create a displacement, and when you move the object in your application, the animation will displace the object wrt to the current location

Test by set the animation start at the same location as the figure or pose mode location

If you are using the Pro version, enable 'InPlace' mode to create a local animation that dont depends on the current world position of the object

Or post the scene file and i will take a look at it

aida

11-08-2007 14:37:48

Thank you for your reply. Actually, when I just load the osm scene, the character is at the position that is defined in the osm file but not at the one in the 3Dsmax. When I attach the character entity to another node of my scene (see code above), the character is invisible!

I have put the osm file, the mesh file and material one at the following address : http://www.acao.fr/ogre3D.
Thank you for your help

Lioric

14-08-2007 00:04:56

The max scene file is needed to review why you are getting a diferent position for the entity

aida

15-08-2007 15:41:51

Thank you

Indeed I've set the pivot point to zero and reexported the scene, and it's now at the right position