0
我想改变关键按下gluLookAt。例如,我想从顶部,右侧,底部和左侧看到我的场景,方法是敲击键t,r,b,l。我开始实现从顶部的样子,但当按下“t”键时它似乎不起作用,在我的场景中没有任何变化。我究竟做错了什么?在按键上更改gluLookAt。顶部,右侧,底部,左侧
这是我keyResponder方法:
void CDrawModel::myKeyResponder(unsigned char key, int x, int y) {
if(key == 27) { // The ESC key
glutDestroyWindow(glutGetWindow()); // kill the window
exit(0);
}
if (key == 't' || key == 'T'){
gluLookAt(0, 600, 0,
0, 0, 0,
0, 600, 1);
cout << "T ot t pressed" << endl;
}
//refresh the screen after every key press...
glutPostRedisplay();
}
看来你不知道向上的矢量是干什么的。 [检查这个问题。](http://stackoverflow.com/questions/5717654/glulookat-please-explain)除此之外,你张贴的片段太模糊。我们不知道您为矩阵做了什么样的初始化,以及如何渲染场景。 – aslg