Draw textured sphere and view it with an ofEasyCam

Hello to all of you !

I’m trying to draw textured spheres and I’m facing a problem.
It’s ok without camera, but when I use an ofEasyCam, the texture is inverted (as if it was painted on the inside of the sphere).
I’m stuck with this. I have tried with a GLUquadricObj but I obtain the same results.

Here is the code.

  
  
// Add this to testApp.h  
ofEasyCam easyCam;  
ofImage texture;  
  
void testApp::draw(){  
      
    ofEnableDepthTest();  
    texture.loadImage("earth.jpg");  
  
    ofBackground(0);  
      
    glMatrixMode(GL_TEXTURE);  
    glPushMatrix();  
    ofScale(2048,1024);  
    glMatrixMode(GL_MODELVIEW);  
      
      
    ofPushMatrix();  
      
      
    ofTranslate(ofGetWidth()/2, ofGetHeight()/2);  
      
  
    //easyCam.begin();  // If uncommented, weird texture inversion  
      
    ofRotateX(-30);  
    ofRotateY(-60);  
      
        texture.getTextureReference().bind();  
        ofDrawSphere(400);  
        texture.getTextureReference().unbind();  
  
      
    //easyCam.end(); // If uncommented, weird texture inversion  
      
    ofPopMatrix();  
      
      
    glMatrixMode(GL_TEXTURE);  
    glPopMatrix();  
    glMatrixMode(GL_MODELVIEW);  
      
      
      
}  

Texture image is attached.

Thank you !
Xavier

Well after some investigation it seems that if I set

  
cam.setVFlip(true);  

textures are OK but coordinates are upside down…