diff --git a/gl/types_common.go b/gl/types_common.go index d02acdd..e2c7b48 100644 --- a/gl/types_common.go +++ b/gl/types_common.go @@ -27,22 +27,22 @@ func (u Uniform) WriteAffine(a *f32.Affine) { // WriteMat4 writes the contents of a 4x4 matrix to a GL uniform. func (u Uniform) WriteMat4(p *f32.Mat4) { var m [16]float32 - m[0*3+0] = p[0][0] - m[0*3+1] = p[1][0] - m[0*3+2] = p[2][0] - m[0*3+3] = p[3][0] - m[1*3+0] = p[0][1] - m[1*3+1] = p[1][1] - m[1*3+2] = p[2][1] - m[1*3+3] = p[3][1] - m[2*3+0] = p[0][2] - m[2*3+1] = p[1][2] - m[2*3+2] = p[2][2] - m[2*3+3] = p[3][2] - m[3*3+0] = p[0][3] - m[3*3+1] = p[1][3] - m[3*3+2] = p[2][3] - m[3*3+3] = p[3][3] + m[0*4+0] = p[0][0] + m[0*4+1] = p[1][0] + m[0*4+2] = p[2][0] + m[0*4+3] = p[3][0] + m[1*4+0] = p[0][1] + m[1*4+1] = p[1][1] + m[1*4+2] = p[2][1] + m[1*4+3] = p[3][1] + m[2*4+0] = p[0][2] + m[2*4+1] = p[1][2] + m[2*4+2] = p[2][2] + m[2*4+3] = p[3][2] + m[3*4+0] = p[0][3] + m[3*4+1] = p[1][3] + m[3*4+2] = p[2][3] + m[3*4+3] = p[3][3] UniformMatrix4fv(u, m[:]) }