Skip to content

ofxAssimpModelLoader aiMatrix4x4ToOfMatrix4x4 #1358

Open
neuroprod opened this Issue Jun 27, 2012 · 3 comments

2 participants

@neuroprod

line nr 86 this:

float m[16] = { aim.a1,aim.a2,aim.a3,aim.a4,
                    aim.b1,aim.b2,aim.b3,aim.b4,
                    aim.c1,aim.c2,aim.c3,aim.c4,
                    aim.d1,aim.d2,aim.d3,aim.d4 };

should be this

float m[16] = { aim.a1,aim.b1,aim.c1,aim.d1,
                    aim.a2,aim.b2,aim.c2,aim.d2,
                    aim.a3,aim.b3,aim.c3,aim.d3,
                    aim.a4,aim.b4,aim.c4,aim.d4 };
@kylemcdonald

are you sure? it seems like this would completely break all of the animation stuff that's currently supported. do you have a demo where the new one works, but the old one is broken?

@neuroprod

It's just not used by the addon, everything is done in assimp data types. so it doesn't break anything

here is a simple testcase:

aiMatrix4x4 aim;
    aiMatrix4x4::Translation(aiVector3D(10, 5, 2), aim );
    float mNow[16] = { aim.a1,aim.a2,aim.a3,aim.a4,
        aim.b1,aim.b2,aim.b3,aim.b4,
        aim.c1,aim.c2,aim.c3,aim.c4,
        aim.d1,aim.d2,aim.d3,aim.d4 };

    ofMatrix4x4 test;
    test.set(mNow);
    cout <<"current :"<<endl<< test << endl<< endl;


    float mCorrect[16] = { aim.a1,aim.b1,aim.c1,aim.d1,
        aim.a2,aim.b2,aim.c2,aim.d2,
        aim.a3,aim.b3,aim.c3,aim.d3,
        aim.a4,aim.b4,aim.c4,aim.d4 };

    test.set(mCorrect);
    cout <<"correct:"<<endl<<  test << endl;

output: first is a scale matrix , second the correct translation

current :
1, 0, 0, 10
0, 1, 0, 5
0, 0, 1, 2
0, 0, 0, 1

correct:
1, 0, 0, 0
0, 1, 0, 0
0, 0, 1, 0
10, 5, 2, 1

@kylemcdonald

aha, i see there was a function called aiNodeToOfNode() where it was used, but the function is now commented out (maybe because this didn't work). i'll label this bite-size, and we can make the swap. thanks!

@kylemcdonald kylemcdonald added this to the 0.10.1 milestone Dec 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.