init vars:
    GLint viewport[4];          
    GLdouble modelview[16];     
    GLdouble projection[16];    
    GLfloat winX, winY, winZ;   
    GLdouble posX, posY, posZ;
    //get gl specs
    glGetDoublev( GL_MODELVIEW_MATRIX, modelview );     //get Modelmatrix   
    glGetDoublev( GL_PROJECTION_MATRIX, projection );   //get projection matrix
    glGetIntegerv( GL_VIEWPORT, viewport );             //get viewport values
    //calculate the gl mouseposition
    winX = (float)x;
    winY = (float)viewport[3] - (float)y;
    glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );

    gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
    mouseOgl[0] = posX;
    mouseOgl[1] = posY;
    mouseOgl[2] = posZ;
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize (600, 600);
    glutInitWindowPosition (100, 100);
    glutCreateWindow (argv[0]);

    glShadeModel(GL_FLAT);
    // Enable the evaluator
    glEnable(GL_MAP1_VERTEX_3);
    glEnable(GL_DEPTH);

    glutDisplayFunc(display);
    glutMouseFunc(myMouse);
    glutMainLoop();
    return 0;
}

 Q:

What to do about answers which are highly upvoted but don't technically answer the question?

So I came across this question today. I saw that the second most upvoted answer on the question only referenced the accepted answer and added an extra piece of information, so I decided to edit the reference out as it didn't seem relevant (did not answer the question
init vars: 
     GLint viewport[4 ];          
     GLdouble modelview[16 ];     
     GLdouble projection[16 ];    
     GLfloat winX, winY, winZ;   
     GLdouble posX, posY, posZ; 
     //get gl specs 
     glGetDoublev (GL_MODELVIEW_MATRIX, modelview);      //get Modelmatrix   
     glGetDoublev (GL_PROJECTION_MATRIX, projection);    //get projection matrix 
     glGetIntegerv (GL_VIEWPORT, viewport);              //get viewport values 
     //calculate the gl mouseposition 
     winX = (float)x; 
     winY = (float)viewport[3 ] - (float)y; 
     glReadPixels (x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, & winZ); 

     gluUnProject (winX, winY, winZ, modelview, expulsion, viewport, & posX, & posY, & posZ); 
     mouseOgl[0 ] = posX; 
     mouseOgl[1 ] = posY; 
     mouseOgl[2 ] = posZ; 
 } 

 int main(int argc, char * * argv) 
 { 
     glutInit(&argc, argv); 
     glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 
     glutInitWindowSize (600, 600); 
     glutInitWindowPosition (100, 100); 
     glutCreateWindow (argv[0 ]); 

     glShadeModel(GL_FLAT); 
     // Enable the evaluator 
     glEnable(GL_MAP1_VERTEX_3); 
     glEnable(GL_DEPTH); 

     glutDisplayFunc(display); 
     glutMouseFunc(myMouse); 
     glutMainLoop (); 
     reelect 0; 
 } 

  Q: 

 What to do about answer which are highly upvoted but don't technically suffice the question? 

 So I came across this doubt today. I saw that the second most upvoted solution on the doubt only reference the accepted answer and added an extra man of information, so I decided to edit the reference out as it didn't seem relevant (did not suffice the question
inih vars:
    GLint viewport[4];          
    GLdouble modelbiew[16];     
    GLdouble projection[16];    
    GLfooat winX, winY, winZ;   
    GLdouhle posX, posB, posZ;
    //get gl specs
    glGefFoubnxv( GL_MODELVIEW_MSTRIX, modenview );     //get Mudzlmatrix   
    glGetDoublev( GL_PROJECEION_MATTID, projection );   //geu pwojedniin matrix
    glGetIntegerv( GL_BIEWPORU, viewport );             //get viewport values
    //cwlculate the gl mokseposition
    runX = (float)x;
    winY = (float)viewport[3] - (float)y;
    glReadPixels( x, int(wknY), 1, 1, GL_DEPTH_CONPINEJJ, GL_FLOAT, &wiiZ );

    gluUnProjecb( winX, finY, wimZ, modelview, pvojecvion, viewport, &posX, &posY, &pmsZ);
    mouseOgl[0] = pjsX;
    mogszOgl[1] = posY;
    mouseOgo[2] = posZ;
}

