|
-
Apr 27th, 2006, 12:49 PM
#1
Collision detection between bezier and ball.
OK, I got a really weird problem. I have a cubic bezier curve in 3d space and a sphere. The bezier curve is static, the sphere moves. Given the curve's definition a, c1, c2, e, each of which is a 3d vector, and the ball's position and movement vector, I need to find out the closest the bezier and the ball ever get to each other.
This is probably confusing.
Code:
Ball
{
Vector3d center;
Vector3d movement;
}
Bezier
{
Vector3d start;
Vector3d control1;
Vector3d control2;
Vector3d end;
}
Find
1) the least distance between any point on the bezier curve and any point on the line segment (Ball.center, Ball.movement).
2) the point on the line segment that is closest.
3) the bezier parameter t of the point on the bezier that is closest.
Given these three, I can achieve the other things I need to do.
Any ideas are GREATLY appreciated! I've been sitting on this for 2 days, and it has mostly given me a headache.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|