To draw a triangle we need three points and join them to make a triangle .
//glColor3f(1.0f, 1.0f, 0.0f); //yellow
glColor3f(0.0f, 1.0f, 0.0f); //Green
glColor3f(0.0f, 1.0f, 0.0f); //Green This line used for color (RGB).
glBegin(GL_TRIANGLES); This function is used to create Triangles. like GL_LINE_LOOPS are use to join points.
And finally we are drawing triangle by supply the value of X and Y vertex. the above function will join them and make a triangle.
Try changing position and color of your triangle.