XYZ coordinates on the bottom right corner of the screen

What is the best way to draw XYZ coordinate system on the bottom right corner of the screen.

Should you do this with OpenGL or with gdi?
Does anyone know of source code to do this?



Try something like this:

glGetIntegerv glgViewport, vp(0)

glClear clrDepthBufferBit 

glMatrixMode mmProjection

  'create orthographic box for axes
  glOrtho -3, 3, -3, 3, -3, 30
  glMatrixMode mmModelView
    'get the camera angle relative to model
    'to properly postion the axes

    gluLookAt 0, 0, 5, 0, 0, 0, 0, 1, 0 

    GetCurrentRotMatrix m16()
    glMultMatrixf m16(0)

    'place axes in the corner 
        glViewport vp(2) - vp(3) * 0.325, 0, vp(3) * 0.325, vp(3) * 0.325

    'draw axes here
  glMatrixMode mmProjection
glMatrixMode mmModelView

'restore viewport
glViewport vp(0), vp(1), vp(2), vp(3)

Thanks Pat.

I will certainly try this.

Sorry Pat.

I implemented your code and it is working quite ok. I just have one problem. I need to erase the transformation matrix before I call the existing matrix.

This is becuase I want to isolate only the rotation and not the whole transformation which includes translations.