Jump to content
  • Advertisement
Sign in to follow this  
byung kook bang

NvTriStrip???

This topic is 5045 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 expected to use in NvTriStrip. But, question arises. Don't print out a tringle. Please check what the problem is. I appreciate if you send a simple example. Thanks for a job well do! send to me e-mail. please..^^ oneofall@naver.com ////////////////////////////// this is a hexahedron. /////////////////////////////// PrimitiveGroup* primGroup; USHORT numGroups; USHORT faceVertexIndices[36] = { 0, 1, 2, 0, 2, 3, 4, 6, 5, 4, 7, 6 , 0, 3, 7, 0, 7, 4, 1, 5, 6, 1, 6, 2 , 3, 2, 6, 3, 6, 7, 0, 4, 5, 0, 5, 1 }; SetCacheSize(24); GenerateStrips(faceVertexIndices, 36, &primGroup, &numGroups); int nCou = 0; for(int i=0;i<numGroups;i++) { nCou += primGroup.numIndices; } if( FAILED( g_pd3dDevice->CreateIndexBuffer( nCou * sizeof(WORD), 0, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &g_pIB, NULL ) ) ) { return E_FAIL; } VOID* pIndices; if( FAILED( g_pIB->Lock( 0, nCou * sizeof(WORD), (void**)&pIndices, 0 ) ) ) return E_FAIL; unsigned short nIn = 0; for(i=0;i<numGroups;i++) { for(unsigned int j=0;j<primGroup.numIndices;j++) { unsigned short k = primGroup.indices[j]; memcpy( (WORD*)pIndices + nIn, &k, sizeof(WORD) ); nIn++; } } delete[] primGroup;

Share this post


Link to post
Share on other sites
Advertisement
Your code obviously isn't complete and it looks like you're missing all kinds of stuff. Anyways, I'd check your vertex buffer. Also, I don't know how you use triangle strips with index buffers, or how that gives you any advantage. The best sample is probably the tutorials in the DirectX help file. They're very straightforward.

tj963

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!