in reply to POGL Zooming to a certain point

Assuming you want to move the camera (and you probably do), you need to make some sort of glTranslate() call to move the camera into the scene while leaving all of the other objects at fixed locations and orientations relative to the origin. If the camera appears to move toward the upper left (and it does for me), you probably need to move the camera along the X and Y axes as well -- I suspect you're drawing in the fourth quadrant, where the origin is at the upper left of your image.

Replies are listed 'Best First'.
Re^2: POGL Zooming to a certain point
by jonsmith1982 (Beadle) on Apr 18, 2008 at 21:57 UTC
    i dont want to move the camera, i want to move the background and only draw what would be visible by the camera.

    what i was thinking is...

    add feature for cropping left and top (to stop drawing of any excess OGL code) - right and bottom cropping already present
    find an equation to figure out each blocks x,y boundaries
    take mouses x,y and center using $Width

      Your other option then is to use glViewport() to change the viewport. This may be easier than changing the camera position. You should be able to rely on OpenGL doing any culling for you, so you don't have to do the math to figure out which blocks to display.