Jump to content
  • Advertisement
Sign in to follow this  
Waxy

D3D Col. Detection

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

Sorry for bringing this toppic up because i'm sure it's been asked 100's of times over. VB6.0 D3D7 I'm just looking for the very-beginners tutoral on 3D collision detection. Right now i'm putting each and every plane in a bounding box and using collision detection very simular to 2D collision detection, but that just won't cut it in the long run (All slopes get rounded off to rectangle collision zones. if you walk 20 feet down a hill - you walk just horozontaly until you come to the end of the slope and THEN drop down like it's actualy a stair.) Thanks in advace for the 'Collision for dummies' link. BTW - they are planes of multiple points. Not split into triangles already and no curved surfaces to worry about.

Share this post


Link to post
Share on other sites
Advertisement
Can you tell us more about the environment and the collision detection requirements? That is, is it terrain-based, indoor, outdoor; is the character humanoid, or maybe a vehicle; does it need to align with the surface or just keep from falling through it - that sort of thing.

Share this post


Link to post
Share on other sites
With regards to gravity, I'd think that the best thing to do is imagine a line extending downwards from the player, and find which polygon/plane it intersects first. Then find the point where it intersects (presumably by interpolation) and compare that point to the bottom of your character, moving the character downwards if necessary.

Many similar routines (eg. for sliding along a wall) can be generally described as extending a vector in the given direction, seeing what it hits, then determining where it hits it.

Share this post


Link to post
Share on other sites
You could try googling for 'line plane intersection' - there are about 700,000 results so I'm sure one of them is likely to be useful, although it's somewhat mathematical. (But then that's life when you make the move to 3D.)

Share this post


Link to post
Share on other sites
I've already tried that, i get nothing but 2D examples, ect...

If you don't know where a tutoral is then why bother posting?

Share this post


Link to post
Share on other sites
Because not everything can always be answered by a tutorial. I am trying at least to give you some hints, which at this point is better than anyone else has managed.

Share this post


Link to post
Share on other sites
Beware: whoever wrote that obviously has a better grasp of maths than I do, but they seem blissfully unaware that comparing 2 floating point values for equality is usually a very bad idea. If you end up using that code, watch out for that.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!