• Advertisement
Sign in to follow this  

D3DXIntersect - better way to set height on a mesh?

This topic is 3032 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 using it to set the height of the player and camera, but it eats up 6FPS. Is there a better way to do it? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
6FPS at what? 10FPS? 10000FPS?

Generally you have a lower detail collision mesh or heightmap for testing things like that, or if your terrain is a regular shape (Flat plane, sin/cos curve, etc) you can determine the height of the terrain algorithmically.

Share this post


Link to post
Share on other sites
6FPS lower than the 30FPS I see looking at the same scene.

The terrain mesh is exported from my terrain editor at 1025 x 1025 vertices. I'm looking into reducing that mesh to 513x513, but I'd like to know if there's a better way.

Thanks

Share this post


Link to post
Share on other sites
Doing physics checks against visual geometry is usually a bad idea, the visual geometry tends to be far higher resolution than what you require for collision.

In your case, you could split the mesh into smaller pieces and use some sort of partitioning system like a quad-tree or oct-tree to determine which piece(s) you need to test against, and then only test those. A heightmap would also work, but would require around 4MB of memory for a 1024x1024 mesh (Assuming you store the height of each point in a 32-bit float).

Share this post


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

  • Advertisement