Could you please tell me which value is wrong? I did a test on your function by making the value of "angle" to 0, the returned matrix is
1 0 0
0 1 0
0 0 1
That's as expected.
Unfortunately I don't have the actual numbers that ended up in the matrix. This function is part of a larger shader that does some texture lookup tasks in a panoramic imaging context. The broken image result had some kind of "spiral"-effect (instead of beeing simply rotated).
The weired thing was, that my very simmilar yawMat and rollMat functions work flowlessly.
It looks like you simply can't reproduce the problem, since I witnessed the "spiral" also using the following code:
float c = 1.0;
return mat3(1, 0, 0, 0, c, 0, 0, 0, c );
So the only thing that mattered was whether there is a variable argument at a particular position of the constructor.
Unfortunately, this happened on a client's machine, where I can only get remote access to involving the client...
That's strange that only this matrix doesn't work. But how could you make sure the matrix is wrong when you don't get a chance to check it? Maybe it's called by function call, function argument or something else. We are pleased to resolve your problem but it's better to get a program that is narrowed down to reproduce the bug.
You could contact me by my email: firstname.lastname@example.org, thanks.