Edit: After reviewing your code, here is the list of the bugs, the most important ones are 3), that messed up all the rendering, and 4) the correction for the camera rotation code
Off by one error in void setupGrid(), change "<=" to "<" in the while
while(_i<GRID_SIZE){
set the initial camera position to {0, 0, 5} in Initialize(), otherwise you wont see the boxes:
player.camera.position.x=0; player.camera.position.y=0; player.camera.position.z=5; player.camera.rotation.x=0; player.camera.rotation.y=0; player.camera.rotation.z=0;
in Reshape change 3rd param of gluPerspective to 1.0
gluPerspective(45.0,(double)screenWidth/(double)screenHeight,1.0,CUBE_UNIT*100.0);
Finally the correction of the camera rotation code in Keyboard2() like already written above
void Keyboard2(int key,int x,int y){ switch(key){ case GLUT_KEY_F1: if(!wireframe){ glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); wireframe=TRUE; }else{ glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); wireframe=FALSE; } break; case LOOK_UP: player.camera.rotation.x+=5.0; break; case ROTATE_LEFT: player.camera.rotation.y+=5.0; break; case LOOK_DOWN: player.camera.rotation.x-=5.0; break; case ROTATE_RIGHT: player.camera.rotation.y-=5.0; break; }; return; }