用MFC+OPENGL开发;原代码中使用正交投影glOrtho();代码如下:
        // 初始投影参数
for (int i=0; i<6; i++)
{
m_dProjPan[i] = 0.0;
m_dProjPanOri[i] = 0.0;
} if (!m_pRenderWnd)
{
return;
} // 根据视图计算相对投影大小
int w = m_rtRect.Width();
int h = m_rtRect.Height();
double daspect = (double)w / (double)h; //窗口的宽度与高度之比;
double sw = m_dObjMaxLen;  //物体长度;
double sh = m_dObjMaxLen;  //
double dlong;
if (daspect > 1.0)
{
m_dWndScal = h / m_dObjMaxLen;
sw *= daspect; // 502.30520167025941 * 1.22022572347266880;
dlong = sw * 3.0;    //dlong=1838.8246691369463
}
else
{
m_dWndScal = w / m_dObjMaxLen;
double dinaspect = (double)h / (double)w;
sh *= dinaspect;
dlong = sh * 3.0;
}
m_dProjPanOri[0] = -sw; // 左left    -sw        -sw=-612.941555637898211
m_dProjPanOri[1] =  sw; // 右right       sw     sw=612.941555637898211
m_dProjPanOri[2] = -sh; // 底bottom      -sh    -sh=-502.30520167025941
m_dProjPanOri[3] =  sh; // 顶top         sh     sh=502.30520167025941
m_dProjPanOri[4] = 0.1; // 近near 0.0     
m_dProjPanOri[5] = dlong; // 远far dlong      dlong=1838.8246691369463 memcpy(m_dProjPan, m_dProjPanOri, sizeof(double)*6); // 复制到当前参数 // 清理变量
m_dObjTrans[0] = 0.0;
m_dObjTrans[1] = 0.0;
m_dObjTrans[2] = 0.0;
m_dViewScal = 1.0; // 组合矩阵
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
m_dProjPan[0] = m_dProjPanOri[0] * m_dViewScal + m_dObjTrans[0];
m_dProjPan[1] = m_dProjPanOri[1] * m_dViewScal + m_dObjTrans[0];
m_dProjPan[2] = m_dProjPanOri[2] * m_dViewScal + m_dObjTrans[1];
m_dProjPan[3] = m_dProjPanOri[3] * m_dViewScal + m_dObjTrans[1]; glOrtho(m_dProjPan[0],
m_dProjPan[1],
m_dProjPan[2],
m_dProjPan[3],
m_dProjPan[4],
m_dProjPan[5]);
glMatrixMode(GL_MODELVIEW);此时,模型显示正常;现需改成透视投影;参数不变,我将glOrtho()改成glFrustum(),模型不显示;是何原因,请知道的朋友指点一二...谢谢...opengl