|
|
Well, the trick is always "interpolate".
to stricktly follow the terrain, you just have to project or intersect the path (you already have) with the polys edges it crosses, this will give you a sequence of points which you should use to interpolate your move.
Since you mentioned smooth, I have to mention that this follow the polys EXACTLY. if you want to smooth this movement, you can approximate the next path track (next two points) using at least 3 points and interpolate a function that passes over them. The interpolation method you use is up to you, there are many out there. The most smooth/continuous would be a NURB or BSPLINE (simplification of NURB) fitted using the already mentioned points.
Note however that by smoothing, you will force some interpenetration of the moving object with the terrain.
|