Created
March 26, 2014 10:44
-
-
Save thetooth/9780645 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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