python-opengl
python-opengl copied to clipboard
X-axis rotation
Hello Nicolas,
I have the feeling the cos/sin terms should be shifted by one column to the left. For d=0 we should obtain the identity matrix.
┌ ┐ ┌ ┐ ┌ ┐
│ 1 0 0 0 │ * │ x │ = │ 1*x + 0*y + 0*z + 0*0 │
│ cos(d) -sin(d) 0 0 │ │ y │ │ cos(d)*x - sin(d)*y + 0*z + 0*0 │
│ sin(d) cos(d) 0 0 │ │ z │ │ sin(d)*x + cos(d)*y + 0*z + 0*0 │
│ 0 0 0 1 │ │ 1 │ │ 0*x + 0*y + 0*z + 1*1 │
└ ┘ └ ┘ └ ┘
should be like this
┌ ┐ ┌ ┐
│ 1 0 0 0 │ * │ x │ =
│ 0 cos(d) -sin(d) 0 │ │ y │
│ 0 sin(d) cos(d) 0 │ │ z │
│ 0 0 0 1 │ │ 1 │ │
└ ┘ └ ┘
Thanks. I think you're right and I'm afraid other rotation matrices might be wrong as well. Can you make a PR?