Electron capture from H2targets by H+and He2+ions. Dependence of the cross sections on the orientation of the molecular axis