Matrix Math Help

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

Recommended Posts

OK, I dont understand what I'm doing wrong, I have this matrix: This is my translation matrix (x,y,z) = (0,1,0) you can see them on the last colum. [ 1,0,0,0 ] [ 0,1,0,1 ] [ 0,0,1,0 ] [ 0,0,0,1 ] I am multiplying it by my rotation matrix (Rotation around X Axis) [ 1,0,0,0 ] [ 0,cos(angle),sin(angle),0 ] [ 0,sin(angle),cos(angle),0 ] [ 0,0,0,1 ] when I do R*T (angle = 10) I get this: [ 0,0,0,0 ] [ 0,-4.14,0,0 ] [ 0,0,-1.38,0 ] [ 0,0,0,1 ] which is wrong..... Even stranger, if I have no rotation and just use the identity for my rotation I have: [ 1,0,0,0 ] [ 0,1,0,0 ] [ 0,0,1,0 ] [ 0,0,0,1 ] X (TIMES) [ 1,0,0,0 ] [ 0,1,0,1 ] [ 0,0,1,0 ] [ 0,0,0,1 ] which ends up scaling the image.... weird, I wanted to just translate it.... but if I have no rotation and always want to multiply the rotation just incase I do have it, what should be the rotation matrix?? all 0's??? Thanks for any help Jeff

Share on other sites
Then maybe your matrix-multiplying code is wrong¿

Share on other sites
Maybe just a typo, but shouldn't one of the 'sin' terms in the rotation matrix be negative?

If multiplication by identity is changing your matrix, then as the previous poster suggested your mult code is probably wrong.

There are other things that might be causing problems. What API (if any) are you using? If no specific API, are you using row or column vectors? Are you using API mult code or your own? If your own, perhaps you could post it...

Share on other sites
Well if its wrong, why?

when I do:

(IDENTITY)
[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[0,0,0,1]
X (TIMES)
(TRANSLATION)
[1,0,0,0]
[0,1,0,2]
[0,0,1,0]
[0,0,0,1]

=
(R(identity at the moment) * T)
[1,0,0,0]
[0,3,0,0]
[0,0,1,0]
[0,0,0,1]

Is this right??? or what should it equal??

Thanks
Jeff.

Share on other sites
From what I can see in your last post, when you take an identity matrix times your translation matrix, your resulting matrix should be equal to the original translation matrix. That to me points to, as previous posters mentioned, a problem with your matrix multiplication routines.

Unless there is something else I'm missing from your post.

Share on other sites
We can't help you just from looking at a couple of examples. Post your matrix multiplication function. Then we'll probably be able to tell you where you're going wrong.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 14
• 14
• Forum Statistics

• Total Topics
633390
• Total Posts
3011631
• Who's Online (See full list)

There are no registered users currently online

×