Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 OpenGL/freeGLUT 中使用相机时遇到问题。这是我的代码:
http://pastebin.com/VCi3Bjq5
(出于某种原因,当我将代码粘贴到此站点的代码功能中时,它会给出非常奇怪的输出。)
据我所知,这应该在按下箭头键时旋转相机 - 但它什么也没做。似乎即使是初始相机位置也是错误的。任何线索这是为什么?
显示函数只调用一次。您需要使用 glutIdleFunc() 设置空闲函数,或者告诉 GLUT 必须使用 glutPostRedisplay() 再次调用显示函数。