Directional growth of metallic and polymeric nanowires