Curvature of a Bezier *SOLVED*

Started by
12 comments, last by tomm 20 years, 11 months ago
Okay, I did a bunch of stupid work & here''s my answer: There is no expression for k(t) solely in terms of r and its derivatives when r is a 3D vector. What I mean is, the way I would find k would be to just write out the entire equation each step, instead of writing things like |v| and such. Or write a program to it for me, which I did.
BTW, what do you need curvature of a bezier for? I''m sure that the exact expression will be really complex, and there is a much simpler expression for centripetal acceleration, which might be useful
You know what I never noticed before?
Advertisement
I''ve finally managed to solve the problem, it turns out there was an error in the way I calculated |v|'', I was forgetting to divide by 2 when differentiating the square root:

Incorrect equation:
|v|'' = ((v.x^2)'' + (v.y^2)'' + (v.z^2)'') / |v|

Corrected equation:
|v|'' = ((v.x^2)'' + (v.y^2)'' + (v.z^2)'') / (2*|v|)

Everything works just great now.

In the game I''m working on (which I can''t really talk too much about), I have a large number of objects that need to move at a constant speed along Bezier strips. To reduce the number of times I need to sample the curve I split the Beziers into a number of line segments, which are faster to evaluate. Obviously, the lower the curvature of the Bezier, the fewer line segments are needed to represent within some margin of error. Initially I was looking for a good measure of curvature instead of just using a rough heuristic, but in the end the problem started really bugging me and I just had to get it solved.

Thanks for all your help, it realy was greatly appreciated.
I spent a couple of minutes simplifying the equations and the solution turns out to be quite elegant:

dT/ds = (v'' / |v|^2) - (v * (v.v'') / |v|^4)
Glad to help. I got that equation too, but I''ve never seen it anywhere else, so I hesitated to use it. I guess it does work, though.
You know what I never noticed before?

This topic is closed to new replies.

Advertisement