A computational approach to understanding visually guided behaviours in insects