Ahmed Salaheldin

Hi,

this is my first directx project and i am having some trouble with collision detection

i want to detect collisions between irregular objects and using bounding boxes or spheres around the whole object isn't precise enough

i need for example to detect collisions between a ball and a bowl (eg the ball hits the inner wall of the bowl, bounces off and finaly comes to rest at the bottom of the bowl)

Please reply, thanx




Re: Game Technologies: DirectX 101 precise collision detection

Etienne2005

For question about math and Physic you should ask the forum of gamedev.net in that section (math and physic)
This forum is more for DX question

As for collision your bowl will consist of many triangle
So your problem is to have a collision between a ball and a triangle first
Then you do the same test for all other triangle in your mesh

Collision are not easy and many options exist depending of what time you have

You can see a collision engine in nehe website





Re: Game Technologies: DirectX 101 precise collision detection

Ahmed Salaheldin

Thank you for your reply,

That is exactly what i am asking about, how do i test collisions against one triangle in my 3d object (code speaking that is)






Re: Game Technologies: DirectX 101 precise collision detection

Etienne2005

First you need to know if your ball is colliding with the plan where your triangle is

Most collider will first test if your ball is on one side of that plan or the other
Or if the ball is cut by that plan (a collision between a ball and a plan)

If it's colliding it will then test if the ball collide with the area of the triangle on that plan

Maybe this could help you :
http://www.flipcode.com/cgi-bin/fcarticles.cgi show=64175

#include "stdafx.h"

ozbool testIntersectionTriSphere(const Vec3f *_triPts[3],