I am trying to render the letter T, but it looks like its missing one point. When I am rendering a normal octagon, it appears like it should.
Here are the vertices for letter T and a normal octagon (the first three floats are (x,y,z) and the other three are (r,g,b) for color):
GLfloat octagonVertices[] = {
0.50f, 0.20f, 0.00f, 0.46f, 0.80f, 0.46f,
0.50f, -0.20f, 0.00f, 0.46f, 0.80f, 0.46f,
0.20f, -0.50f, 0.00f, 0.46f, 0.80f, 0.46f,
-0.20f, -0.50f, 0.00f, 0.46f, 0.80f, 0.46f,
-0.50f, -0.20f, 0.00f, 0.46f, 0.80f, 0.46f,
-0.50f, 0.20f, 0.00f, 0.46f, 0.80f, 0.46f,
-0.20f, 0.50f, 0.00f, 0.46f, 0.80f, 0.46f,
0.20f, 0.50f, 0.00f, 0.46f, 0.80f, 0.46f
};
GLfloat tauVertices[] = {
-0.01f, 0.45f, 0.00f, 1.00f, 0.00f, 0.00f,
0.68f, 0.45f, 0.00f, 1.00f, 0.00f, 0.00f,
0.68f, 0.36f, 0.00f, 1.00f, 0.00f, 0.00f,
0.39f, 0.36f, 0.00f, 1.00f, 0.00f, 0.00f,
0.39f, -0.45f, 0.00f, 1.00f, 0.00f, 0.00f,
0.28f, -0.45f, 0.00f, 1.00f, 0.00f, 0.00f,
0.28f, 0.36f, 0.00f, 1.00f, 0.00f, 0.00f,
-0.01f, 0.36f, 0.00f, 1.00f, 0.00f, 0.00f
};
Here is my vertex buffer:
glBindVertexArray(vao[1]);
glBindBuffer(GL_ARRAY_BUFFER, vbo[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(tauVertices), tauVertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (const void*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (const void*)(3 *
sizeof(GLfloat)));
glEnableVertexAttribArray(1);
And here is how I render my shape:
glBindVertexArray(vbo[1]);
glDrawArrays(GL_POLYGON, 0, 8);