HeightfieldGeometry in the wrong place.

Demonofloom

22-10-2009 18:47:41

Hey I've been attempting to give my Terrain some collision Geometry for the past day or so but I'm having problems.

Initially I was using NxOgre 1.5.5 and used the code below:-

models->openArchive("texture", "file:C:/NxBloodyMessOld/JModels/materials/textures");
NxOgre::HeightField* heightField = NxOgre::HeightFieldManager::getSingleton()->load("texture:heightfield2.xhf");
NxOgre::HeightFieldGeometry* terrain = new NxOgre::HeightFieldGeometry(heightField, NxOgre::Vec3(1500,1,1500));

mScene->createSceneGeometry(terrain);


but with this my objects were coming to rest above my terrain in a way that suggests it was in the wrong place but it covered the right amount of space. I had a go at rotating my HeightfieldGeometry with:
terrain->setLocalPose(NxOgre::Matrix44(NxOgre::vec3(0,40,0)));

This however didn't fix my problem and I had to resort to using NxOgre 1.5.4 in order to see the HeightfieldGeometry with the visual Debugger. Turning this on has produced this result:-



I have tried fiddling around with the size property but it refuses to stretch along the X-Axis to properly map to the terrain (not 100% sure if it did stretch it would properly match).


This is the image i converted into a heightfield using flour:-



I'm assuming the reason for the crushed terrain is an error with 1.5.4 , since in 1.5.5 the geomatry appears to be in the right area, just not matching the terrain. However without the visual debugger its hard to be sure.

Oh and I have 0.3 fps with Visual debugger, perhaps because its trying to show the complex Terrain Geom at all once?

sungoco

23-10-2009 06:40:43

I have the same problem,look forward to any voices about it.