开发者

Changing the openGL coordinate system

开发者 https://www.devze.com 2023-01-19 09:27 出处:网络
Right now, my openGL window scales from -1 to 1 on both the X and Y axis. How would I 开发者_C百科change this, to say, -2 and 2?Add transformation for halving every coordinate: glScalef(0.5,0.5,0.5);.

Right now, my openGL window scales from -1 to 1 on both the X and Y axis. How would I 开发者_C百科change this, to say, -2 and 2?


Add transformation for halving every coordinate: glScalef(0.5,0.5,0.5);. Note however, you won't get far without understanding OpenGL matrices, various transformations you can add and working with the stacks. See, for example, OpenGL FAQs regarding transformations and in more detail, the specification.


If working as 2D (say ortho), change it to the:

 gluOrtho2D(-2,2,-2,2)
0

精彩评论

暂无评论...
验证码 换一张
取 消