Skip to main content
GameDev.net gamedev.net
🔒 Locked

nvtristrip lib problem

Started by ptl May 31, 2002 at 9:30 AM 0 replies 350+ views
Original Post
ptl
ptl
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

Topic Locked

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

Sign in to reply to this topic.