Example #1
0
//AFTER USE()
func SetModelMatrix(m *mat4.Mat4) {
	GUsedProgram.SetModelMatrix(m)
	GUsedProgram.SetNormalMatrix(m.Mat3().Transpose())
	m = m.Mul(GViewMatrix)
	GUsedProgram.SetModelViewMatrix(m)
	m = m.Mul(GProjectionMatrix)
	GUsedProgram.SetModelViewProjectionMatrix(m)
}
Example #2
0
func (p *Program) UniformMat4(name string, m *mat4.Mat4) {
	loc := p.GetUniformLocation(name)
	loc.UniformMatrix4fv(m.Fv32(), 1, false)
}