Jump to content

  • Log In with Google      Sign In   
  • Create Account


[HELP] Milkshape3D animation not rotating correctly


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 uglybdavis   Members   -  Reputation: 901

Like
0Likes
Like

Posted 19 May 2013 - 05:46 PM

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



Sponsor:

#2 uglybdavis   Members   -  Reputation: 901

Like
0Likes
Like

Posted 20 May 2013 - 02:56 AM

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;
}





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS