OpenGL 3 and color transitions
I am new to OpenGL and i require help...
I am trying to draw a triangle where every top is colored in a different color...
The current code that I have is :
Vector3 vertices2 = new Vector3;
vertices2 = new Vector3(1f, -1f, 0f);
vertices2 = new Vector3(-1f, -1f, 0f);
vertices2 = new Vector3(0f, 1f, 0f);
GL.GenBuffers(1, out buf2);
new IntPtr(vertices2.Length * Vector3.SizeInBytes),
GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 0, 0);
This gives me a yellow triangle. Now I wonder how to color each top differently with colors transitioning one from another as you get closer to some top....