I'm having problems moving triangles to another column. I'm able to successfully add them to right direction (in the picture), but when I want to move them into a new column it takes points from old points (furthest on the right) and I would like to have them connected to the upper triangles as I elevate the mesh, the strip will make the mesh rise.
// triangles without a new column
std::vector<triangle_vertices_t> vertices = {
{ {0, 0, 0}, {1, 0, 0}, {0, 0, 1} },
{ {1, 0, 0}, {0, 0, 1}, {1, 0, 1} },
{ {0, 0, 0 + 1}, {1, 0, 0 + 1}, {0, 0, 1 + 1} },
{ {1, 0, 0 + 1}, {0, 0, 1 + 1}, {1, 0, 1 + 1} }
};
// vertices with a new column
std::vector<triangle_vertices_t> vertices = {
{ {0, 0, 0}, {1, 0, 0}, {0, 0, 1} },
{ {1, 0, 0}, {0, 0, 1}, {1, 0, 1} },
{ {0, 0, 0 + 1}, {1, 0, 0 + 1}, {0, 0, 1 + 1} },
{ {1, 0, 0 + 1}, {0, 0, 1 + 1}, {1, 0, 1 + 1} },
{ {1 - 1, 0, 0}, {1 - 1, 0, 1}, {0 - 1, 0, 1} },
{ {-1, 0, 0}, {1 - 1, 0, 0}, {-1, 0, 1} },
};
//drawing the triangles
glBindVertexArray(m_vao);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 3 * amount_of_triangles);
glBindVertexArray(0);
So my question is, how can I add a column while connecting to the upper triangles?


