Exemplo n.º 1
0
func drawgl() {
	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)

	uniYaw = yrot * (math.Pi / 180.0)
	yrot = yrot - 1.0
	uniPitch = zrot * (math.Pi / 180.0)
	zrot = zrot - 0.5
	uniRoll = xrot * (math.Pi / 180.0)
	xrot = xrot - 0.2

	gl.Uniform4f(UniScale, gl.Float(uniRoll), gl.Float(uniYaw), gl.Float(uniPitch), gl.Float(uniscale))
	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
	gl.DrawArrays(gl.TRIANGLES, gl.Int(0), gl.Sizei(len(triangle_vertices)*4))

	time.Sleep(50 * time.Millisecond)

}
Exemplo n.º 2
0
func (loc *UniformLocation) Uniform4f(v0, v1, v2, v3 float32) {
	gl.Uniform4f(loc.id, gl.Float(v0), gl.Float(v1), gl.Float(v2), gl.Float(v3))
}
Exemplo n.º 3
0
func ConvertColorGL(c color.Color) (gl.Float, gl.Float, gl.Float, gl.Float) {
	r, g, b, a := ConvertColorF(c)
	return gl.Float(r), gl.Float(g), gl.Float(b), gl.Float(a)
}