go-gl / mathgl

A pure Go 3D math library.
BSD 3-Clause "New" or "Revised" License
554 stars 65 forks source link

HomogRotate3DZ is broken #1

Closed decitrig closed 11 years ago

decitrig commented 11 years ago

I think HomogRotate3DZ has the wrong sign for the second row; it distorts rather than rotates.

Right now it returns mathgl.Mat4f{cos, -sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}

But it should be mathgl.Mat4f{cos, -sin, 0, 0, sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}

UserAB1236872 commented 11 years ago

Actually, it's the first sin that should be positive (because the matrices are in Column Major Order), but you were right -- it was broken. Thanks.