I'm using code from this example: http://irrlicht.sourceforge.net/docu/example012.html
And I changed terrain scale to 1,1,1 and printed terrain size.
My terrain creation code looks like this:
Code: Select all
// add terrain scene node
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"../../media/terrain-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(1.f, 1.4f, 1.f), // scale
video::SColor ( 255, 255, 255, 255 ), // vertexColor
5, // maxLOD
scene::ETPS_17, // patchSize
4 // smoothFactor
);
terrain->updateAbsolutePosition();
irr::core::aabbox3d <irr::f32> box = terrain->getBoundingBox();
irr::core::vector3df minEdge = box.MinEdge;
irr::core::vector3df maxEdge = box.MaxEdge;
printf("%.2f %.2f %.2f %.2f\n", minEdge.X, minEdge.Z, maxEdge.X, maxEdge.Z);Code: Select all
Generated terrain data (256x256) in 0.0600 seconds
0.00 0.00 240.00 240.00Is there any solution to this? I can't scale terrain by factor like 1.05 (so terrain will actually be exactly 256x256), because then, height map texture pixels won't correspond to actual height map height at given position (for example, pixel at 125x125 won't be the same as terrain height at 125x125 pos, it will have a little offset).