Commit 5cb97dbb authored by Thomas Renoth's avatar Thomas Renoth
Browse files

make it rotate

parent 79dc2263
......@@ -110,7 +110,7 @@ var
uniforms_proj = shader_program.glGetUniformLocation("proj")
var view = lookAt(
vec3[GLfloat](0.0, 0.0, 1.0), # pos
vec3[GLfloat](0.0, 0.0, 2.0), # pos
vec3[GLfloat](0.0), # target
vec3[GLfloat](0.0, 1.0, 0.0) # up
)
......@@ -160,10 +160,11 @@ proc init_quad =
init_quad()
proc render(t: float) =
#glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT) # Clear color and depth buffers
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT) # Clear color and depth buffers
quad_vao.glBindVertexArray()
var model = mat4x4[GLfloat](1.0)
model = model.rotate(vec3[GLfloat](0.0, 1.0, 0.0), radians(t * 36))
uniforms_model.glUniformMatrix4fv(GLsizei(1), false, model.caddr)
GL_TRIANGLE_STRIP.glDrawElements(GLsizei(4), GL_UNSIGNED_INT, cast[pointer](0))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment