Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Feature ofPushMatrix(const ofMatrix4x4 &) #1256

elliotwoods opened this Issue May 13, 2012 · 6 comments


None yet
3 participants

elliotwoods commented May 13, 2012

if i'm not mistaken, the correct way of using ofMatrix4x4 in oF is glMultMatrixf(myMatrix.getPtr()) or glLoadMatrixf.
This seems a bit uncomfortable for me.

some candidates are:

ofPushMatrix(const ofMatrix4x4 &); //needs alternatives as you might not want to push at the time
ofLoadMatrix(const ofMatrix4x4 &);
ofMultMatrix(const ofMatrix4x4 &);

ofMatrix4x4::glLoadMatrix(matrixMode = OF_MATRIX_MODE_CURRENT);

kylemcdonald commented May 13, 2012

this would be great! in ofxCv this is called applyMatrix() after processing http://processing.org/reference/applyMatrix_.html

i would support ofApplyMatrix() after processing or ofMultMatrix() after opengl. placing it as a member function of ofMatrix4x4 feels less correct to me.


roymacdonald commented May 14, 2012

+1 for ofMultMatrix()


elliotwoods commented May 17, 2012

apply matrix - is that loading or multiplying?

i'm quite positive about using a few of the above together (except maybe glLoadMatrix)
i think that .apply() makes sense from an object oriented approach
but isn't really a winner for oF,gl like procedural style

my current personal favorite would be like:

ofLoadMatrix((translation * rotation));


kylemcdonald commented May 17, 2012

apply is multiply. maybe that's an argument for ofMultMatrix instead, if there is an ambiguity there.


elliotwoods commented May 17, 2012

perhaps also ofClearMatrix(); // glLoadIdentity()
and then there's the argument about matrix modes

anyway, first step is simply being able to apply a matrix at all


kylemcdonald commented Dec 12, 2014

funny, this is the second time you brought up this issue @elliotwoods :) first was #605

this has been closed with the introduction of ofMultMatrix()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment