I would like to scale up a polygon defined on cords below. How can I do that?
float cords[8] = {
x1,y1,
x2, y2,
x3, y3,
x4, y4
};
I suggest you read-up on linear transformations, but basically you just multiply each element of your array by a scaling matrix.
But I suppose if all you're trying to do is scale the points (or vertices) of a polygon, you could simply iterate through the array and multiply it by a scaling factor...
If you scale the data by itself, it will induce a translation. You need to center it on the origin first, then scale it, and THEN you can translate it to its correct position.