# Matrix Inverse

## Recommended Posts

LostSource    199
Ello All, I was curious if the D3DXMatrixInverse function takes the inverse of the 3x3 portion (not including the translation part of the matrix) of the matrix, or does it take the inverse the full 4x4 matrix (including the translation part)? It was seem that it would only need to take the 3x3 portion because the _14, _24, _34, _44 ij positions would stay 0 and 1. --------------- In addition: If the 4x4 Matrix is viewed in portions
 R | 0
---|---
T | 1

R = 3x3 linear transformations (rotation, scale, shear, ...) T = translation (x, y, z) Then when D3DXMatrixInverse takes the inverse of the matrix, does it need to take the inverse T portion? If it does why? [Edited by - LostSource on March 2, 2007 1:15:45 AM]

#### Share this post

##### Share on other sites
stanlo    212
I sure hope it takes the inverse of the whole matrix, otherwise I have a whole lot of potentially bugged up code. I'm pretty sure it does though.

A 4x4 matrix isn't guaranteed to be a rotation and translation. It could be anything, perhaps a projection matrix or just a general linear system.

If you only inverted the rotational part (assuming no scaling is going on), then you'd rotate in the opposite angle about the same axis, and you'd still be translated into the same position. If you invert the whole thing, you will also translate yourself in the opposite direction. I think...

I hate math.

#### Share this post

##### Share on other sites
Omid Ghavami    1007
I believe stanlo is right. The function is supposed to return
Quote:
 Return ValuesPointer to a D3DXMATRIX structure that is the inverse of the matrix

It's usage is not restricted to a specific type of matrices. So it should take the inverse of the entire matrix.

## 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