Calculation of 4x4 matrix of planes

You’re asking a little too much. Just start anywhere, and when you start things will become clearer. When you have some code written, I’d be glad to check it for you.