<commit_before>package main

import (
	"github.com/go-gl/gl"
	glfw "github.com/go-gl/glfw3"
	"github.com/go-gl/glu"
	// glmath "github.com/go-gl/mathgl/mgl64"
	// "math"
)

const (
	Width  = 800
	Height = 600
	Title  = "Voxel Party"
)

func block() {
	// gl.ShadeModel(gl.FLAT)
	gl.Normal3d(0.0, 0.0, 1.0)

	gl.Begin(gl.LINE)
	gl.Color4f(1.0, 0.0, 0.0, 1.0)
	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.End()

	gl.Begin(gl.QUADS)

	gl.Color4f(1.0, 1.0, 1.0, 1.0)
	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.Vertex3f(0.5, -0.5, 0.5)
	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, 0.5)

	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(0.5, -0.5, 0.5)

	gl.Vertex3f(-0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)

	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.End()
}

var (
	positionX     = 1.0
	positionY     = 0.0
	positionZ     = -10.0
	positionSpeed = 1.0

	rotationX     = 1.0
	rotationY     = 1.0
	rotationZ     = 0.0
	rotationSpeed = 1.0
)

var (
	block1 uint
)

func draw() {
	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)

	gl.LoadIdentity()

	glu.LookAt(positionX, positionY, positionZ, positionX, positionY, positionZ+1.0, 0, 1, 0)

	gl.PushMatrix()
	gl.CallList(block1)
	gl.PopMatrix()
}

func key(window *glfw.Window, k glfw.Key, s int, action glfw.Action, mods glfw.ModifierKey) {
	if action != glfw.Press {
		return
	}

	switch glfw.Key(k) {
	case glfw.KeyW:
		positionZ += positionSpeed
	case glfw.KeyS:
		positionZ -= positionSpeed
	case glfw.KeyA:
		positionX += positionSpeed
	case glfw.KeyD:
		positionX -= positionSpeed
	case glfw.KeyQ:
		positionY += positionSpeed
	case glfw.KeyE:
		positionY -= positionSpeed
	case glfw.KeyZ:
		if mods&glfw.ModShift != 0 {
			rotationZ -= rotationSpeed
		} else {
			rotationZ += rotationSpeed
		}
	case glfw.KeyEscape:
		window.SetShouldClose(true)
	case glfw.KeyUp:
		rotationX += rotationSpeed
	case glfw.KeyDown:
		rotationX -= rotationSpeed
	case glfw.KeyLeft:
		rotationY += rotationSpeed
	case glfw.KeyRight:
		rotationY -= rotationSpeed
	default:
		return
	}
}

func reshape(window *glfw.Window, width, height int) {
	h := float64(height) / float64(width)

	znear := 5.0
	zfar := 30.0
	xmax := znear * 0.5

	gl.Viewport(0, 0, width, height)
	gl.MatrixMode(gl.PROJECTION)
	gl.LoadIdentity()
	gl.Frustum(-xmax, xmax, -xmax*h, xmax*h, znear, zfar)
	gl.MatrixMode(gl.MODELVIEW)<commit_msg>looking around working with the keyboard<commit_after>package main

import (
	"github.com/go-gl/gl"
	glfw "github.com/go-gl/glfw3"
	"github.com/go-gl/glu"
	// glmath "github.com/go-gl/mathgl/mgl64"
	"math"
)

const (
	Width  = 800
	Height = 600
	Title  = "Voxel Party"
)

func block() {
	// gl.ShadeModel(gl.FLAT)
	gl.Normal3d(0.0, 0.0, 1.0)

	gl.Begin(gl.LINE)
	gl.Color4f(1.0, 0.0, 0.0, 1.0)
	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.End()

	gl.Begin(gl.QUADS)

	gl.Color4f(1.0, 1.0, 1.0, 1.0)
	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.Vertex3f(0.5, -0.5, 0.5)
	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, 0.5)

	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(0.5, -0.5, 0.5)

	gl.Vertex3f(-0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.Vertex3f(0.5, 0.5, 0.5)
	gl.Vertex3f(0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, -0.5)
	gl.Vertex3f(-0.5, 0.5, 0.5)

	gl.Vertex3f(0.5, -0.5, -0.5)
	gl.Vertex3f(0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, 0.5)
	gl.Vertex3f(-0.5, -0.5, -0.5)

	gl.End()
}

var (
	positionX     = 1.0
	positionY     = 0.0
	positionZ     = -10.0
	positionSpeed = 1.0

	rotationX     = math.Pi / 2
	rotationY     = math.Pi / 2
	rotationSpeed = math.Pi / 32
)

var (
	block1 uint
)

func draw() {
	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)

	gl.LoadIdentity()

	point := []float64{math.Cos(rotationY) * math.Sin(rotationX), math.Cos(rotationX), math.Sin(rotationY) * math.Sin(rotationX)}

	glu.LookAt(positionX, positionY, positionZ, positionX+point[0], positionY+point[1], positionZ+point[2], 0, 1, 0)

	gl.PushMatrix()
	gl.CallList(block1)
	gl.PopMatrix()
}

func key(window *glfw.Window, k glfw.Key, s int, action glfw.Action, mods glfw.ModifierKey) {
	if action != glfw.Press {
		return
	}

	switch glfw.Key(k) {
	case glfw.KeyW:
		positionZ += positionSpeed
	case glfw.KeyS:
		positionZ -= positionSpeed
	case glfw.KeyA:
		positionX += positionSpeed
	case glfw.KeyD:
		positionX -= positionSpeed
	case glfw.KeyQ:
		positionY += positionSpeed
	case glfw.KeyE:
		positionY -= positionSpeed
	case glfw.KeyEscape:
		window.SetShouldClose(true)
	case glfw.KeyUp:
		rotationX -= rotationSpeed
	case glfw.KeyDown:
		rotationX += rotationSpeed
	case glfw.KeyLeft:
		rotationY -= rotationSpeed
	case glfw.KeyRight:
		rotationY += rotationSpeed
	default:
		return
	}
}

func reshape(window *glfw.Window, width, height int) {
	h := float64(height) / float64(width)

	znear := 5.0
	zfar := 30.0
	xmax := znear * 0.5

	gl.Viewport(0, 0, width, height)
	gl.MatrixMode(gl.PROJECTION)
	gl.LoadIdentity()
	gl.Frustum(-xmax, xmax, -xmax*h, xmax*h, znear, zfar)
	gl.MatrixMode(gl.MODELVIEW)
{'fraction_non_alphanumeric': 0.1920353982300885, 'fraction_numerical': 0.0895575221238938, 'mean_word_length': 2.9324982602644396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6654572', 'n_tokens_mistral': 3035, 'n_tokens_neox': 2832, 'n_words': 505}