ofCamera and inverted texture mapped image

I figured out the texture mapped image looks inverted when I use ofCamera.

It works correctly when I call ofCamera::setVFlip(true);
But then why VFlip is set to false as a default so one has to flip it to see mapped images correctly?
Could anyone please explain to me why it is set to false as a default? (which looks flipped already)
Do people prefer to use flipped coordinate in 3d?

Here’s a test code below. I used ofEasyCam.

//--------------------------------------------------------------
void ofApp::setup(){
    
    ofEnableDepthTest();
    ofDisableArbTex();
    
    img.load("earth.jpg");
    mesh = ofMesh::sphere(300,300);
}

//--------------------------------------------------------------
void ofApp::draw(){

    cam.begin();
    img.bind();
    mesh.draw();
    img.unbind();
    cam.end();
}

And Here’s a link to the test image
[http://paulbourke.net/geometry/transformationprojection/earth.jpg]

by default OF sets y growing downwards cause in 2d is usually easier to think that way, the mouse coordinates work that way, image coordinates work that way… but the default in opengl, 3d softwares and math in general is to have y growing upwards. if you import a model from a 3d package it’s y axis will grow upwards for example

the primitives in OF generate the uv coordinates to be used with the default perspective so if you look them through a camera they need to be flipped. we should have a way to generate this primitives with the correct uv coordinates for y growing upwards and probably that should be the default.

can you open an issue about this on github with a link to this post?

1 Like

I just did! Thanks @arturo

https://github.com/openframeworks/openFrameworks/issues/5528