Original Post
I''m trying to create a R-Patch with LevelData of Q3.bsp files
The vertices are stored in the following format
1---2---3
| \ | \ |
4---5---6
| \ | \ |
7---8---9
The Count of Nodes is given separatly: 3 x 3
Now i want to create a PatchMesh, fill it with my data and then tesselate it and draw the resulting Mesh.
i tried this the following way:
PatchInfo.Basis = D3DBASIS_BSPLINE;
PatchInfo.Degree = D3DDEGREE_QUADRATIC;
PatchInfo.PatchType = D3DXPATCHMESH_RECT;
Size = (XSize - 1) * (YSize - 1);
D3DXCreatePatchMesh(&PatchInfo,Size,XSize * YSize,0,CVertexDeclaration,D3DDevice,&PatchMesh)
I now copy the ControlPoints (Count 9) in the VertexBuffer of the PatchMesh and generate a grid of Tris over the ControlVerts the same way i did it whithout using a R-Patch. The dashes in the schematices above are my tris.
Now i fill the attribute Buffer with zeros.
After that i ask the PatchMesh about it''s size
->GetTessSize()
Then i create i new Mesh with the size Data given.
And the i call ->Tesselate()
But when i now try to render the Mesh with Subset 0 nothing is displayed.
Am i doing something wrong? Please tell me where my error might be.