Original Post
I all. I have a problem with nvtristrip lib. I have a model that must be rendered two sided, with many holes, and when I use GenerateStrips, it gives me unwanted triangles that can be seen over holes. The code I use is the following :
// NB : m_pSolidIndices is an MFC CArray
WORD iNumGroups = 0;
PrimitiveGroup *pPrimGroups = NULL;
GenerateStrips(m_pSolidIndices->GetData(), m_SolidIndexCount, &pPrimGroups, &iNumGroups); // always generates one group
m_pSolidIndicesStrips = new WORD[pPrimGroups->numIndices];
memcpy(m_pSolidIndicesStrips, pPrimGroups->indices, pPrimGroups->numIndices * sizeof(WORD));
m_iNumIndicesStrip = pPrimGroups->numIndices;
delete [] pPrimGroups;
when I render I use the following code :
pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
pd3dDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLESTRIP,
0,
m_SolidVertexCount,
m_iNumIndicesStrip - 2,
m_pSolidIndicesStrips,
D3DFMT_INDEX16,
m_pSolidVertices->GetData(),
sizeof(CUSTOMVERTEXTEXTURE));
The same code works well with triangle lists (when not using nvtristrip).
So what''s wrong ? Please help.
Thanks in advance.
ptl