Skip to main content
GameDev.net gamedev.net
🔒 Locked

Resizing problem

Started by zaNeXuS Oct 4, 2002 at 2:04 PM 3 replies 550+ views
Original Post
zaNeXuS
zaNeXuS
How do you resize the resulution and frustrum using OpenGL? We can''t seem to do it and keep the perpective intact.
---------------Gaming is Life---------------
George2
George2
Set a new projection matrix

[edited by - George2 on October 4, 2002 4:00:02 PM]
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
zaNeXuS
zaNeXuS
No, but what I mean is, when I call ChangeDisplaySttings() function, I''d say, use 640 by 480 res, and when I use a viewPort of 800 by 600, all positions is ot of perspective, doies this mean I have to call ChangeDisplaySettings() fucntion again, to a res of 800 by 600 again?
---------------Gaming is Life---------------
zedzeek
zedzeek
remember to change this
gluPerspective(fov, aspect
aspect = new width/height

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
daher
daher
quote:
Original post by zaNeXuS
No, but what I mean is, when I call ChangeDisplaySttings() function, I''d say, use 640 by 480 res, and when I use a viewPort of 800 by 600, all positions is ot of perspective, doies this mean I have to call ChangeDisplaySettings() fucntion again, to a res of 800 by 600 again?



The viewport is responsible of what can be viewed on your GLWindow. a viewport should be less or equal to a GLwindow so everything rendered by opengl goes in that window... ChangeDisplaySettings() doesn''t have to do anything with opengl it changes the screen res.
so what you have to do is this:
change the screensize using ChangeDisplaySettings() then use gluPerspective() to make the correct perspective calculations for your viewport. you don''t have to use the exact parameters zedzeek posted as when making widescreen effect.

____________________________________MSN | AIM | YIM | ICQ

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.