Heredity and learning in animal orientation