Terrain & CFG file

Risine

10-06-2010 21:54:37

Right now I'm loading my terrain with :
mSceneMgr->setWorldGeometry("Terrain.cfg");

And I want to make my terrain a NXOgre terrain. I found some ways to convert a terrain in NXOgre, but none using cfg files.
How do I just "convert" my terrain to use it in NXogre with just my CFG file?

Risine

12-06-2010 20:11:56

ok,
so with some time, and many tries, I succeeded in creating a Nxogre Terrain Collider using my raw file.
Converted it to xhf with flour then :
in createscene :
mSceneMgr->setWorldGeometry("Terrain.cfg");
NxOgre::ResourceSystem::getSingleton()->openArchive("media", "file:E:\\Work\\Ogre\\hop\\media");
NxOgre::HeightField* hf= NxOgre::HeightFieldManager::getSingleton()->load("media:Terrain_height.xhf");
NxOgre::HeightFieldGeometry* hfg = new NxOgre::HeightFieldGeometry(hf,NxOgre::Real3(1000,125,1000));
hfg->setLocalPose(NxOgre::Matrix44(NxOgre::Real3(0,125,0)));
mScene->createSceneGeometry(hfg);


I have in terrain.cfg :

PageWorldX=1000
PageWorldZ=1000
# Maximum height of the terrain
MaxHeight=125


But when an object is thrown on the terrain, it collides but not on the ground. Visual and Collider do not correspond to each other.
And changing Y in setLocalPose does not seem to correct anything.
Did I miss something, anyone has an idea?