Advertisement

newbee questions about GLortho

Started by March 31, 2003 05:40 AM
1 comment, last by D4nt3 21 years, 11 months ago
Hi... i''m new in OpenGL I''m trying to do a simple 2D math equation editor... It must have the posibility of doing ZOOMs I thinks it must be done changing coords of GLOrtho2D... but I''m not sure... I don''t know so well the structure that must be done... load which matrix, etc :S Some one can help me ?? thanxs
I think you can use glPixelZoom()... Look it up in the red book, or somewhere else... It should be exactly what youre looking for!
Advertisement
First of all, there is no glOrtho2D().
However, there are glOrtho() and gluOrtho2D().
gluOrtho2D() is the same thing as calling glOrtho() with near=0 and far=1.

glMatrixMode( GL_PROJECTION );glLoadIdentity();glOrtho( GLdouble left,         GLdouble right,         GLdouble bottom,         GLdouble top,         GLdouble near,         GLdouble far );// make the values of left-right and top-bottom farther away// from eachother to zoom out// (e.g. left = bottom = -100.0;  right = top = 100.0)// closer values will zoom in// (e.g. left = bottom = -1.0;  right = top = 1.0)// don''t forget to go back to the modelview matrix when you are done:glMatrixMode( GL_MODELVIEW );glLoadIdentity(); 

This topic is closed to new replies.

Advertisement