openframeworks / openframeworks/openFrameworks

ofCamera and inverted texture mapped image

Open
#5,528 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

section-3D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Hi, arturo asked me to open an issue about this here.

original forum post : https://forum.openframeworks.cc/t/ofcamera-and-inverted-texture-mapped-image/26398

I figured out the texture mapped image looks inverted when I use ofCamera.
As you can see the American continent is inverted.
0c77061219ea658692cfad62f3a9027ee9899d72_1_648x500

It works correctly when I call ofCamera::setVFlip(true);
But Is this natural to see the image inverted when VFlip is set to false?

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]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied ofEasyCam reproduction with ofDisableArbTex(), earth.jpg, and the sphere mesh, then compare the result with ofCamera::setVFlip(true). Trace the texture mapping and camera orientation involved in that example; done means determining whether the inverted continent is expected and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.