OpenGL, problems with GL_MODELVIEW GL_PROJECTION

前端 未结 1 570
孤城傲影
孤城傲影 2021-01-26 23:28

Guys, I\'m trying to finish up my homework but I\'m having some problems here on these models on openGL... any Idea why is my draw not happening? One thing that strange is that

1条回答
  •  深忆病人
    2021-01-26 23:42

    The polygon you draw is outside of the volume set up by glOrtho(). You will only see points with Z coordinate between -1 and 1.

    This part of your code will cause drawing outside of that range.

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glTranslatef(0.0, 0.0, -5.0);
    

    Either replace the glOrtho()'s last 2 parameters to something like -10, +10 or remove that glTranslatef()

    0 讨论(0)
提交回复
热议问题