tags:

views:

43

answers:

2

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
I guess not so good answer at all!
Green Code
+2  A: 

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

 gluOrtho2D(-2,2,-2,2)
Green Code
This definitely the way to go here. Using glScalef would cause unnecessary headaches especially if you started changing which matrix model you using.
Ryan