Hello, i recently got into coding with opengl, and i’ve got a question about the glVertex function.
Lets say i have this code. (note that its just the part i have a question about i left the rest out.)
// Called to draw scene
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
glLineWidth(2);
// Draw the line
glBegin(GL_LINES);
glVertex3f(0.0f, 90.0f, 0.0f); //??? draws a vertical line upwards...
glVertex3f(0.0f, 0.0f, 0.0f); //???
glEnd();
// Flush drawing commands
glutSwapBuffers();
}
This codes draw a vertical line for me. But the thing i dont understand is… How does it know when to draw vertical or horizontal etc… I tried playing with the function and add numbers in it to see what the output would show me but it keeps confusing me.
I know the first values are (x, y, z) but when does it know when to draw vertically or horizontal?? Can someone please clear this up for me.