openframeworks / openframeworks/openFrameworks

calling ofEsayCam::disableMouseInput() during setup results in different initial camera position

Open
#5,194 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When starting an app with an ofEasyCam, by default the camera will automatically move to (0,0, (approximately ofGetWidth()/2) ).

However, if you call disableMouseInput() in setup, the camera will start at (0,0,0) instead.

This is somewhat confusing. The default position should be the same regardless of whether disableMouseInput() is called or not.

class ofApp {
...
ofEasyCam mCamera;
};

void ofApp::setup() {
    //mCamera.disableMouseInput();
}

void ofApp::update() {
    ofLog(OF_LOG_NOTICE, "camera at %s, orientation %s", ofToString(mCamera.getPosition()).c_str(), ofToString(mCamera.getOrientationQuat()).c_str());
}

result with above code at 1600x900:
[notice ] camera at 0, 0, 779.423, orientation 0, 0, 0, 1

result after uncommenting disableMouseInput:
[notice ] camera at 0, 0, 0, orientation 0, 0, 0, 1

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 tracing ofEasyCam initialization from the ofApp::setup() entry point, comparing the default path with a call to disableMouseInput(). Reproduce both cases using the supplied 1600x900 example and compare the logged position and orientation. Done means both paths produce the same initial camera position and orientation.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.