This paper describes a vision-based control architecture designed to enable autonomous landing on a moving platform. The landing trajectory is generated by using the receding-horizon differential dynamic programming (DDP), an optimal control method. The trajectory generation is aided by the output of a vision-based target tracking system. The vision system uses multiple extended Kalman filters which allows us to estimate the position and heading of the moving target via the observed locations. The combination of vision-based target tracking system and the receding-horizon DDP gives an unmanned aerial vehicle the capability to adaptively generate a landing trajectory against tracking errors and disturbances. Additionally, by adding the exterior penalty function to the cost of the DDP we can easily constrain the trajectory from collisions and physically infeasible solutions. We provide key mathematics needed for the implementation and share the results of the image-in-the-loop simulation and flight tests to validate the suggested methodology.