Sign in to follow this  

a suggestion

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

Hi, I am new to game programming . Trying to develop a small shooting game. I have a doubt in edge detection. Is there any direct way in direct x to detect whether my target has been hit by the bullet from the gun. I render bullet,gun,target as objects and apply them an appropriate 2D texture. Expecting reply.

Share this post


Link to post
Share on other sites
The only D3DX helper function is D3DXIntersect, and it's for testing a ray against a mesh. This is not really much use without doing some goofy work arounds to make that work. The easiest thing is to write the code yourself, it's fairly simple. You can simplify the character and bullet meshes with bounding boxes.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c_Dec_2005/D3DXComputeBoundingBox.asp

Then, turn the two min/max points returned by D3DXComputeBoundingBox into actual meshes with 8 points (3D cubes). Each frame, transform the cubes by the same world transform as you do each mesh and test to see if one cube lies in the other. That test is pretty straight forward.

Good luck,
Chris

Share this post


Link to post
Share on other sites

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