Right now, my openGL window scales from -1 to 1 on both the X and Y axis. How would I change this, to say, -2 and 2?
+1
A:
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.
Juho Östman
2010-10-12 00:12:00
I guess not so good answer at all!
Green Code
2010-10-13 20:23:49
+2
A:
If working as 2D (say ortho), change it to the:
gluOrtho2D(-2,2,-2,2)
Green Code
2010-10-13 20:25:54
This definitely the way to go here. Using glScalef would cause unnecessary headaches especially if you started changing which matrix model you using.
Ryan
2010-10-14 18:33:57