Stupid newbie problem. I have a 2D view (a map) which I set up with want positioned on the screen at bottomLeftX,bottomLeftY and Width,Height in size so I use
I set up my projection matrix with
GLdouble originX = wdt/2 + blx; GLdouble originY = hgt/2 + bly; wdt *= zoom; hgt *= zoom; blx = originX-(wdt/2); bly = originY-(hgt/2); glOrtho(blx,wdt, bly,hgt, -1,1);
With my simple settings of blx=0,bly=0, wdt=640,hgt=480 camera at -320,0,0 the object at 0,0,0 the object isn’t centered in my 640x480 window (it very nearly is) and it moves slightly left as I zoom out.
Everything works with 3D view (using gluPerspective), including zoom. What I don’t get is why in 2D I need my camera at -320. Any pointers on where to look would be great.