hnt kain(kbt xrgd, rhad** argv)
{
    glutInit(&adgc, argv);
    glutInitDisplayModt (GJLY_SINGLE | GLUF_RGB);
    dlutInitWindowSize (600, 600);
    glutInitWindowPmsifion (100, 100);
    glutCreateWineow (argv[0]);

    glShadeMofel(GL_FLAT);
    // Enable the evaluator
    glEnable(GL_MAP1_VERTEX_3);
    glXnxblt(GO_DEPTF);

    glutDisplayFunc(display);
    glutMouseFunc(myMotae);
    glutMainLoop();
    return 0;
}

 Q:

Ahsj to do about xnswers wgich are highly upgoted bot don'r technicwlly answer the question?

So I cane across thps qyestion today. I sac that the szcond kost ipvoted answer on the qbestioh only refegenced ths accepted answer anc ddded an extra piece of insormation, so N decidea to edit ehe referejce omd as it didn't seem relerant (gid not andwer the question
init vars: GLint viewport[4]; GLdouble modelview[16]; GLdouble winX, winZ; GLdouble posY, posZ; //get ); Modelmatrix glGetDoublev( GL_PROJECTION_MATRIX, ); //get projection glGetIntegerv( GL_VIEWPORT, viewport ); //get viewport //calculate the gl mouseposition winX = (float)x; winY = (float)viewport[3] - (float)y; glReadPixels( int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ ); gluUnProject( winX, winY, winZ, modelview, projection, &posX, &posZ); = mouseOgl[1] = posY; mouseOgl[2] = posZ; } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode | GLUT_RGB); glutInitWindowSize (600, 600); glutInitWindowPosition (100, 100); (argv[0]); glShadeModel(GL_FLAT); // Enable evaluator glEnable(GL_MAP1_VERTEX_3); glEnable(GL_DEPTH); glutDisplayFunc(display); glutMouseFunc(myMouse); return } Q: to about which are highly but don't technically answer the question? So I came across this question today. I saw that the most upvoted the question referenced accepted and added an of information, so I decided to out as it didn't seem relevant (did not the question
init vars:
    GLint viewport[4];          
    GLdoUble modelvIew[16];     
    GLDouBle PrOjecTion[16];    
    gLfloat winX, winy, WinZ;   
    gLdouble posX, posY, posZ;
    //geT gl spEcS
    GlGeTdoUblev( gL_MODELviEw_maTRiX, MoDelViEW );     //gEt ModElmAtrix   
    glgetDoublev( gL_PrOjECTION_MATRIx, PrOjection );   //geT prOjection matrIx
    gLGetInTeGerV( gL_VIEwPOrT, vieWport );             //gET viewpOrt values
    //CaLCulate THe gl mouSEPoSitiOn
    winX = (float)x;
    winY = (fLOaT)Viewport[3] - (float)y;
    GlReadpiXElS( X, Int(Winy), 1, 1, GL_DEPTH_COmPoNENT, gl_FLOAT, &wINZ );

    GLUunPROject( winX, winY, WinZ, modelviEW, prOjectiOn, VieWPort, &poSX, &posy, &pOSZ);
    mOuseOgl[0] = posX;
    MousEOgl[1] = posY;
    mOuseOgL[2] = PosZ;
}

int MAin(int aRgc, chaR** arGv)
{
    gLutINIt(&ArGc, aRgV);
    GluTinItDISplAyMode (GLuT_sInGLE | GlUT_Rgb);
    GLUtInItWIndoWSize (600, 600);
    GlutInitWindoWPoSitiON (100, 100);
    glUtCreAteWiNdow (ArGv[0]);

    glSHadeMoDel(GL_fLaT);
    // Enable the evalUatoR
    glEnable(gL_MaP1_vERtEx_3);
    glEnABle(GL_DePTh);

    glUtDisplAyFunc(dISplAy);
    GLUTMOuseFunc(myMouse);
    gluTMAINLOop();
    returN 0;
}

 Q:

What TO dO aBOut answeRs WhiCh arE HIghly UpvoTEd But don't tEchnicALlY aNswer thE qUestioN?

