# convert matrix

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

## Recommended Posts

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

##### Share on other sites
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.

##### Share on other sites
Quote:
 Original post by BuckeyeThis 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 :)

##### Share on other sites
If I remember my math correctly, you can put the translation in there, too, and convert it all in one line.

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632997
• Total Posts
3009790
• ### Who's Online (See full list)

There are no registered users currently online

×