I am trying to recreate the Ogre code used here (in Irrlicht): http://dave.uesp.net/wiki/Block_Land_3
For this part of the code:
MeshChunk->position(x, y, z+1); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(0, 1);
I did this:
SMesh* Mesh = new SMesh();
SMeshBuffer *buf = 0;
buf = new SMeshBuffer();
Mesh->addMeshBuffer(buf);
buf->drop();
block_t Block;
block_t Block1;
int iVertex = 0;
buf->Vertices.reallocate(3);
buf->Vertices.set_used(3);
....
buf->Vertices[0] = S3DVertex(vector3df(x, y, z+1), vector3df(-1,0,0), SColor(255, 0,0,0), vector2df(0, 1));
But how can this be translated:
MeshChunk->triangle(iVertex, iVertex+1, iVertex+2);