Point in triangle?

Started by
21 comments, last by DevLiquidKnight 20 years, 1 month ago
Ok i figured it out my own I got a polygon->sphere->polygon collision system working for my .x file mesh now, works very well now.

Im going to add some sort of tree algorithm to speed it up and then, figure out what to do next with my engine, thanks for help everyone. Maybe I try using a vertex/pixel shader next, or something else 0.o running out of things to add maybe physics ? sense this has no physics right now

[edited by - DevLiquidKnight on March 24, 2004 9:30:41 PM]
Advertisement
This is rediculous. You are doing bounding volume approximations for single tri collisions? Why can you not be bothered to actually understand what you are doing and take 5 minutes to learn the "proper" method?
I do understand what im doing, correct me if im at all wrong.

I take the polygon's vertices and the users location in 3d space, use a radius to determain a paramaeter to restrain the user from.

I then take the Normal of the polygon, then determain if the sphere is in front, behind, or intersects the plane.

If it intersects we have to find the offset of the intersection which is the normal * distance.

Where distance is defined as:

float d = (float)PlaneDistance(normal, user_pos);
distance = (normal.x * user_pos.x + normal.y * user_pos.y + user_pos.z * user_pos.z + d);

Then check if the intersection point is inside the polygon. If it is we obviously have colldied. If its not we have not collided.

[edited by - DevLiquidKnight on March 24, 2004 9:48:09 PM]

This topic is closed to new replies.

Advertisement