Specifying the Vertices of our First Triangle (cont’d)

An initial approach

void main() {
    if (gl_VertexID == 0) {
        gl_Position = vec4(1.0, 0.0, 0.0, 1.0); 
    }
    else if (gl_VertexID == 1) {
        gl_Position = vec4(-0.5, 0.866, 0.0, 1.0);
    }
    else { // gl_VertexID == 2
        gl_Position = vec4(-0.5, -0.866, 0.0, 1.0);
    }
}