Well in D3D you can invert a matrix by doing this:
Code:
D3DXMATRIX matInv;
//Create translation matrix as source for testing inverse
D3DXMATRIX matTrans;
//100 on x, 200 on y, and 300 on z
D3DXMatrixTranslation(&matTrans,100.0f,200.0f,300.0f);
D3DXMatrixInverse(&matInv,NULL,&matSource);
Gotta love the D3DX library.
The NULL is where the determinant variable goes, if you have one which in this case I do not.
And yes, Bob, it is very hard to create something that has not been done before (and better?) and is equally as efficient and useful. Most game programming problems usually end up using similar algos to solve them. Perhaps this is because games have to be both fast and efficient so there isn't much room for error.
And now as far as pathfinding it is good to have an algorithm that can do this well, but sometimes I feel it is not. Don't give the AI more information than a normal human player would have at any one point. Sometimes it's not bad to take the wrong path. If we were all running through a maze, it would be very hard to find each other without some type of communication system. If Bob and I were driving somewhere and he didn't know how to get there, if Bob loses sight of me......guess what, he either is screwed, must call me and tell me to slow down and wait, or he can ask for directions which will probably land him nowhere close to where he wants to be. Sometimes game AI is too smart. They have too much knowledge and as such, it makes the game much harder than the same situation would be in real life. Now when you make your AI fallible then the player doesn't mind not being found or shot at every 5 minutes no matter where they go.
Having superhuman AI really sucks, but having complete idiots also sucks. A happy medium is needed.
Too smart: Half Life 1, GTA: Vice City (cheaters actually - police spawn at nearest intersection).
Too dumb: Rainbow Six, No One Lives Forever 1
Just about right: Mafia.