My Terrain have two floors. Why?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
charlie
Posts: 10
Joined: Tue Aug 15, 2006 4:11 am

My Terrain have two floors. Why?

Post by charlie »

My God, My Terrain has two floors,My camera can even shuttle between them.

My heightMapFile is 257*257(There is no this problem if my heightMapFile is 256*256)

My code:

m_Smgr=device->getSceneManager();
m_Driver=device->getVideoDriver();
m_TerrainNode=m_Smgr->addTerrainSceneNode("../Res/Models/Terrian/terrain-heightmap3.bmp",0,-1,
core::vector3df(0.0f, 0.0f, 0.0f),
core::vector3df(0.0f, 90.0f, 0.0f),
core::vector3df(143, 4.3f, 143),
video::SColor(255, 255, 255, 255),3,scene::ETPS_33);

m_TerrainNode->setMaterialTexture(0,m_Driver->getTexture("../Res/Models/Terrian/Terrian_0.bmp"));
m_TerrainNode->setMaterialTexture(1,m_Driver->getTexture("../Res/Models/Terrian/detailmap3.jpg"));
m_TerrainNode->setMaterialType(video::EMT_DETAIL_MAP);
m_TerrainNode->scaleTexture(1.0f, 20.0f);
m_TerrainNode->setMaterialFlag(video::EMF_LIGHTING, true);
//m_TerrainNode->setMaterialFlag(video::EMF_TRILINEAR_FILTER,1);
m_TerrainNode->getMaterial(0).AmbientColor=video::SColor(0,255,255,255);
Student
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to use 129x129 to avoid index overrun at the end. 257x257 lies over the limit of 2^16 indices.
Post Reply