Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

D4nt3

newbee questions about GLortho

This topic is 5654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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();

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!