I am trying to draw a convex shape with points that the user types in. I am having an issue where the shape does not show up if there are two points, And if there are more than two points, the shape is offset and does not connect the points I want. The program starts by asking how many points they want, and it calls this number n. I then store the X and Y coordinates in a vector, which I call whenever I need the points. Here is the code I am trying to use to draw the shape
shape.setPointCount(n);
for (int a = 0; a <= n-1; ++a) {
shape.setPoint(a, Vector2f(xc[a], yc[a]));
}
Xc is the vector I use to store x coordinates, and yc is the vector I use to store Y coordinates. I later draw this shape. Why does this only work with more than two points, and why Is it offset when it does work?