Skip to main content
gamedev.net
🔒 Locked

D3DXCreatePatchMesh Help

Started by CommanderXXL Mar 18, 2003 at 9:09 AM 0 replies 750+ views
Original Post
CommanderXXL
CommanderXXL
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.
---------------------------- By CommanderXXLCommander@bloomm.de----------------------------
mutex
mutex
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.