# 3D Flight Path Generation and applying a curve to x,y,z

I made a little critter that roams around.

``````var boundary = 10.0;
var startingPoint = <0.0,0.0>
var destination = startingPoint+<randMinMax(boundary-(boundary*2),boundary),randMinMax(boundary-(boundary*2),boundary)>;
``````

It generates a random destination (x,y) within a 10 meter area around its starting point. It then moves to that point, stops, then generates a new point, turns around and faces to the new point, and continues toward it. When it reaches its destination it does the same thing over and over.

This is sufficient for just wandering around using x,y but for flight I want to implement the use of the z axis. So I modified a copy of the script to do the same thing to the z axis, with tweaks and hacks it looked alright flying around, but it appears too programmatic.

I want to take flight to the next level, now I'm not great at math, and a google search shows that 3X^2 + 4X + 6 = 0 can help me calculate a curve, I am looking for advise on how I can apply this to curve the travel when the critter reaches its destination so as to create a 'swooping' movement effect as it moves around (curved x,y,z) to its new destination. This all is begining to seem quite complicated, and I realize that the flight path cant be so random.

Has anyone got any advise for generating 3d flight paths , or assistance applying curve to x,y,z ?

Cheers

C

-