public void CreateMesh(Model model) { var box = model.GetBoundingBox(); var vertices = new List<Vector3>(); // stairs vertices.Add(new Vector3(box.Min.X, box.Min.Y, box.Max.Z)); vertices.Add(new Vector3(box.Min.X, box.Max.Y, box.Min.Z)); vertices.Add(new Vector3(box.Max.X, box.Max.Y, box.Min.Z)); vertices.Add(new Vector3(box.Max.X, box.Min.Y, box.Max.Z)); // west vertices.Add(new Vector3(box.Min.X, box.Min.Y, box.Min.Z)); // east vertices.Add(new Vector3(box.Max.X, box.Min.Y, box.Min.Z)); var indices = new List<TriangleVertexIndices>(); // stairs indices.Add(new TriangleVertexIndices(2, 1, 0)); indices.Add(new TriangleVertexIndices(3, 2, 0)); // west indices.Add(new TriangleVertexIndices(0, 1, 4)); // east indices.Add(new TriangleVertexIndices(5, 2, 3)); // north indices.Add(new TriangleVertexIndices(4, 1, 2)); indices.Add(new TriangleVertexIndices(4, 2, 5)); // bottom indices.Add(new TriangleVertexIndices(0, 4, 5)); indices.Add(new TriangleVertexIndices(0, 5, 3)); CreateMesh(vertices, indices); }