<commit_before>package main

import (
	"log"
	"math"

	gl "github.com/go-gl/gl/v4.1-core/gl"
	"github.com/leafo/weeklyloops/loops"
	"github.com/leafo/weeklyloops/loops/ply"
)

func main() {
	loop := loops.NewLoopWindow()
	loop.Title = "loop4"
	loop.Speed = 0.2

	obj, _ := ply.NewObjectFromFile("cube.ply")

	if obj == nil {
		log.Fatal("failed to load model")
	}

	verts := obj.PackF32("x", "y", "z", "nx", "ny", "nz")
	indexes := obj.PackIndexesB()

	perspective := loops.NewPerspectiveMatrix(60, 1, 0.1, 100)

	loop.Draw = func(t float64, g *loops.Graphics) {
		loop.Enable3d()

		m := loops.NewIdentityMat4().
			Rotate3d(float32(t*math.Pi*2), 0, 1, 0).
			Translate(2, 2, float32(-3+-0.5*math.Sin(t*math.Pi*2*3))).
			Rotate(float32(t * math.Pi * 2))

		g.SetMat(m)
		g.SetViewMat(perspective)

		g.Draw3d(gl.TRIANGLES, verts, indexes)
	}

	loop.Run()
}<commit_msg>make cube loop thing<commit_after>package main

import (
	"log"
	"math"

	gl "github.com/go-gl/gl/v4.1-core/gl"
	"github.com/leafo/weeklyloops/loops"
	"github.com/leafo/weeklyloops/loops/ply"
)

func main() {
	loop := loops.NewLoopWindow()
	loop.Title = "loop4"
	loop.Speed = 0.2

	obj, _ := ply.NewObjectFromFile("cube.ply")

	if obj == nil {
		log.Fatal("failed to load model")
	}

	verts := obj.PackF32("x", "y", "z", "nx", "ny", "nz")
	indexes := obj.PackIndexesB()

	perspective := loops.NewPerspectiveMatrix(60, 1, 0.1, 100)

	loop.Draw = func(t float64, g *loops.Graphics) {
		loop.Enable3d()
		g.SetViewMat(perspective)

		drawCube := func(t float64, scale float64) {
			m := loops.NewIdentityMat4().
				Rotate3d(float32(t*math.Pi*2), 0, 1, 0).
				Translate(2, 2, float32(-3+-0.5*math.Sin(t*math.Pi*2*3)*scale)).
				Rotate(float32(t * math.Pi * 2))

			g.SetMat(m)

			g.Draw3d(gl.TRIANGLES, verts, indexes)

		}

		drawCube(t+math.Sin((t+0.75)*math.Pi*2)*0.05, 1)
		drawCube(t+0.25+math.Sin((t+0.5)*math.Pi*2)*0.05, -1)
		drawCube(t+0.5+math.Sin((t+0.25)*math.Pi*2)*0.05, 1)
		drawCube(t+0.75+math.Sin(t*math.Pi*2)*0.05, -1)
	}

	loop.Run()
}
{'fraction_non_alphanumeric': 0.2075098814229249, 'fraction_numerical': 0.058300395256917, 'mean_word_length': 3.7985781990521326, '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': '6897152', 'n_tokens_mistral': 1048, 'n_tokens_neox': 922, 'n_words': 144}