I have a terrain generated from a height map. I wish to access the terrain data so I can (for example) place a scenenode (eg for a tree or something) on the corner of each quad that the map consists of.
scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT);
terrain->getMeshBufferForLOD(*buffer, 0);
video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData();
// Work on data or get the IndexBuffer with a similar call.
buffer->drop(); // When done drop the buffer again.
But once I have this buffer I do not know what to do with it! How do I actually extract or iterate through the data?