#define KEY_DOWN(vk_code)((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
然后
BOOL baiscobj::DisplayScene()
{
float speed=0.2f;
if (KEY_DOWN(VK_SHIFT)) speed =speed*4;
if (KEY_DOWN(VK_LEFT)) g_Angle-=speed*2;
if (KEY_DOWN(VK_RIGHT)) g_Angle+=speed*2;
rad_xz = float (3.13149* g_Angle/180.0f);
if (KEY_DOWN(33)) g_elev +=0.2f;
if (KEY_DOWN(34)) g_elev -=0.2f;
if (g_elev<-100) g_elev =-100;
if (g_elev> 100) g_elev = 100;
if (KEY_DOWN(VK_UP))
{ g_eye[2]+=sin(rad_xz)*speed;
g_eye[0]+=cos(rad_xz)*speed;
}
if (KEY_DOWN(VK_DOWN))
{ g_eye[2]-=sin(rad_xz)*speed;
g_eye[0]-=cos(rad_xz)*speed;
}
g_eye[1] =1.8;
g_look[0] = float(g_eye[0] + 100*cos(rad_xz));
g_look[2] = float(g_eye[2] + 100*sin(rad_xz));
g_look[1] = g_eye[1];
gluLookAt(g_eye[0],g_eye[1],g_eye[2],g_look[0],g_look[1]+g_elev,g_look[2],0.0,1.0,0.0);
return TRUE;
}不明白if (KEY_DOWN(33)) g_elev +=0.2f;中33是什么东西,呵,请教一下!