As you can understand from the title, I'm pretty new to game development. I'm doing this for fun. Anyway here's my question.
I have this Farseer Physics samples and i've been studying them for a few days. One thing i can't understand is, how the vertices creates the shape? I mean, in the game sample, where you create a shape for your car from vertices, there is a code like this:
Vertices vertices = new Vertices(8); vertices.Add(new Vector2(-2.6f, 0.10f)); vertices.Add(new Vector2(-2.375f, -0.46f)); vertices.Add(new Vector2(-0.58f, -0.92f)); vertices.Add(new Vector2(0.46f, -0.72f)); vertices.Add(new Vector2(2.7f, -0.07f)); vertices.Add(new Vector2(2.5f, 0.205f)); vertices.Add(new Vector2(2.3f, 0.23f)); vertices.Add(new Vector2(-2.55f, 0.35f)); PolygonShape chassis = new PolygonShape(vertices, 2f);
I understand you create a vertices list and add 8 points(?) to it and then you make a polygonshape from those vertices, a random shape created from your points(?). The thing i can't understand is what are those numbers which inside the Vectors? I mean where in the shape are those? Corners? Edges? or a line between those two floats? Or the line between the corners?
Now lets say I want to make a shape like this
What are those vertices for this picture? You can give random numbers thats not a problem, only thing I want to understand is, what are those Vectors on this picture? Thank you very much for your help and time.