I tried using the gluOrtho2D command like:
gluOrtho2D(-600, 600, -600, 600);
Because I want a coordinate system with extreme values of (-600, -600) and (600, 600). However, doing this messed with my viewport. I have a viewport set as
glViewport(0, 150, cwidth / 2, cheight - 150);
and another positioned to the right of this one taking up the remainder of the window space to the right, and two more below. Setting glOrtho2D to (-1, 1, -1, 1) doesn’t do anything (I assume this is the default) but setting it to what I describe earlier somehow overwrites the other windows. I also tried setting scale as glScale(600, 600, 0) but that messed things up as well. My code is as follows:
int dvpWidth = cwidth / 2, dvpHeight = cheight - 150;
glViewport(0, 150, GLsizei(dvpWidth), GLsizei(dvpHeight));
gluOrtho2D(-600, 600, -600, 600);
glColor3f(0.0, 0.1, 0.0);
glColor3f(1.0, 0.0, 0.0);
glPointSize(600 / cwidth);
glBegin(GL_POINTS);
glVertex2f(0.0, 0.0);
glVertex2f(1.0, 0.0);
glVertex2f(0.9, 0.0);
glEnd();
cwidth is the client width and cheight is the client height of the window I am working with. I then go on to create three more viewports (although I haven’t set gluOrtho2D projections for them, they are in the default state). All I want to do right now is make my coordinate system have 600 units on each axis in each direction. Later I will want to “zoom” in on a specific range, say change the viewing area to (-20, -10) to (20, 10) in the coordinate system, but for now I just want a global view that shows 600 units.