openframeworks / openframeworks/openFrameworks
need to set MatrixMode in ofNode and of3dGraphics draw functions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
the draw functions should set the MatrixMode to OF_MATRIX_MODELVIEW before they perform their matrix operations and then set the MatrixMode back to whatever was the previous Matrix Mode before the draw call;
Right now the user must do this to use ofDrawBox.
ofSetMatrixMode(OF_MATRIX_TEXTURE);
ofPushMatrix();
ofTranslate(0, 1.0);
ofScale(1.0, -1.0);
ofSetMatrixMode(OF_MATRIX_MODELVIEW);
ofDrawBox(100.0);
ofSetMatrixMode(OF_MATRIX_TEXTURE);
ofPopMatrix();
Notice the 3 calls to ofSetMatrixMode.
It should look like this with just one call to ofSetMatrixMode
ofSetMatrixMode(OF_MATRIX_TEXTURE);
ofPushMatrix();
ofTranslate(0, 1.0);
ofScale(1.0, -1.0);
ofDrawBox(100.0);
ofPopMatrix();
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the ofNode and of3dGraphics draw functions that perform matrix operations, then inspect how they use ofSetMatrixMode, ofPushMatrix, and ofPopMatrix. Verify that each draw call temporarily uses OF_MATRIX_MODELVIEW and restores the caller's previous matrix mode, including the texture-mode example shown in the issue.
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
- 45/100