Skip to main content
GameDev.net gamedev.net
🔒 Locked

[HELP] Milkshape3D animation not rotating correctly

Started by uglybdavis May 19, 2013 at 11:46 PM 0 replies 800+ views
Original Post
uglybdavis
uglybdavis

Hey guys.

I'm trying to follow the Real Soon Now guide to animating a Milkshape3D model. My code seems to be working in that the model is rendering correctly, and the animations seem to be translating the model in the world properly, however no joint is ever rotating. This is confusing me to no end....

I've refactored my code so many times, i've even tried to implement the animation code without following the tutorial, to no luck i always seem to come out with the same issue :(

If anyone could take a look and tell me if i'm doing something super wrong or what, i'd really appreciate that!

My current code:

http://pastebin.com/tdZYbtJh

uglybdavis
uglybdavis

I had a thought, "Hey, maybe my quaternions are busted!" so i removed the quaternions and changed them to matrices. Same result!


Matrix BuildMatrix(const Vector& rot, const Vector& trans) {
    Matrix t = Matrix::Translation(trans.x, trans.y, trans.z);
    Matrix x = Matrix::AngleAxisRotation(rot.x, 1.0f, 0.0f, 0.0f);
    Matrix y = Matrix::AngleAxisRotation(rot.y, 0.0f, 1.0f, 0.0f);
    Matrix z = Matrix::AngleAxisRotation(rot.z, 0.0f, 0.0f, 1.0f);
    
    return t * (x * y * z);
}

Vector ToTranslation(float* f) {
    Vector v(f[0], f[1], f[2]);
    v.w = 1.0f;
    return v;
}

Vector ToRotation(float* f) {
    Vector v(f[0], f[1], f[2]);
    v.w = 0.0f;
    return v;
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.