Jump to content
  • Advertisement
Sign in to follow this  
Arkanoid

Mesh collisions

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

Advertisement
Cheapest way is to create bounding boxes around each mesh and check for intersections. This wont work if you are rotating the meshes though. In that case, you could use BoundingSpheres.

The best and most accurate way of checking collisions between each mesh is creating a coliision skin around the mesh. Which basically means, recreating the shape of the mesh with as little polys as it takes to be reasonably close

Share this post


Link to post
Share on other sites
As dAND3h said, the cheapest way is to check bounding volume collisions. You can use either bounding box or bounding sphere according to the shape of your mesh. For example, a box would be best for a television and a sphere for a beach volleyball smile.png


Btw,

This wont work if you are rotating the meshes though.

Why? I think you're wrong. Because we can transform bounding boxes (AABBs) and check them for collisions.

F. Luna's book (Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach; this is available in Google Books) has a good explanation about bounding volumes: creation, transformation and checking.

I think the most accurate way is to create a low-poly version of your mesh manually (i.e. with a 3D modeling software) and send it to your physics engine. There're a lot of physics/collision engines around the net.

hth.
-R

Share this post


Link to post
Share on other sites
if bounding boxes are usual boxes with 8 vertexes...so not its not that i need.

physics engine.

maybe this is the best variant...you know maybe any good engines? How about PhysX? Is it work with DirectX?

Share this post


Link to post
Share on other sites
Physics engines are not designed for a specific graphics library such as DX or GL. Their main goal is to make physical calculations and return final transformations of registered objects/primitives. And your job is to get that transformation data and use for your needs.

PhysX is the most popular physics engine. Now it became free for commercial and non-commercial applications. You can use it. The first important thing you must know about it is that the matrix structure of the engine is column-major but in it's row-major in DX.

On the other hand, Bullet is another popular engine. It's open source and developed by a Sony R&D employee. I know it's used in some animation movies like Toy Story.

hth.
-R

Share this post


Link to post
Share on other sites
Bullet physics engine developer now works for AMD. PhysX is much more powerful than Bullet physics and so are it's documentation. D3DX 9 methods can also be used to do so, refer to this old thread of mine: http://www.gamedev.net/topic/615595-solved-transformation-matrices-of-individual-subsets-of-an-x-file/page__p__4886759#entry4886759 to compute bounding box and detecting collisions between two primitives is just a matter of computing coordinates of bounding boxes

Share this post


Link to post
Share on other sites
BTW, if bounding box is not what you need then you can use bounding sphere too look up D3DXComputeBoundingSphere

Share this post


Link to post
Share on other sites
But if i use a mesh like a ground? Can Bounding boxes be useful? Maybe i'll need check it Poly to Box, but not box to box...or i don't understand well what is bounding box....

Share this post


Link to post
Share on other sites
it may be useful if it's a planar surface. You can offset some value off the ground like I have done in that thread and constrain character/camera movement along the coordinate were collision occurred. You should refer to Frank Luna's Introduction to 3D game programming with DirectX 9.0c, it's an excellent book

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!