# Drawing lines in 3d world

**URL:** <https://discourse.glfw.org/t/drawing-lines-in-3d-world/1434>\
**Category:** dev\
**Created:** [October 25, 2019, 3:35pm UTC](https://discourse.glfw.org/t/drawing-lines-in-3d-world/1434 "2019-10-25T15:35:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALAXX](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@ALAXX](https://discourse.glfw.org/u/ALAXX)\
**Post date:** [October 25, 2019, 3:35pm UTC](https://discourse.glfw.org/t/drawing-lines-in-3d-world/1434/1 "2019-10-25T15:35:53Z")

</div>

I am trying to draw a simple 3 axis coordinate system using glfw lines, but i can’t see any line on the scene?

```auto
    // draw some lines
        glColor3f(1.0,0.0,0.0); // red x
        glBegin(GL_LINES);
        // x aix
     
        glVertex3f(-4.0, 0.0f, 0.0f);
        glVertex3f(4.0, 0.0f, 0.0f);
     
        glVertex3f(4.0, 0.0f, 0.0f);
        glVertex3f(3.0, 1.0f, 0.0f);
     
        glVertex3f(4.0, 0.0f, 0.0f);
        glVertex3f(3.0, -1.0f, 0.0f);
        glEnd();
     
        // y 
        glColor3f(0.0,1.0,0.0); // green y
        glBegin(GL_LINES);
        glVertex3f(0.0, -4.0f, 0.0f);
        glVertex3f(0.0, 4.0f, 0.0f);
     
        glVertex3f(0.0, 4.0f, 0.0f);
        glVertex3f(1.0, 3.0f, 0.0f);
     
        glVertex3f(0.0, 4.0f, 0.0f);
        glVertex3f(-1.0, 3.0f, 0.0f);
        glEnd();
     
        // z 
        glColor3f(0.0,0.0,1.0); // blue z
        glBegin(GL_LINES);
        glVertex3f(0.0, 0.0f ,-4.0f );
        glVertex3f(0.0, 0.0f ,4.0f );
     
     
        glVertex3f(0.0, 0.0f ,4.0f );
        glVertex3f(0.0, 1.0f ,3.0f );
     
        glVertex3f(0.0, 0.0f ,4.0f );
        glVertex3f(0.0, -1.0f ,3.0f );
        glEnd();

```

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [October 26, 2019, 5:27pm UTC](https://discourse.glfw.org/t/drawing-lines-in-3d-world/1434/2 "2019-10-26T17:27:07Z")

</div>

Hi @ALAXX,

welcome to the GLFW forums.

The question you’re asking is a general OpenGL one, rather than GLFW specific, so you may also be able to find help on other forums and sites.

It’s tricky to answer your questions in detail since there are other factors in getting something to render on screen, and you’ve only shown part of the program. Your problem might be to do with the matrix for example.

You’re using ‘legacy’ fixed function OpenGL, so you should take a look at the example [boing.c](https://github.com/glfw/glfw/blob/master/examples/boing.c). You could try modifying that example to add lines using similar coordinates to the ball.

If you’re still stuck after that, please post the entire code including matrix setup etc.

Cheers,

Doug.
