Jump to content
  • Advertisement
Sign in to follow this  
fguihen

anyone do 3D collission detection in c# with DX9?

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

im having a real hard time comming up with , or understanding how to implement collision detection into my c# app. i have a room mesh, inside of which people will move around. my first aim is to make the people not pass through any walls. the problem is the walls are anything but straight. they have curves, semi circles along their length. so sphere and plane intersection is out. someone suggested creating a grid all along the walls and checking theese against the bounding sphere, but as to how to implement this in code, is a mystery to me. anyone got any ideas or source code they could show me to give me a better understanding of what i will have to do. i have seen some c++ code, but i find it really hard to understand c++ so its not much help

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
It really shouldn't matter if you are looking at C# or C++ when looking at collision detection. The algorithm is going to be the same in either language and at that level it's going to look very similar. Maybe what you need to do is to take a step back and look at doing collision with a straight wall (a plane) and then try to add complexity to that program.

For the grid part, one way to look at it is that you (the character) are a bounding sphere...and the wall made of semi circles can be treated as a bounding sphere. If the semi circles are all the same size, you can take the radius of the biggest circle and create a plane perpendicular to your wall. At this point you can still do a quick test between a wall and a sphere and if the sphere hasn't cross the plane then there is no need to do a sphere-shpere test. Only once it crossed that plane do you need to do individual test with the spheres from the wall.

You really should get familiar with C++, I'm not sure how soon before everything is going to be written in C# managed code :)

Shadx

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!