Collision detection for 3D objects

This topic is 4370 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I have a flat n' round 3D object, which can move only on the xz plane. In its way are low walls which block its path. I'm using DirectX 9 with C++. Can someone plz direct me or tell me how can I use DirectX utilities for detecting collision between the flat round object and between the game walls ? All objects (walls and disc) are Meshes loaded from an X file. thx.

Share on other sites

... if the object is round and flat (you mean like a hockey puck?), it seems unnecessary to use "real" collision detection.

I would think about using something like pythagoras theorem (especially since it only moves along x and z), and simply check if the "puck" is close enough to a wall to actually touch it, and thus colliding.

I guess you'll have to figure it out, and this is just an idea.

The way I see it, "real" collision detection does consume CPU power, and that seems unnecessary in this case.

But do consider that I'm not an expert. I do apologize if I'm talking bullshit.

/Justice

Share on other sites
Actually, you just described a real collision detection. It's just a very specific type (ie: cylindrical object on walls).

If the walls are all straight, you'll want to use the line equation, and find the nearest point on the wall(s), then see if (x2-x1)(x2-x1) + (z2-z1)(z2-z1) is more than the square of the radius of your "flat n' round" object (ie: r*r). Doing so, you don't have to use square root, and your detection will be considerably faster.

Share on other sites
Yes, yes, of course it's a "real" collision detection - or else it wouldn't work. :P

What I meant to express what that you don't need stuff like triangle selectors and such.

I mean, it's not really checking if 2 triangles are colliding, but actually if they are close enough to collide. :P
But, but, ok, might be a question of "point of view". Just wanted to be clear.

1. 1
2. 2
3. 3
Rutin
21
4. 4
frob
18
5. 5

• 33
• 13
• 10
• 10
• 12
• Forum Statistics

• Total Topics
632568
• Total Posts
3007119

×