Laser scanning microscope for scanning along a 3D trajectory