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 窗口在 X 和 Y 轴上从 -1 缩放到 1。我将如何改变这个,比如说,-2 和 2?
如果作为 2D 工作(比如正交),请将其更改为:
gluOrtho2D(-2,2,-2,2)
添加转换以将每个坐标减半:glScalef(0.5,0.5,0.5);. 但是请注意,如果不了解 OpenGL 矩阵、可以添加的各种转换以及使用堆栈,您将不会走得太远。例如,请参阅有关转换的 OpenGL 常见问题解答,以及更详细的规范。
glScalef(0.5,0.5,0.5);