I have not done much maths in my high school but after much research I understand that to draw a polygon we need to define an array of float as its vertices. However I don't understand how to get the polygon to fit the texture.
I did a lot of research but couldn't find answer or simple demonstration as to how as to how do people map their texture so that the polygon fits right. All I can see is direct demonstration of array of float but not how they got each point.
As for now I am using about 8 rectangles to fill my texture for collision detection which is not very efficient.