void reshape(int width, int height)
{
int dis = width < height ? width : height;
glViewport(0, 0, dis, dis); /*这里dis应该是500*/
glMatrixModel(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.5, 1.5, -1.5, 1.5, -10, 10);
.....
}
void reshape(int w, int h)
{

本文深入探讨了OpenGL中的glViewport函数和glOrtho函数,详细解释了如何使用glOrtho进行投影设置,并通过glViewport实现在同一窗口显示多个视图的技术。
最低0.47元/天 解锁文章
1632

被折叠的 条评论
为什么被折叠?



