Jump to content
  • Advertisement
Sign in to follow this  
mrWodoo

Triangle list

This topic is 2558 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

Hello, I have little [big] problem, I need to draw my WHOLE VertexBuffer at one time [using D3DPT_TRIANGLELIST], but I don't know how the 3rd parameter should be set. I'm making a voxel game [world like minecraft - builded using cubes], I tried this:
gEngine->GetDevice()->DrawPrimitive(D3DPT_TRIANGLELIST,0, ( m_VertexBufferSize / sizeof( BlockVertexFormat ) ) / 3 );

Where m_VertexBufferSize = numer of vertices * sizeof( BlockVertexFormat )
and BlockVertexFormat is my vertex structure.

This doesn't work, I'm getting artifactes

Share this post


Link to post
Share on other sites
Advertisement
it probably has to do with the vertices in your vertex buffer not being sorted correctly. whats the code that creates your vertex array? also, it looks like your setting the third parameter right, so it doesn't look like it has to do with the draw call.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!