glDrawArrays(GL_TRIANGLES, 0, 3);
draws only 3 vertices if I understand correctly. So if you are only changing your constructor, and not your draw()
, you are still only drawing 3 vertices. So instead draw 6 verts for your rectangle.
Edit
You are also only buffering 3 items
glBufferData(GL_ARRAY_BUFFER, sizeof (vertices) * 3, &vertices[0], GL_STATIC_DRAW);
So what you might want to do is keep track of how many verts make up your model and then whenever you hand them over to OpenGL, you let it know what is going on. So, you need to buffer 6 verts instead of 3 and you need to draw 6 verts instead of 3.
Edit 2
Also, I think you have mismatched wind orders. Your first triangle is created counter-clockwise but your second is made clockwise. That means you are seeing the back of the triangle. Try changing it to:
float arr[18] = {
-0.5, -0.5, 0,
0.5, -0.5, 0,
-0.5, 0.5, 0,
0.5, 0.5, 0,
-0.5, 0.5, 0,
0.5, -0.5, 0
};