Jump to content
  • Advertisement

Archived

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

CommanderXXL

D3DXCreatePatchMesh Help

This topic is 5399 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!