Jump to content
  • Advertisement
Sign in to follow this  
DJTN

[DX] Simple Cell Data From Vertex Data

This topic is 2480 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've created a terrain mesh with the same size triangles. I store cell data for every 2 triangles. I have 60 vertices per row and 60 vertices per column. When creating the vertices I store every 6 vertices in a collection as a cell for collision detection later. The problem with this is that it creates 10 cells per row and not 60.

60 vertices / 6 = 10 cells. I should have 60 cells.

Since each cell shares vertices from another, how can I calculate this? How can I determine which vertices to re-use when creating the next cell?

I know this should be pretty easy but I'm stumped...

Share this post


Link to post
Share on other sites
Advertisement
Wow, I feel stupid. Last night, right before I fell asleep it came to me. I don't need to store the cells, I can recreate the two triangles from the vertex data and test for collision using a point to triangle method and the current world position of the object I'm testing.

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!