Sign in to follow this  

collision detection w/ directX tutuorials???

This topic is 4381 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 am looking for tutorials or lessons about collision detection w/ directX. But can not reach any point? I had read some articles about collision detection, but can not apply them to my project. I have two meshes,blocks, and they are moving.When one of them hit another I want to stop it. So really need help about it...

Share this post


Link to post
Share on other sites
Currently DirectX doesn't really do any physics... thats a whole seperate component to the application. Which is probably why you can't find many resources that combine the two.

Having said that, the various D3DX maths functions will probably be useful though.

The way I'd approach it is to split the components - Direct3D for visualisation and then whatever Physics algorithms to calculate the interactions. The two don't necessarily have to use the same data... you could get D3D to compute the bounding box/sphere (or whatever) and then hand it over to the physics component. When the physics component computes its new position D3D renders it wherever its told to...

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by TheMaskedFace
I was confused about sending my meshes to this physical engine...so I am looking for this.

Depending on what information and in what format the physics engine requires, you should be able to construct a triangle list from the vertex/index buffers using ID3DXMesh::LockVertexBuffer() and ID3DXMesh::LockIndexBuffer().

hth
Jack

Share this post


Link to post
Share on other sites
Quote:

I had read some articles about collision detection, but can not apply them to my project.


Can you give more details. What is the thing you find difficult to apply?
Keeping in mind Jack`s observations, if you are looking for a simple method, bounding boxes is probably the easiest one. As mentioned DirectX has some tools that can help. D3DXComputeBoundingBox and D3DXBoxBoundProbe are some of them (search the DirectX Documentation for more).
Also you can find a good tutorial on bounding boxes on the Toymaker site

Share this post


Link to post
Share on other sites

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