Skip to content

Instantly share code, notes, and snippets.

@thetooth
Created March 26, 2014 10:44
Show Gist options
  • Save thetooth/9780645 to your computer and use it in GitHub Desktop.
Save thetooth/9780645 to your computer and use it in GitHub Desktop.
shaderProgram.bind();
glBindTexture(GL_TEXTURE_2D, sys.texture.get(1).gltexture);
glm::mat4 projection = glm::ortho(0.0f, (float)sys.gc.buffer.width, (float)sys.gc.buffer.height, 0.0f);
glm::mat4 trans = glm::translate(
glm::mat4(1.0f),
glm::vec3(translate.x, translate.y, 0.0f)
);
glm::mat4 view = glm::rotate(
trans,
fmod(clock() * 0.15f, 360.0f),
glm::vec3(0.0f, 0.0f, 1.0f)
);
glm::mat4 model = glm::scale(
glm::mat4(1.0f),
glm::vec3(scale.x, scale.y, 0.0f)
);
glm::mat4 MVP = projection*view*model;
glUniformMatrix4fv(uniTrans, 1, GL_FALSE, glm::value_ptr(MVP));
ballObj.draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment