Created
August 9, 2011 09:49
-
-
Save eddyb/1133685 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
var GL = require("GL"); | |
GL.initWindow("GL test", 800, 600); | |
GL.enable(GL.DEPTH_TEST); | |
var angle = 0; | |
GL.mainLoop({redraw:function(){ | |
GL.clear(0, 0, 0, 0); | |
GL.loadIdentity(); | |
GL.rotate(angle++, 1, 1, 1); | |
GL.color(0,1,1); | |
GL.begin(GL.POLYGONS); | |
GL.vertex(0.0, 0.0, 0.0); | |
GL.vertex(-1, -1, 0.0); | |
GL.vertex(-1, 1, 0.0); | |
GL.vertex(0.0, 0.0, 1); | |
GL.vertex(1, 1, 2); | |
GL.vertex(1,1, 3); | |
GL.vertex(0.0, 0.0, 0.0); | |
GL.vertex(0.0, 0.0, -0.2); | |
GL.vertex(-0.2, 0.0, -0.2); | |
GL.vertex(-0.2, 0.0, 0.0); | |
GL.vertex(0.0, 0.0, 0.0); | |
GL.vertex(-0.2, 0.0, 0.0); | |
GL.vertex(-0.2, -0.2, 0.0); | |
GL.vertex(0.0, -0.2, 0.0); | |
GL.end(); | |
GL.flush(); | |
GL.swapBuffers(); | |
}, keyPress: function(){GL.postRedisplay();}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment