Molecular-orbital X-rays and their anisotropies in heavy-ion collisions in solids and gases