Sign in to follow this  

Matrix Math Help

This topic is 4662 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

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


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to 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.

Share this post


Link to post
Share on other sites

This topic is 4662 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.

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