Sign in to follow this  
renanrosa

Directx C++ Collision/Intersect Mesh .X File

Recommended Posts

Hello Guys, could someone help me. I am developing a 3D game, but I have very difficulty in the COLLISION WITH MESHS .X files. I found many examples, but all bad or only briefly explained, someone have an example (with source code preference rsrs) or explain? especially the height of the terrain/land Images of my Game: Thank guys

Share this post


Link to post
Share on other sites
Hi,

You don't need to perform D3D Mesh file intersection tests. It will be so difficult, because it's calculations are so long (You should assume your character as a capsule, you need to pass terrain data as a collision data etc.).

I think you should use an existing physics engine. You can start with Tokamak (www.tokamakphysics.com). If you want, you can use nVidia Physics Engine.

There're a lot of examples on the .net.

Hope this helps.

Share this post


Link to post
Share on other sites
Hello, thanks for the reply, I will see if I see something of what you said, I saw something of tokamakphysics but I wanted to make the game without relying on many API / Tools.

as well: You should assume your character as a capsule

Thanks for the help

Share this post


Link to post
Share on other sites
Like programci said you very rarely need to use the actual triangle mes for collision. It's much more common to create a collision/physics representation of skinned meshes with a series of bounding boxes and/or capsules, with the boxes or capsules bound to different bones.

Share this post


Link to post
Share on other sites
Quote:
Original post by renanrosa
but in the case of the map, I also use. x, and has several grooves, as I do that? create several square?

Thank
Yes. X files aren't really suitable to use for maps, since you have to render the entire map every frame, instead of being able to just render the segments nearby (I.e. PVS culling).

One solution would be to split the map into multiple chunks, and then only check the triangles of the chunk containing the player position.

Share this post


Link to post
Share on other sites
Quote:
Original post by renanrosa
hummm, I understand, I go search for more, I have that render several times the squares ?(DrawIndexedPrimitive..?)

someone have a sample ??
thank guys
If you want to use X files, you'll have to split the map into multiple pieces, and render all of the visible pieces each frame.
If you don't want to use X files, then you could use any method you like - including managing your own VB and IB and using DrawIndexedPrimitive.

Share this post


Link to post
Share on other sites
Quote:
you want to use X files, you'll have to split the map into multiple pieces, and render all of the visible pieces each frame.
If you don't want to use X files, then you could use any method you like - including managing your own VB and IB and using DrawIndexedPrimitive.



humm, I understand,
i go see more.

Thank for reply

Share this post


Link to post
Share on other sites

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