As far as I know there is no DirectX function that will take a plane and create a cube from it.
My Direct3D programming bible states that for a cube (if your hard coding it) will contain eight vertices, 24 vertex normals, and the face data for the cube must refer to each of the six faces.
CODE
// a cube has six planar faces defined by 8 vertices
D3DVECTOR vertices[] = {-0.5f, -0.5f, -0.5f, // first vertex
-0.5f, -0.5f, 0.5f, // second vertex etc...
-0.5f, 0.5f, -0.5f,
-0.5f, 0.5f, 0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, 0.5f,
0.5f, 0.5f, -0.5f,
0.5f, 0.5f, 0.5f}; //last vertex
// each of the cubes 6 faces has 4 vertex normals for a total of 24
D3DVECTOR normals[] = { 0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, 0.0f , 0.0f,
1.0f, 0.0f , 0.0f,
1.0f, 0.0f , 0.0f,
1.0f, 0.0f , 0.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
-1.0f, 0.0f , 0.0f,
-1.0f, 0.0f , 0.0f,
-1.0f, 0.0f , 0.0f,
-1.0f, 0.0f , 0.0f,};
// face data refers to each face of the cube
DWORD faceData[] = { 4, 1, 0, 5, 1, 7, 2, 3 ,3,
4, 2, 4, 3, 5, 7, 6, 6, 7,
4, 5, 8, 4, 9, 6, 10, 7, 11,
4, 0, 12, 2, 13, 6, 10, 7, 11,
4, 0, 16, 4, 17, 5, 18, 1, 19,
4, 0, 20, 1, 21, 3, 22, 2, 23, 0};
LPDIRECT3DRMMESHBUILDER3 pMeshBuilder;
pMeshBuilder->AddFaces( 8, // number of vertices
vertices, // vertex array
24, // number of normals
normals, // normals array
faceData, //data for each face
NULL);
Hope that helps.. if you are going to be building them dynamically, you can dynamically fill the arrays before calling AddFaces();
Aet