summaryrefslogtreecommitdiff
path: root/graphics.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphics.go')
-rw-r--r--graphics.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/graphics.go b/graphics.go
index 999b37d..87c21ed 100644
--- a/graphics.go
+++ b/graphics.go
@@ -13,8 +13,7 @@ import (
)
var (
- // a single triangle
- triangle = []float32{
+ vertices = []float32{
0.0, 0.5, 0.0,
-0.5, -0.5, 0.0,
0.5, -0.5, 0.0,
@@ -24,7 +23,7 @@ var (
const (
// rotational speed and vector
- OMEGA = 6
+ OMEGA = 3
ROT_X = 0
ROT_Y = 1
ROT_Z = 1
@@ -92,7 +91,7 @@ func newGraphics() Graphics {
gl.LinkProgram(graphics.program)
// create VAO
- graphics.vao = makeVao(triangle)
+ graphics.vao = makeVao(vertices)
// create transformation matrix
graphics.trafo = mgl32.HomogRotate3D(float32(glfw.GetTime()) * OMEGA, mgl32.Vec3{ROT_X, ROT_Y, ROT_Z})
@@ -110,7 +109,7 @@ func (graphics Graphics) draw() {
gl.UniformMatrix4fv(graphics.trafoUniform, 1, false, &graphics.trafo[0])
gl.BindVertexArray(graphics.vao)
- gl.DrawArrays(gl.TRIANGLES, 0, int32(len(triangle)/3))
+ gl.DrawArrays(gl.TRIANGLES, 0, int32(len(vertices)/3))
}
// makeVao initializes and returns a vertex array from the points provided.