Sign in to follow this  
h4tt3n

Looking for articles on object - spline collision

Recommended Posts

Hello there,

I'm looking for articles or tutorials explaining how to do spline - particle collision detection in 2d. I'm interested in topics like how to find the closest point on a spline relative to a given point, and how to find the tangent and normal vectors for any given point on a spline. I'm mainly concerned with Catmull-Rom splines and cubic Hermite splines. I'm still struggling with the math behind them, but I've managed to setup a simple particle - polynomial collision system, and I hope to work my way up from there, since splines are a form of polynomials too. Please let me know about any good resource covering these topics.

Cheers,
Mike

Share this post


Link to post
Share on other sites
Ok, now I got around calculating the (normalized) tangent and normal vectors of an arbitrary point on a catmull-rom spline. The tangent is derived from the first derivative of the spline, of course, and then you simply find the normalized normal of that. Collision resolution with friction is relatively easy from there. I still haven't found a way to determine the closest point on a spline, though, and any feedback on that would be appreciated.

Cheers,
Mike

Share this post


Link to post
Share on other sites
I don't have any first-hand knowledge, but some of these links seem promising: [url="http://www.google.com/search?q=closest+point+on+spline"]http://www.google.com/search?q=closest+point+on+spline[/url]

One thought is that splines for collision detection seem like more trouble than they're worth -- fitting them into a spatial partition (grid or SAP or whatever) seems like it would be a pain. Maybe it's better to just approximate them with linesegs?

Share this post


Link to post
Share on other sites
Yes, all the methods I've skimmed through are based on some sort of approximation, for instance by dividing the spline up into discrete line segments. I'll probably be going for that solution too if nothing better comes up. I really want to do this, one way or the other - I'm just fed up with polygons :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this