我正在尝试重新创建此处使用的 Ogre 代码(在 Irrlicht 中): http ://dave.uesp.net/wiki/Block_Land_3
对于这部分代码:
MeshChunk->position(x, y, z+1); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(0, 1);
我这样做了:
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));
但是如何翻译:
MeshChunk->triangle(iVertex, iVertex+1, iVertex+2);