Sign in to follow this  

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

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

This topic is 4762 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this