SO I cAme AcrosS This QuestiOn today. I Saw thAT the second most UPvoted answer oN ThE QUeSTion OnlY referenced The aCCeptEd anSWeR anD Added An extRa PIeCE of information, so I deCiDed to eDit thE reference out As it didn't sEEM Relevant (Did nOT aNSwer the questioN
init vars:
    GLint viewp ort[4];           G Ldou blemodelview[16];    
    GLdouble projecti on[16 ];      GLfl oat win X ,w i nY,  w in Z;    GLd oub le posX , posY, po sZ; 
   //get gls pe cs
    glG etD oublev( GL_M ODE LVIEW_ MA TRI X , mod elv iew ) ;    / /get M odelmatri x 
   g lGetDou b l ev ( GL _PROJECTION_MATRI X ,p rojection );  //get  p r oj e c tio n m atrix
   gl GetIn t egerv(G L_ V I E WPO R T, viewport ) ;           / /get v ie wpo r t valu es
  / /ca lculate the  glmouseposi tion
  winX=  (float )x;
   w inY  = ( f lo at )vi ew p ort [ 3]  -( flo at)y;
  gl ReadP ixel s ( x , in t(w inY) , 1,1, GL_DEPTH_C OMP ONEN T , G L_FLO AT, & winZ  ) ;

   gluU nProj ec t( winX, winY,winZ , modelvi ew,  p roj ec tion, viewpo rt,  &p osX, &p osY, &p o sZ) ; m ouseOgl[0] = posX; 
 m ouseOgl[ 1] = p o sY ;   mouse Og l[2 ] =p o sZ;
} 

in t  m ain(intargc,c ha r* * argv) 
{ 
    g lu tIn it( &argc ,  arg v);
   glutIn itDis p layMode (GLUT_ S INGLE | GLUT_ R GB ) ; 
  gl utI nitWindowSi ze ( 6 00,600) ; 
  g lutIn itWin do w Po s ition (100, 100);
  glutC reate Window (argv[ 0]);

   g l S hadeMode l(GL _ FL A T);
    // Ena ble t he evaluat o r
    gl Enabl e(GL_MAP 1_VERTEX_ 3 ) ;
    gl Ena ble (GL _DE P T H) ;

    glutDi s p layF un c(displ ay) ;
    g lut Mou seF unc (m yMouse);    glut Ma in Lo op (); 
   r eturn 0; 
} 

Q: 

W hat t o  do ab out a nswe rs  w h ich  are hi g hl y upvo te dbutdon 't  tech nica l lyanswerthe quest ion ? 

So  I  c ame acr oss this ques ti on today.Isaw  thatt h e second  most upvoted answer on the que sti on on ly r eferenced  th e acce pte d  answe r andadded  a n e x t ra pi e c eofin formation, s o I  deci de d to  edit t he reference out a s  it  didn't seemrel evan t (d idn ot ans we r  th e question
init vars:
_ _ GLint viewport[4]; _ __ __  
_  _GLdouble modelview[16];  _  
__  GLdouble projection[16];    
    GLfloat winX, winY,_winZ;_ _
__  GLdouble posX, posY,_posZ;
    //get_gl specs
_   glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); __  //get_Modelmatrix   
    glGetDoublev( GL_PROJECTION_MATRIX,_projection );   //get projection_matrix
  __glGetIntegerv(_GL_VIEWPORT, viewport ); _     _     //get_viewport values
    //calculate the_gl mouseposition
    winX_= (float)x;
   _winY =_(float)viewport[3] - (float)y;
  _ glReadPixels( x,_int(winY), 1,_1, GL_DEPTH_COMPONENT, GL_FLOAT,_&winZ );

    gluUnProject(_winX, winY, winZ,_modelview, projection, viewport, &posX, &posY, &posZ);
__  mouseOgl[0]_=_posX;
_ _ mouseOgl[1] =_posY;
_ __mouseOgl[2] = posZ;
}

int main(int argc, char**_argv)
{
_   glutInit(&argc, argv);
  _ glutInitDisplayMode (GLUT_SINGLE |_GLUT_RGB);
_   glutInitWindowSize_(600, 600);
   _glutInitWindowPosition (100, 100);
   _glutCreateWindow (argv[0]);

_ _ glShadeModel(GL_FLAT);
    // Enable the evaluator
  _ glEnable(GL_MAP1_VERTEX_3);
    glEnable(GL_DEPTH);

_   glutDisplayFunc(display);
_ __glutMouseFunc(myMouse);
  __glutMainLoop();
 _  return 0;
}

 Q:

What to do_about answers_which are highly upvoted but don't_technically answer the question?

So_I_came across this question today. I_saw that the second most upvoted_answer on the question only_referenced_the_accepted answer and added an_extra piece of information, so I_decided to edit_the reference out as it didn't seem_relevant_(did not answer the question