Matrix Rotations

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

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 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 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 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 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 on other sites

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

Create an account

Register a new account

• Forum Statistics

• Total Topics
628740
• Total Posts
2984472

• 12
• 25
• 11
• 10
• 16