glfw draw line

Solutions on MaxInterview for glfw draw line by the best coders in the world

showing results for - "glfw draw line"
Alex
21 Jan 2019
1      glColor3f(1.0,0.0,0.0); // red x
2        glBegin(GL_LINES);
3        // x aix
4     
5        glVertex3f(-4.0, 0.0f, 0.0f);
6        glVertex3f(4.0, 0.0f, 0.0f);
7     
8        glVertex3f(4.0, 0.0f, 0.0f);
9        glVertex3f(3.0, 1.0f, 0.0f);
10     
11        glVertex3f(4.0, 0.0f, 0.0f);
12        glVertex3f(3.0, -1.0f, 0.0f);
13        glEnd();
14     
15        // y 
16        glColor3f(0.0,1.0,0.0); // green y
17        glBegin(GL_LINES);
18        glVertex3f(0.0, -4.0f, 0.0f);
19        glVertex3f(0.0, 4.0f, 0.0f);
20     
21        glVertex3f(0.0, 4.0f, 0.0f);
22        glVertex3f(1.0, 3.0f, 0.0f);
23     
24        glVertex3f(0.0, 4.0f, 0.0f);
25        glVertex3f(-1.0, 3.0f, 0.0f);
26        glEnd();
27     
28        // z 
29        glColor3f(0.0,0.0,1.0); // blue z
30        glBegin(GL_LINES);
31        glVertex3f(0.0, 0.0f ,-4.0f );
32        glVertex3f(0.0, 0.0f ,4.0f );
33     
34     
35        glVertex3f(0.0, 0.0f ,4.0f );
36        glVertex3f(0.0, 1.0f ,3.0f );
37     
38        glVertex3f(0.0, 0.0f ,4.0f );
39        glVertex3f(0.0, -1.0f ,3.0f );
40        glEnd();