convert matrix

Started by
2 comments, last by Buckeye 14 years, 1 month ago
hi all, I'm using the PhysX libraries for collision checking in my project but I come upon a problem... I need to set the matrix of the visual object the same as the matrix of the PhysX actor and that's were it goes wrong : my X-axis is the opposite of the one that PhysX uses so everything is mirrored. for translations, this isn't a problem (just reverse the x value) but for the rotations it is.. so, how can something like this be done? I tried some stuff but it all doesn't seem to work :( thx PS.: I'm not using DirectX / OpenGL and trying to change the direction of the X-axis is NOT an option
Advertisement
This is off the top of my head, kind of a drive-by posting.

Create a scaling matrix M for x=-1, y=1, z=1. This is nice because M==M-1.

Given a rotation matrix R, R' = M*R*M.

I think that should work. If not, hope not too much time's wasted.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Quote:Original post by Buckeye
This is off the top of my head, kind of a drive-by posting.

Create a scaling matrix M for x=-1, y=1, z=1. This is nice because M==M-1.

Given a rotation matrix R, R' = M*R*M.

I think that should work. If not, hope not too much time's wasted.


That worked perfectly :)
thank you very much :)
If I remember my math correctly, you can put the translation in there, too, and convert it all in one line.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement