Image files are rectangular, yet in a 3D environment, a rectangle will appear as an irregular quadrilateral most of the time. Consider the following image (credit to this blog):
Given that:
- you already know the four vertices of the green face
- you have access to the image file as a 2D array of color values
- you are drawing to a screen that is a 2D array of pixels
What is the algorithm that OpenGL uses for drawing the image onto the green face?