Пример #1
0
func drawSpinner(spinner int) {
	gl.PushMatrix()
	gl.Translated(30.5, 30.5, 0)
	gl.Rotated(float64(spinner), 0, 0, 1)
	gl.Color3d(0, 0, 0)
	gl.Rectd(-0.5, -10.5, 0.5, 10.5)
	gl.PopMatrix()
}
Пример #2
0
// list of boxes
// the point of origin
// the translated offset from the origin
// the angles co-ordinate
// the index of the array
// the degree of angular rotation
func wall(b []uint32, o, offset, a_cord cord, i int32, a float64, s size) []uint32 {
	b = append(b, gl.GenLists(1))
	gl.NewList(b[i], gl.COMPILE)
	gl.Translated(o.x+offset.x, o.y+offset.y, o.z+offset.z)
	gl.Rotated(a, a_cord.x, a_cord.y, a_cord.z)
	box(s.x, s.y, s.z)
	gl.EndList()
	return b
}
Пример #3
0
// general draw function
func draw() {
	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) // CARGOCULT
	gl.PushMatrix()                                     // CARGOCULT
	gl.Rotated(view_rotx, 1.0, 0.0, 0.0)
	gl.Rotated(view_roty, 0.0, 1.0, 0.0)
	gl.Rotated(view_rotz, 0.0, 0.0, 1.0)
	gl.Translated(0.0, 0.0, view_z)

	for i := range boxes {
		gl.PushMatrix() // CARGOCULT
		gl.CallList(boxes[i])
		gl.PopMatrix() // CARGOCULT
	}

	gl.PopMatrix() // CARGOCULT

	sdl.GL_SwapBuffers() // CARGOCULT
}