Sign in to follow this  
ThirddaySaved

Matrix Rotations

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this