Mesh Position

mahdie9

13-09-2011 14:29:05

Hi all,

When I use the OgreMax script to export the 3ds model into .mesh files, the files have positions in themselves,
so whatever I enter as the initial position when creating them, they are constructed in their 3ds positions that are set in them.
For example I use:

Critter::BodyDescription bd;
bd.mWakeUpCounter = 1E8;
bd.mMass = 1000;

Critter::Body * mbody = mRenderSystem->
createBody( NxOgre::BoxDescription(1,1,1) , NxOgre::Vec3(10,15,20) , "something.mesh" , bd );

The object is created somewhere other than the position I am giving it.
Is it the exporting process problem or do I have to set some options in my 3ds program?

Thanks

betajaen

13-09-2011 15:08:00

I don't know 3DsMax at all. But can you reset the origin of the mesh in 3DS max, then center to that origin, then export?

mahdie9

13-09-2011 16:19:25

neither do I.
You are right. After a few trial and error, I figured out that the 3ds positions are set in the meshes so that the given position to their Critter::Body is summed up with them. I mean if I export a 3ds model from the (10,0,0) point, it will be created in that position and when I use the setGlobalPosition method to change it into (100,0,0) it will be moved to (110,0,0).
Finally I realized that I have to place all the models in the origin and export them to be able to initial them in the position I want in nxogre.
Thanks for your help betajaen.