Norman Vine writes:
>
>Well you can use glTranslate() to 'sort of' roll the HUD to stay in the
>'straight ahead' position,  but this is a 'hack' at best.

Here is some code to translate the HUD with the eye vector
for those that want to play :-)

add to mouse.cxx

#define TRANSLATE_HUD

// temporary hack until pitch_offset is added to view pipeline
void fgTranslateHud( void ) {
#ifdef TRANSLATE_HUD
  if(mouse_mode == MOUSE_VIEW) {
        float y = 0.0f;
        int ww = fgGetInt("/sim/startup/xsize");
        int wh = fgGetInt("/sim/startup/ysize");

        y = _mY - (wh >> 1);

        float x =  globals->get_current_view()->get_view_offset()
                           * SG_RADIANS_TO_DEGREES;

        if( x < -180 )
                x += 360;
        else if( x > 180 )
                x -= 360;

        x *= ww/180.0;
//      x *= ww/360.0;

        glTranslatef( x*ww/640, y*wh/480, 0 );
  }
#endif // TRANSLATE_HUD
}


add to hud.cxx

extern void     fgTranslateHud(void);

void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
                  GLfloat x_end, GLfloat y_end ) 
{
.......
    glLoadIdentity();
    gluOrtho2D(x_start, x_end, y_start, y_end);
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();

+   fgTranslateHud();
.....
}



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to