An agricultural harvesting machine, equipped with a movable unloading apparatus to transport crop material to a container driven in the vicinity, so that the container, seen from the harvester, has a near upper border and a remote upper border, and wherein a 3D camera is provided on the harvester for capturing images in which at least the near border can be seen, to direct the unloading apparatus based on these images. The camera is rotatable mounted around a substantially horizontal axis. The angle of rotation of the rotatable camera can be arranged such that the near border always remains in the field of view of the camera. The unloading apparatus can be controlled such that the processed crop material is deposited in the container at a predetermined distance from the near border.