Jump to content
  • Advertisement
Sign in to follow this  
ThirddaySaved

Matrix Rotations

This topic is 3995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I am having a really annoying problem... I can't figure out how I can get the real Translation of my Matrix, after Translating, Rotating, and then Translating again... So, here's some code example...
Dim Tester As Matrix
Tester = Matrix.Identity
Tester = Tester * Matrix.Translation(0, 0, 5)
 ' This first message box was correct - (0, 0, 5)
MsgBox(Tester.M41 & "," & Tester.M42 & "," & Tester.M43)
 ' I Rotate 90 degrees on the Y axsis...
Tester = Tester * Matrix.RotationY(90)
 ' Then I translate on the Z axis again, which after a 90 degree rotation
 ' should be equivelent to the old X axis.
Tester = Tester * Matrix.Translation(0, 0, 5)
 ' Ok, this second message box came up with this... (4.4, 0, 2.7)
 ' The numbers I was looking for were something like - (5, 0, 5)
MsgBox(Tester.M41 & "," & Tester.M42 & "," & Tester.M43)
I don't know what I am doing wrong... my camera always works, and doesnt have problems... but I just can't get the right Translation... If you could help that would be great! O, and I do plan on using Quaternions soon, but I would like to fully understand Matrices first...

Share this post


Link to post
Share on other sites
Advertisement
If you're using the MDX Matrix class, then you need to pass in radians instead of degrees. 90 radians is about 117 degrees, which is consistent with the numbers you're getting.

Share this post


Link to post
Share on other sites
Ya.. ur right... I guess thats actually a bad example... well, when im using my camera if i move around a while, and then go close to 0,0,0 ... many times i get numbers that are not even close to that... I don't really understand why... Thanks Though

Share this post


Link to post
Share on other sites
It would probably be a good idea for you to look into the theoretical side of matrix mathematics. Simply examining individual elements will only be valid in a few isolated cases - you need to consider the matrix as a whole.

Share this post


Link to post
Share on other sites
Ok, thanks... thats basically what I was wondering... I read all about how they work and stuff, but I just never really looked closely at the actyal numbers... I was basically trying to find a way out of using too much math, but I guess I'll use some. Thanks You guys

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!