Beispiel #1
0
func (p *Poly) Render() {
	if p.A != 0 {
		colbuf[0], colbuf[1], colbuf[2] = float32(p.R)/255, float32(p.G)/255, float32(p.B)/255
		gl.Materialfv(gl.FRONT_AND_BACK, gl.AMBIENT_AND_DIFFUSE, (*gl.Float)(&(colbuf[0])))
		Normal3f(p.normal[0], p.normal[1], p.normal[2])
		for _, v := range p.vertex {
			Vertex3f(v[0], v[1], v[2])
		}
	}
}
Beispiel #2
0
func Custom(r, g, b, a gl.Float) {
	color := []gl.Float{r, g, b, a}
	gl.Materialfv(gl.FRONT, gl.AMBIENT_AND_DIFFUSE, &color[0])
}
Beispiel #3
0
func Material(c []gl.Float) {
	gl.Materialfv(gl.FRONT, gl.AMBIENT_AND_DIFFUSE, &c[0])
}