Original Post
Im working on my math library, so I cant use directx math or anything like that.. I dont know enough about matricies to be able to figure this out on my own, so I was looking around on the net for code to invert a 4x4 matrix (column major, but i guess it doesnt matter?) Anyway I found code to do it, but it is very slow, has like 10 for loops in it, all kinds of crazy stuff...sufice to say, I know there is a faster way to do it because I have seen it before, I just cant find out where iv seen it. My question is does anybody know somewhere where i find / has a fast 4x4 matrix inversion function? As a side question about the GPU and matricies; Directx and HLSL claim to use column major matricies, and Nvidia's CG claims the row major is default and column major is not supported; obviously there is a bit of a contradiction there.. Anyone know which the GPU actually uses? perhaps one of them flips the matrix on the CPU when setting shader constants?