Jump to content
  • Advertisement


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


Viewport, Ortho result is twice desired size

This topic is 5282 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

Dear all, I am a little puzzled by viewports and the Ortho projection matrix at the moment. Using the following code, I am defining viewport that is the top right quater of a window, and as an experiment defining the viewport to have 2 units for X & Y What puzzles me is that when I draw the square (in the code) it is the entire viewport size, not 1 quater of the viewport size!! Have I missed something here??? Thanks guys Paul.
glViewport(m_uWidth / 2, m_uHeight / 2, m_uWidth, m_uHeight);
gluOrtho2D(0, 2, 0, 2);
glColor3f(1.0f, 1.0f, 1.0f);
	glVertex2i(0, 0);
	glVertex2i(0, 1);
	glVertex2i(1, 1);
	glVertex2i(1, 0);
	glVertex2i(0, 0);

Share this post

Link to post
Share on other sites
What a minute, I think I might have another stupid question!!

Thanks, I obviously suffer from some kind of lazy reading problem, first word and last word of every sentence or something!

But now I understand, appreciated!


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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!