collision detection in my case?


#1

Hi, I have a project and i need some help on the area of collision. The game is first person and the player must hit a polygon. that’s my collision. This polygon have movement and the camera as well.So, i want to know when a mouse click event happens if there is a collision to the polygon.

I was thinking may you can help with some advice or some links which going to help me.

Thanx:rolleyes:


#2

Well if your player model has an OBB associated with it, you can split that polygon into triangles and then transform the OBB to an AABB at the origin and then use that same transformation on your set of triangles. This transformation is really easy, as you map the u,v, and w axes of the box to the x, y, and z axes. Then you translate the center of the box to the origin. It’s a real simple matrix mapping, very similar to what gluLookAt does (see MESA source code).

Then, all you have to do is do several triangle/AABB intersection calculations. You can get this from:
http://www.acm.org/jgt/papers/AkenineMoller01/tribox.html.

There’s another way for arbitrary polys, and I haven’t tested it, but I don’t think it’s any faster than the above method.


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.