Whenever i try to debug my code i get the error that my height map can't be loaded.
Could not load terrain, because file could not be opened.: heightmap.bmp
However when not debugging the program and running it outside my IDE i see that it runs just fine.
It looks like i'm getting a false error. I have tried some different code which always results into the same.
Anybody know why this is happening (i don't get further then the line which loads the height map when debugging).
Code: Select all
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"heightmap.bmp",
0, // parent node
-1, // node id
core::vector3df(0.f, 0.f, 0.f), // position
core::vector3df(0.f, 0.f, 0.f), // rotation
core::vector3df(40.f, 4.4f, 40.f), // scale
video::SColor ( 255, 255, 255, 255 ), // vertexColor
5, // maxLOD
scene::ETPS_17, // patchSize
4 // smoothFactor
);
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
terrain->setMaterialTexture(0,
driver->getTexture("terrain-texture.jpg"));
//terrain->setMaterialTexture(1,
// driver->getTexture("../../media/detailmap3.jpg"));
terrain->setMaterialType(video::EMT_DETAIL_MAP);
terrain->scaleTexture(1.0f, 20.0f);