Archived

This topic is now archived and is closed to further replies.

CommanderXXL

D3DXCreatePatchMesh Help

Recommended Posts

CommanderXXL    122
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.

Share this post


Link to post
Share on other sites
mutex    1111
It seems that you have to give it index data too. I had the same problem (no output) but after setting a simple list of indices: 0, 1, 2, 3, 4 for testing, it displays some deformed triangles.

Share this post


Link to post
Share on other sites