Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Drawing 3D coordinate system

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    20

    Drawing 3D coordinate system

    Hello,

    I'm about to draw a 3D scene with one part centered about three axis. I would need to draw the scene's origin in the lower left corner as a 3D axis system (red, green, blue).
    I was trying to do that by first drawing a solid cylinder with a cone at the end but the shading on the arrows is not realistic.
    Does someone know how to draw that ?

    Thanks a lot !!

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    3

    Re: Drawing 3D coordinate system

    I'd just disable the lighting
    glDisable(GL_LIGHTING); // No shading

    then draw three GL_LINES, in the positive cartesian directions (i.e. semi-axes). If you colour them red, green and blue respectively, it'll be obvious which is which. They will meet at the origin, which will indicate where the origin is. If you only draw half-axes then you don't need arrows, plus the picture is less cluttered.

    Oh, and remember to re-enable the GL_LIGHTING.

    HTH.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    20

    Re: Drawing 3D coordinate system

    Thanks Irina!
    I forgot to mention that I'm using the Tao framework in order to display and manipulate 2D/3D surfaces. Not sure if this will change anything...
    I can draw GL_LINES without any issue, and the three axis looks fine, however the gluCylinder doesn't have a realistic 3D texture and color with dynamic shading and sharpness appearance.
    The guys from Eyeshot have on the index page a sample of what I would need.
    I thought someone already did something similar.
    Thanks in advance for any hint !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •