i eddited the smileys out because they only showed up as “smiley.gif” when i accessed the code from the front page

Please log in or register to post a reply.

@anubis

`m[3][0] = -(m[0][0] * m[3][0] + m[1][0] * m[3][1] + m[2][0] * m[3][2]); m[3][1] = -(m[0][1] * m[3][0] + m[1][1] * m[3][1] + m[2][1] * m[3][2]); m[3][2] = -(m[0][2] * m[3][0] + m[1][2] * m[3][1] + m[2][2] * m[3][2]); }`

[snapback]10974[/snapback]

Hmm… dont you need some temp variables for m[3][0] and m[3][1] so you dont use their new updated values when m[3][1] and m[3][2] is computed?

- Upcoming Multiplatform Game Program...
- Our first game - looking for feedbacks
- Network Emulation Tool
- Trouble with accessing GLSL array
- Fiction
- Game Programming Patterns: Bytecode
- Interactive WebGL Water Demo
- Skeletal Animation Tutorial with GP...
- Unreal Engine 4
- Microsoft xbox one selling poorly

matrix inversion in general is a slow and tedious process. however in computer graphics we mostly deal with special kinds of matrices that allow for much faster inversion. one such type of matrix is the standard 4 by 4 transformation matrix that contains a rotation and a translation. conveniantly we can invert the rotation and the translation seperatly. the 3x3 rotation matrix is easily inverted by taking the dot product between each pair of row vectors, since it is orthogonal (the vector dot itself is 1 and and 0 for all the others). taking the dot product of the row vectors is equivalent to multiplying the matrix with it’s transpose. so the inversion of the rotation part is simply it’s transpose

the translation part is then equally easy inverted (by taking the negative translation and multiplying it with the inverted rotation matrix, which is the transpose we just calculated).

it should be noted that this only works if the matrix is unscaled because the row vectors of the rotation matrix are required to have unit length. the calculation should be extendable though if the matrix is scaled equally in all directions.