Jump to content
  • Advertisement


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


newbee questions about GLortho

This topic is 5740 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
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 );
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 );

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!