And Now, I just swapped the orientation of the window so now it’s 480 x 640 sized.
And the camera and sphere have same property and same distance as before.
Shouldn’t they look exactly the same since nothing has changed between camera and the sphere regardless of the window size or ratio?
Could someone please explain to me if it is natural and why it is happening?
Thanks in advance!
int main( ){
ofSetupOpenGL(640, 480, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new ofApp());
}
ofCamera uses your window heigth to adjust the “scale” of the rendering, so that it fits your viewport vertically.
So when you switch from landscape to portrait, the viewport height increases, and the scale of the sphere increases in pixels. But notice the sphere stays the same size relative to window height.
You can set a custom viewport if you call cam.begin(ofRectangle viewport) instead of cam.begin()