Jump to content
  • Advertisement
Sign in to follow this  
bukzor

Resizing...

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

I appoligize in advance for my nooblet ways, but i've read pages upon pages of manuals and sifted the internet and can't get this thing to work. Basically I have a rectangle on the z=0 plane and would like to put the corners onto the corners of the screen. The problem is actually more complex than that but its a simple idea. Here's what i've got: void LookAt(double left, double right, double bottom, double top) { glOrtho(0,400,0,500,-1,1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(-(left + right)/2,-(top + bottom)/2,0); glScalef(2/(right - left),2/(top - bottom),1); } This works in special cases, but misses considerably most times. I'm sure this has a simple solution... Thanks!

Share this post


Link to post
Share on other sites
Advertisement
the Frustum() function seems to be exactly what i'm trying to do, but it doesnt seem to do anything at all.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!