GLCanvas

Hi,

Im trying to scroll along the GLCanvas… is there any way that this can be done?

Im using an array to draw out a series of shapes, but the get cut off once they reach the end of the canvas. Is there a method you can use, so that you can move along the canvas to see the rest of the shapes displayed by my array??

I was trying to use the glRotate method… but I coulldn’t get it to do what i wanted.

Thanks.

You could compute the min and max values of your array in both X and Y direction, and then use an orthographic projection :


glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(xmin, xmax, ymin, ymax, znear, zfar);

That way all the stuff you draw should fit in the canvas. However you’ll have to perform a bit more calculations if you want to keep a given aspect ratio.