Question about the 4 point bezier spline

Blitz3D Forums/Blitz3D Programming/Question about the 4 point bezier spline

Ross C(Posted 2009) [#1]
Or the 3 point... I am currently coding some waypoint stuff, whereby an enemy follows a set of waypoints, round a course (tower defence type thing). The waypoints are static. I'm trying to find a way to make the enemies smoothly traverse the waypoints and i though about the 3 and 4 point beziers, Stevie G posted a while back.

Would they be suitable for this type of thing, as i need the enemies to travel at precise speeds?

I'm currently using a pivot to go directly to each waypoint and have the enemy follow, always pointing towards the pivot, getting a smooth-ish result. Only problem is the enemies are also having to stay behind the pivot, as they will gain ground on the pivot, because they are following the pivot. I would rather use a more elegant approach, than pivots.


Warpy(Posted 2009) [#2]
It's hard to work out the length of a bezier spline exactly because the curve is defined implicitly rather than explicitly.

Because you have to approximate it anyway in the computation, you could calculate a number of points from each spline and move between them in a straight line, at a constant speed.


Ross C(Posted 2009) [#3]
Ah, i suppose i could do :o) Thanks man. Doesn't seem like an easy way to do this really.