void createCube()
{
//1.创建Mesh对象
MeshPtr msh = MeshManager::getSingleton().createManual("Cube", "General");
SubMesh* sub1 = msh->createSubMesh("1");
//2.定义顶点数量、信息
const float sqrt13 = 0.577350269f; /* sqrt(1/3) */
const size_t nVertices = 8;
const size_t vbufCount = 3*2*nVertices;//
//3.设置顶点信息(位置、法向量等)
float vertices[vbufCount] = {
-100.0,100.0,-100.0, //0 position
-sqrt13,sqrt13,-sqrt13, //0 normal
100.0,100.0,-100.0, //1 position
sqrt13,sqrt13,-sqrt13, //1 normal
100.0,-100.0,-100.0, //2 position
sqrt13,-sqrt13,-sqrt13, //2 normal
-100.0,-100.0,-100.0, //3 position
-sqrt13,-sqrt13,-sqrt13, //3 normal
-100.0,100.0,100.0, //4 position
-sqrt13,sqrt13,sqrt13, //4 normal
100.0,100.0,100.0, //5 position
sqrt13,sqrt13,sqrt13,