Recent advances in small unmanned air vehicles (UAV) lead to robust on-board stabilized platforms ready to use for real-world problems. As a result, many different autonomy functions have been demonstrated, which allow controlling the UAVs at high level. However, the great variety of platforms also poses new challenges when adapting these autonomy functions to new platforms. For instance modifying a trajectory planning algorithm, which was designed for a rotary-aircraft with a moving camera, to work on a fixed-wing aircraft with a static camera is not a trivial task. Often such algorithmic solutions are tailored so specifically to a certain platform that it becomes very complicated to reuse algorithms. This results in a variety of many different approaches trying to solve the same task. We therefore encourage designing algorithms for UAVs autonomy function to be more generic. As an example, we focus on the task to autonomously follow a moving ground object using an UAV. We present two trajectory planning methods: a baseline method suitable that has been developed just for one specific platform, and our proposed flexible optimal-control-based method suitable for a variety of platforms. The original waypoint-based flight planning approach has been evaluated in real world experiments, and while it was capable of dealing with the missions it was designed for, its limitations impeded further development into other UAV platforms. Therefore, in this work, we evaluate the new optimal control based approach in simulated scenarios similar to those used in the original missions, demonstrating the superiority and greater flexibility of the later one in a set of different scenarios and two distinct UAVs models, one being a fixed wing aircraft and the other a helicopter.