calculating the inverse view matrix from computer graphics...

Hello,

I have a quick c++/opengl graphics related question.

How do you calculate the inverse view matrix?

Is that really just the inverse of the view/camera matrix?

Or is that something else?

I have seen articles online on the overall mathematical theory behind it but I am using the GLM math library and it has this nifty glm::inverse() function.

I was just curious if I can do a glm::inverse(ViewMatrix) and that would be correct.

Thank You.
Been ages that I dealt with inverse matrices, but here goes.

Assume B is the inverse matrix of A, and x is a vector, then A*B*x = B*A*x = E*x = x holds true in all cases, E being the identity matrix. Note that A*B = B*A is only true if A and B are each others' inverse matrix (and some other special cases). Matrix multiplications are by default to be treated as non-commutative.

So if you have A and want to know B, you need to solve A*B = E for B. That is not a trivial calculation as it involes a system of linear equations. There are special methods for approaching the solution to this problem, a famous one is by Gauss iirc. With some likelihood glm::inverse() does what you want.

Anyway, I'm curious as to what you need the inverse view matrix for.
Hello,

Thank you for the nice writeup. I need the inverse view matrix for a lighting opengl shader.
Topic archived. No new replies allowed.