|
|

楼主 |
发表于 2005-6-22 13:07:00
|
显示全部楼层
Re:求助:opengl初级问题!
void COpenglTestView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
int w = cx;
int h = cy;
//Prevent a divide by zero
if(h == 0)
{
h = 1;
}
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLfloat fAspect;
fAspect = (GLfloat)w/(GLfloat)h;
gluPerspective(60.0f,fAspect,0.1,100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0,0.0,100.0,0.0,0.0,0.0,0.0,1.0,0.0);
}
我这样改动了以后,还是不行啊。 |
|