Bezier curve for motion prob

Started by
11 comments, last by dmatter 20 years ago
My math isnt exactly amazing, what are df, dt, dg and dh?

s = integral from L0 to L of sqrt((df/dt)^2+(dg/dt)^2+(dh/dt)^2))dt

How do you get an integral?
Some unoptimized code snippets might help explain better (or just complicate things more?)

Currently I'm rtying to implement a method by creating a table for all the points and then picking out those points that are evenly spaced. I dont think its too accurate and the method you are describing is probably more accurate - is it fast? -

[edited by - dmatter on April 4, 2004 3:24:37 PM]
Advertisement
Look at url above it is math heavy though to understand. It has some code there I didn't read all of it though.

df/dt, dg/dt, dh/dt are derivatives of f with repect to t, g with repect to t and h with repect to t.

[edited by - O_o on April 4, 2004 2:21:52 PM]
quote:Original post by dmatter
Is this how all games create smooth curved motion or is there a better way of doing it, perhaps another type of curve will do what I need?
I found a link which seems to be related to what I described:
http://gamedev.net/community/forums/topic.asp?topic_id=99623



[edited by - dmatter on April 4, 2004 1:37:13 AM]


This method of reparameterization is pretty standard. I don''t know of any parametric curves where increasing u linearly will create a smooth path along the curve.

It''s not all that complicated once you get past the math, which can be a little tedious. Anyways, when i calculate arc length, i''d usually just subdivide the arc and take the sum of the linear distances between the additional points. For example, if i want to find the length of the arc from u = 0 to u = 0.10, I''d calculate it as something close to the distance between the point when u=0 and u = 0.01 plus the distance between u = .01 and u = .02 and so on. This method is not be perfect and it has some flaws (as i''m sure people will be pointing out beneath me), but it will work reasonably well in most cases, as long as you subdivide enough times. After all, you don''t need the motion to be perfectly smooth mathematically, you just don''t want the user to be able to notice the difference.

This topic is closed to new replies.

Advertisement