added function to make texture mapping more convenient