aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-29 14:01:37 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-29 14:01:37 -0700
commitec6ce2baf4f5c03693ab38219b004a78c136ce53 (patch)
tree82d12be973d553518f133227e5bd667d7ec575c5
parentcb0bb1c1a76850bd4a3ee6faa2af7e879d23e991 (diff)
correct coordinate type in glRotate and add testing
-rw-r--r--src/library_gl.js2
-rw-r--r--tests/cubegeom.c3
-rwxr-xr-xtests/runner.py4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index a767593a..e9dc711a 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1757,7 +1757,7 @@ var LibraryGL = {
glTranslatef: 'glTranslated',
glRotated: function(angle, x, y, z) {
- GL.immediate.matrix.lib.mat4.rotate(GL.immediate.matrix[GL.immediate.currentMatrix], angle, [x, y, z]);
+ GL.immediate.matrix.lib.mat4.rotate(GL.immediate.matrix[GL.immediate.currentMatrix], angle*Math.PI/180, [x, y, z]);
},
glRotatef: 'glRotated',
diff --git a/tests/cubegeom.c b/tests/cubegeom.c
index 17d6e909..ecefb24a 100644
--- a/tests/cubegeom.c
+++ b/tests/cubegeom.c
@@ -101,6 +101,7 @@ int main(int argc, char *argv[])
glLoadIdentity();
// original: glFrustum(-0.6435469817188064, 0.6435469817188064 ,-0.48266022190470925, 0.48266022190470925 ,0.5400000214576721, 2048);
glFrustum(-0.6435469817188064, 0.1435469817188064 ,-0.48266022190470925, 0.88266022190470925 ,0.5400000214576721, 2048);
+ glRotatef(-30, 1, 1, 1);
//GLfloat pm[] = { 1.372136116027832, 0, 0, 0, 0, 0.7910231351852417, 0, 0, -0.6352481842041016, 0.29297152161598206, -1.0005275011062622, -1, 0, 0, -1.080284833908081, 0 };
//glLoadMatrixf(pm);
@@ -285,7 +286,7 @@ int main(int argc, char *argv[])
verify();
#if !EMSCRIPTEN
- SDL_Delay(3000);
+ SDL_Delay(1500);
#endif
SDL_Quit();
diff --git a/tests/runner.py b/tests/runner.py
index 143587a0..a5b5ad84 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7236,10 +7236,10 @@ elif 'browser' in str(sys.argv):
self.btest('cubegeom_pre2.c', expected='-1472804742', args=['-s', 'GL_DEBUG=1'])
def test_cubegeom_pre3(self):
- self.btest('cubegeom_pre3.c', expected='-1472804742', args=['-s', 'GL_DEBUG=1'])
+ self.btest('cubegeom_pre3.c', expected='-1472804742')
def test_cubegeom(self):
- self.btest('cubegeom.c', expected='-1402263178')
+ self.btest('cubegeom.c', expected='188641320')
elif 'benchmark' in str(sys.argv):
# Benchmarks. Run them with argument |benchmark|. To run a specific test, do