You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
IMesh* pMesh = terrain->getMesh();
for (b=0; b<pMesh->getMeshBufferCount(); ++b)
{
IMeshBuffer* pMeshBuffer = pMesh->getMeshBuffer(b);
// skip mesh buffers that are not the right type
if (pMeshBuffer->getVertexType() != video::EVT_2TCOORDS) continue;
video::S3DVertex2TCoords* pVertices = (video::S3DVertex2TCoords*)pMeshBuffer->getVertices();
for(s32 x = 0; x < terrainWidth; x++)
{
for(s32 y = 0; y < terrainHeight; y++)
{
pVertices[(x * y) + y].Color = SColor(255,255,255,255);
}
}
}
i'm doing a stupid thing, or what i need to change?
CPU: AMD PHENOMII X6 1090T BE 3,2GHZ
RAM : OCZ 8GB 2*4GB DDR3 LOW VOLTAGE 1333
VGA: GeForce GTX680 2GB
HD : 500GB + 500GB + 2x1TB Raid Edition + 500GB External
Motherboard: ASUS CROSSHAIR FORMULA 4 890FX AM3
PSU: Corsair 750W
CPU Cooling: Katana 2
You should set the hw_mapping to dynamic and invalidate the buffers by calling setDirty() on them. Also I'm not sure if you need to access the renderbuffer instead of the mesh - terrain is a little strange with the internal structure.