From 4e71b7d565ef3e58349ce9e9ef2ceb21e606a875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 17:25:43 -0300 Subject: [PATCH 01/11] Remove executable bits from non-executable files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rogério Brito --- Chap10/README.txt | 0 Chap10/mandelbrot1.html | 0 Chap10/mandelbrot1.js | 0 Chap10/mandelbrot2.html | 0 Chap10/mandelbrot2.js | 0 Chap10/particleSystem.html | 0 Chap10/particleSystem.js | 0 Chap11/README.txt | 0 Chap11/patches.js | 0 Chap11/teapot1.html | 0 Chap11/teapot1.js | 0 Chap11/teapot2.html | 0 Chap11/teapot2.js | 0 Chap11/teapot3.html | 0 Chap11/teapot3.js | 0 Chap11/teapot4.html | 0 Chap11/teapot4.js | 0 Chap11/teapot5.html | 0 Chap11/teapot5.js | 0 Chap11/teapot6.html | 0 Chap11/teapot7.html | 0 Chap11/vertices.js | 0 Chap2/README.txt | 0 Chap2/gasket1.html | 0 Chap2/gasket1.js | 0 Chap2/gasket1v2.html | 0 Chap2/gasket1v2.js | 0 Chap2/gasket2.html | 0 Chap2/gasket2.js | 0 Chap2/gasket3.html | 0 Chap2/gasket3.js | 0 Chap2/gasket4.html | 0 Chap2/gasket4.js | 0 Chap2/shaders/fshader21.glsl | 0 Chap2/shaders/vshader21.glsl | 0 Chap3/README.txt | 0 Chap3/cad1.html | 0 Chap3/cad1.js | 0 Chap3/cad2.html | 0 Chap3/cad2.js | 0 Chap3/gasket5.html | 0 Chap3/gasket5.js | 0 Chap3/square.html | 0 Chap3/square.js | 0 Chap3/squarem.html | 0 Chap3/squarem.js | 0 Chap3/triangle.html | 0 Chap3/triangle.js | 0 Chap4/README.txt | 0 Chap4/cube.html | 0 Chap4/cube.js | 0 Chap4/cubeq.html | 0 Chap4/cubeq.js | 0 Chap4/cubev.html | 0 Chap4/cubev.js | 0 Chap4/trackball.html | 0 Chap4/trackball.js | 0 Chap4/trackballQuaterion.html | 0 Chap4/trackballQuaterion.js | 0 Chap5/README.txt | 0 Chap5/hat.html | 0 Chap5/hat.js | 0 Chap5/hata.html | 0 Chap5/hata.js | 0 Chap5/ortho.html | 0 Chap5/ortho.js | 0 Chap5/ortho1.html | 0 Chap5/ortho1.js | 0 Chap5/ortho2.html | 0 Chap5/ortho2.js | 0 Chap5/perspective.html | 0 Chap5/perspective.js | 0 Chap5/perspective1.html | 0 Chap5/perspective1.js | 0 Chap5/perspective2.html | 0 Chap5/perspective2.js | 0 Chap5/shadow.html | 0 Chap5/shadow.js | 0 Chap6/README.txt | 0 Chap6/shadedCube.html | 0 Chap6/shadedCube.js | 0 Chap6/shadedSphere1.html | 0 Chap6/shadedSphere1.js | 0 Chap6/shadedSphere2.html | 0 Chap6/shadedSphere2.js | 0 Chap6/shadedSphere3.html | 0 Chap6/shadedSphere3.js | 0 Chap6/shadedSphere4.html | 0 Chap6/shadedSphere4.js | 0 Chap6/shadedSphereEyeSpace.html | 0 Chap6/shadedSphereEyeSpace.js | 0 Chap6/shadedSphereObjectSpace.html | 0 Chap6/shadedSphereObjectSpace.js | 0 Chap6/wireSphere.html | 0 Chap6/wireSphere.js | 0 Chap7/README.txt | 0 Chap7/SA2011_black.gif | Bin Chap7/bumpMap.html | 0 Chap7/bumpMap.js | 0 Chap7/bumpMap2.html | 0 Chap7/bumpMap2.js | 0 Chap7/cubet.html | 0 Chap7/cubet.js | 0 Chap7/hatImage1.html | 0 Chap7/hatImage1.js | 0 Chap7/hatImage2.html | 0 Chap7/hatImage2.js | 0 Chap7/hawaiiImage.html | 0 Chap7/hawaiiImage.js | 0 Chap7/hawaiiIsobel.html | 0 Chap7/hawaiisobel.js | 0 Chap7/honolulu256.js | 0 Chap7/honolulu4.js | 0 Chap7/pickCube.html | 0 Chap7/pickCube.js | 0 Chap7/pickCube2.html | 0 Chap7/pickCube2.js | 0 Chap7/pickCube3.html | 0 Chap7/pickCube3.js | 0 Chap7/pickCube4.html | 0 Chap7/pickCube4.js | 0 Chap7/pickCube5.html | 0 Chap7/pickCube5.js | 0 Chap7/reflectiingCube.html | 0 Chap7/reflectingCube.js | 0 Chap7/reflectingSphere.html | 0 Chap7/reflectingSphere.js | 0 Chap7/reflectionMap.html | 0 Chap7/reflectionMap.js | 0 Chap7/reflectionMap2.html | 0 Chap7/reflectionMap2.js | 0 Chap7/render1.html | 0 Chap7/render1.js | 0 Chap7/render1v2.html | 0 Chap7/render1v2.js | 0 Chap7/render3.html | 0 Chap7/render3.js | 0 Chap7/render4.html | 0 Chap7/render4.js | 0 Chap7/render5.html | 0 Chap7/render5.js | 0 Chap7/textureCube1.html | 0 Chap7/textureCube1.js | 0 Chap7/textureCubev2.html | 0 Chap7/textureCubev2.js | 0 Chap7/textureCubev3.html | 0 Chap7/textureCubev3.js | 0 Chap7/textureCubev4.html | 0 Chap7/textureCubev4.js | 0 Chap7/textureSquare.html | 0 Chap7/textureSquare.js | 0 Chap9/README.txt | 0 Chap9/figure.html | 0 Chap9/figure.js | 0 Chap9/robotArm.html | 0 Chap9/robotArm.js | 0 Common/MV.js | 0 Common/README.txt | 0 Common/initShaders.js | 0 Common/initShaders2.js | 0 Common/webgl-utils.js | 0 161 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Chap10/README.txt mode change 100755 => 100644 Chap10/mandelbrot1.html mode change 100755 => 100644 Chap10/mandelbrot1.js mode change 100755 => 100644 Chap10/mandelbrot2.html mode change 100755 => 100644 Chap10/mandelbrot2.js mode change 100755 => 100644 Chap10/particleSystem.html mode change 100755 => 100644 Chap10/particleSystem.js mode change 100755 => 100644 Chap11/README.txt mode change 100755 => 100644 Chap11/patches.js mode change 100755 => 100644 Chap11/teapot1.html mode change 100755 => 100644 Chap11/teapot1.js mode change 100755 => 100644 Chap11/teapot2.html mode change 100755 => 100644 Chap11/teapot2.js mode change 100755 => 100644 Chap11/teapot3.html mode change 100755 => 100644 Chap11/teapot3.js mode change 100755 => 100644 Chap11/teapot4.html mode change 100755 => 100644 Chap11/teapot4.js mode change 100755 => 100644 Chap11/teapot5.html mode change 100755 => 100644 Chap11/teapot5.js mode change 100755 => 100644 Chap11/teapot6.html mode change 100755 => 100644 Chap11/teapot7.html mode change 100755 => 100644 Chap11/vertices.js mode change 100755 => 100644 Chap2/README.txt mode change 100755 => 100644 Chap2/gasket1.html mode change 100755 => 100644 Chap2/gasket1.js mode change 100755 => 100644 Chap2/gasket1v2.html mode change 100755 => 100644 Chap2/gasket1v2.js mode change 100755 => 100644 Chap2/gasket2.html mode change 100755 => 100644 Chap2/gasket2.js mode change 100755 => 100644 Chap2/gasket3.html mode change 100755 => 100644 Chap2/gasket3.js mode change 100755 => 100644 Chap2/gasket4.html mode change 100755 => 100644 Chap2/gasket4.js mode change 100755 => 100644 Chap2/shaders/fshader21.glsl mode change 100755 => 100644 Chap2/shaders/vshader21.glsl mode change 100755 => 100644 Chap3/README.txt mode change 100755 => 100644 Chap3/cad1.html mode change 100755 => 100644 Chap3/cad1.js mode change 100755 => 100644 Chap3/cad2.html mode change 100755 => 100644 Chap3/cad2.js mode change 100755 => 100644 Chap3/gasket5.html mode change 100755 => 100644 Chap3/gasket5.js mode change 100755 => 100644 Chap3/square.html mode change 100755 => 100644 Chap3/square.js mode change 100755 => 100644 Chap3/squarem.html mode change 100755 => 100644 Chap3/squarem.js mode change 100755 => 100644 Chap3/triangle.html mode change 100755 => 100644 Chap3/triangle.js mode change 100755 => 100644 Chap4/README.txt mode change 100755 => 100644 Chap4/cube.html mode change 100755 => 100644 Chap4/cube.js mode change 100755 => 100644 Chap4/cubeq.html mode change 100755 => 100644 Chap4/cubeq.js mode change 100755 => 100644 Chap4/cubev.html mode change 100755 => 100644 Chap4/cubev.js mode change 100755 => 100644 Chap4/trackball.html mode change 100755 => 100644 Chap4/trackball.js mode change 100755 => 100644 Chap4/trackballQuaterion.html mode change 100755 => 100644 Chap4/trackballQuaterion.js mode change 100755 => 100644 Chap5/README.txt mode change 100755 => 100644 Chap5/hat.html mode change 100755 => 100644 Chap5/hat.js mode change 100755 => 100644 Chap5/hata.html mode change 100755 => 100644 Chap5/hata.js mode change 100755 => 100644 Chap5/ortho.html mode change 100755 => 100644 Chap5/ortho.js mode change 100755 => 100644 Chap5/ortho1.html mode change 100755 => 100644 Chap5/ortho1.js mode change 100755 => 100644 Chap5/ortho2.html mode change 100755 => 100644 Chap5/ortho2.js mode change 100755 => 100644 Chap5/perspective.html mode change 100755 => 100644 Chap5/perspective.js mode change 100755 => 100644 Chap5/perspective1.html mode change 100755 => 100644 Chap5/perspective1.js mode change 100755 => 100644 Chap5/perspective2.html mode change 100755 => 100644 Chap5/perspective2.js mode change 100755 => 100644 Chap5/shadow.html mode change 100755 => 100644 Chap5/shadow.js mode change 100755 => 100644 Chap6/README.txt mode change 100755 => 100644 Chap6/shadedCube.html mode change 100755 => 100644 Chap6/shadedCube.js mode change 100755 => 100644 Chap6/shadedSphere1.html mode change 100755 => 100644 Chap6/shadedSphere1.js mode change 100755 => 100644 Chap6/shadedSphere2.html mode change 100755 => 100644 Chap6/shadedSphere2.js mode change 100755 => 100644 Chap6/shadedSphere3.html mode change 100755 => 100644 Chap6/shadedSphere3.js mode change 100755 => 100644 Chap6/shadedSphere4.html mode change 100755 => 100644 Chap6/shadedSphere4.js mode change 100755 => 100644 Chap6/shadedSphereEyeSpace.html mode change 100755 => 100644 Chap6/shadedSphereEyeSpace.js mode change 100755 => 100644 Chap6/shadedSphereObjectSpace.html mode change 100755 => 100644 Chap6/shadedSphereObjectSpace.js mode change 100755 => 100644 Chap6/wireSphere.html mode change 100755 => 100644 Chap6/wireSphere.js mode change 100755 => 100644 Chap7/README.txt mode change 100755 => 100644 Chap7/SA2011_black.gif mode change 100755 => 100644 Chap7/bumpMap.html mode change 100755 => 100644 Chap7/bumpMap.js mode change 100755 => 100644 Chap7/bumpMap2.html mode change 100755 => 100644 Chap7/bumpMap2.js mode change 100755 => 100644 Chap7/cubet.html mode change 100755 => 100644 Chap7/cubet.js mode change 100755 => 100644 Chap7/hatImage1.html mode change 100755 => 100644 Chap7/hatImage1.js mode change 100755 => 100644 Chap7/hatImage2.html mode change 100755 => 100644 Chap7/hatImage2.js mode change 100755 => 100644 Chap7/hawaiiImage.html mode change 100755 => 100644 Chap7/hawaiiImage.js mode change 100755 => 100644 Chap7/hawaiiIsobel.html mode change 100755 => 100644 Chap7/hawaiisobel.js mode change 100755 => 100644 Chap7/honolulu256.js mode change 100755 => 100644 Chap7/honolulu4.js mode change 100755 => 100644 Chap7/pickCube.html mode change 100755 => 100644 Chap7/pickCube.js mode change 100755 => 100644 Chap7/pickCube2.html mode change 100755 => 100644 Chap7/pickCube2.js mode change 100755 => 100644 Chap7/pickCube3.html mode change 100755 => 100644 Chap7/pickCube3.js mode change 100755 => 100644 Chap7/pickCube4.html mode change 100755 => 100644 Chap7/pickCube4.js mode change 100755 => 100644 Chap7/pickCube5.html mode change 100755 => 100644 Chap7/pickCube5.js mode change 100755 => 100644 Chap7/reflectiingCube.html mode change 100755 => 100644 Chap7/reflectingCube.js mode change 100755 => 100644 Chap7/reflectingSphere.html mode change 100755 => 100644 Chap7/reflectingSphere.js mode change 100755 => 100644 Chap7/reflectionMap.html mode change 100755 => 100644 Chap7/reflectionMap.js mode change 100755 => 100644 Chap7/reflectionMap2.html mode change 100755 => 100644 Chap7/reflectionMap2.js mode change 100755 => 100644 Chap7/render1.html mode change 100755 => 100644 Chap7/render1.js mode change 100755 => 100644 Chap7/render1v2.html mode change 100755 => 100644 Chap7/render1v2.js mode change 100755 => 100644 Chap7/render3.html mode change 100755 => 100644 Chap7/render3.js mode change 100755 => 100644 Chap7/render4.html mode change 100755 => 100644 Chap7/render4.js mode change 100755 => 100644 Chap7/render5.html mode change 100755 => 100644 Chap7/render5.js mode change 100755 => 100644 Chap7/textureCube1.html mode change 100755 => 100644 Chap7/textureCube1.js mode change 100755 => 100644 Chap7/textureCubev2.html mode change 100755 => 100644 Chap7/textureCubev2.js mode change 100755 => 100644 Chap7/textureCubev3.html mode change 100755 => 100644 Chap7/textureCubev3.js mode change 100755 => 100644 Chap7/textureCubev4.html mode change 100755 => 100644 Chap7/textureCubev4.js mode change 100755 => 100644 Chap7/textureSquare.html mode change 100755 => 100644 Chap7/textureSquare.js mode change 100755 => 100644 Chap9/README.txt mode change 100755 => 100644 Chap9/figure.html mode change 100755 => 100644 Chap9/figure.js mode change 100755 => 100644 Chap9/robotArm.html mode change 100755 => 100644 Chap9/robotArm.js mode change 100755 => 100644 Common/MV.js mode change 100755 => 100644 Common/README.txt mode change 100755 => 100644 Common/initShaders.js mode change 100755 => 100644 Common/initShaders2.js mode change 100755 => 100644 Common/webgl-utils.js diff --git a/Chap10/README.txt b/Chap10/README.txt old mode 100755 new mode 100644 diff --git a/Chap10/mandelbrot1.html b/Chap10/mandelbrot1.html old mode 100755 new mode 100644 diff --git a/Chap10/mandelbrot1.js b/Chap10/mandelbrot1.js old mode 100755 new mode 100644 diff --git a/Chap10/mandelbrot2.html b/Chap10/mandelbrot2.html old mode 100755 new mode 100644 diff --git a/Chap10/mandelbrot2.js b/Chap10/mandelbrot2.js old mode 100755 new mode 100644 diff --git a/Chap10/particleSystem.html b/Chap10/particleSystem.html old mode 100755 new mode 100644 diff --git a/Chap10/particleSystem.js b/Chap10/particleSystem.js old mode 100755 new mode 100644 diff --git a/Chap11/README.txt b/Chap11/README.txt old mode 100755 new mode 100644 diff --git a/Chap11/patches.js b/Chap11/patches.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot1.html b/Chap11/teapot1.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot1.js b/Chap11/teapot1.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot2.html b/Chap11/teapot2.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot2.js b/Chap11/teapot2.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot3.html b/Chap11/teapot3.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot3.js b/Chap11/teapot3.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot4.html b/Chap11/teapot4.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot4.js b/Chap11/teapot4.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot5.html b/Chap11/teapot5.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot5.js b/Chap11/teapot5.js old mode 100755 new mode 100644 diff --git a/Chap11/teapot6.html b/Chap11/teapot6.html old mode 100755 new mode 100644 diff --git a/Chap11/teapot7.html b/Chap11/teapot7.html old mode 100755 new mode 100644 diff --git a/Chap11/vertices.js b/Chap11/vertices.js old mode 100755 new mode 100644 diff --git a/Chap2/README.txt b/Chap2/README.txt old mode 100755 new mode 100644 diff --git a/Chap2/gasket1.html b/Chap2/gasket1.html old mode 100755 new mode 100644 diff --git a/Chap2/gasket1.js b/Chap2/gasket1.js old mode 100755 new mode 100644 diff --git a/Chap2/gasket1v2.html b/Chap2/gasket1v2.html old mode 100755 new mode 100644 diff --git a/Chap2/gasket1v2.js b/Chap2/gasket1v2.js old mode 100755 new mode 100644 diff --git a/Chap2/gasket2.html b/Chap2/gasket2.html old mode 100755 new mode 100644 diff --git a/Chap2/gasket2.js b/Chap2/gasket2.js old mode 100755 new mode 100644 diff --git a/Chap2/gasket3.html b/Chap2/gasket3.html old mode 100755 new mode 100644 diff --git a/Chap2/gasket3.js b/Chap2/gasket3.js old mode 100755 new mode 100644 diff --git a/Chap2/gasket4.html b/Chap2/gasket4.html old mode 100755 new mode 100644 diff --git a/Chap2/gasket4.js b/Chap2/gasket4.js old mode 100755 new mode 100644 diff --git a/Chap2/shaders/fshader21.glsl b/Chap2/shaders/fshader21.glsl old mode 100755 new mode 100644 diff --git a/Chap2/shaders/vshader21.glsl b/Chap2/shaders/vshader21.glsl old mode 100755 new mode 100644 diff --git a/Chap3/README.txt b/Chap3/README.txt old mode 100755 new mode 100644 diff --git a/Chap3/cad1.html b/Chap3/cad1.html old mode 100755 new mode 100644 diff --git a/Chap3/cad1.js b/Chap3/cad1.js old mode 100755 new mode 100644 diff --git a/Chap3/cad2.html b/Chap3/cad2.html old mode 100755 new mode 100644 diff --git a/Chap3/cad2.js b/Chap3/cad2.js old mode 100755 new mode 100644 diff --git a/Chap3/gasket5.html b/Chap3/gasket5.html old mode 100755 new mode 100644 diff --git a/Chap3/gasket5.js b/Chap3/gasket5.js old mode 100755 new mode 100644 diff --git a/Chap3/square.html b/Chap3/square.html old mode 100755 new mode 100644 diff --git a/Chap3/square.js b/Chap3/square.js old mode 100755 new mode 100644 diff --git a/Chap3/squarem.html b/Chap3/squarem.html old mode 100755 new mode 100644 diff --git a/Chap3/squarem.js b/Chap3/squarem.js old mode 100755 new mode 100644 diff --git a/Chap3/triangle.html b/Chap3/triangle.html old mode 100755 new mode 100644 diff --git a/Chap3/triangle.js b/Chap3/triangle.js old mode 100755 new mode 100644 diff --git a/Chap4/README.txt b/Chap4/README.txt old mode 100755 new mode 100644 diff --git a/Chap4/cube.html b/Chap4/cube.html old mode 100755 new mode 100644 diff --git a/Chap4/cube.js b/Chap4/cube.js old mode 100755 new mode 100644 diff --git a/Chap4/cubeq.html b/Chap4/cubeq.html old mode 100755 new mode 100644 diff --git a/Chap4/cubeq.js b/Chap4/cubeq.js old mode 100755 new mode 100644 diff --git a/Chap4/cubev.html b/Chap4/cubev.html old mode 100755 new mode 100644 diff --git a/Chap4/cubev.js b/Chap4/cubev.js old mode 100755 new mode 100644 diff --git a/Chap4/trackball.html b/Chap4/trackball.html old mode 100755 new mode 100644 diff --git a/Chap4/trackball.js b/Chap4/trackball.js old mode 100755 new mode 100644 diff --git a/Chap4/trackballQuaterion.html b/Chap4/trackballQuaterion.html old mode 100755 new mode 100644 diff --git a/Chap4/trackballQuaterion.js b/Chap4/trackballQuaterion.js old mode 100755 new mode 100644 diff --git a/Chap5/README.txt b/Chap5/README.txt old mode 100755 new mode 100644 diff --git a/Chap5/hat.html b/Chap5/hat.html old mode 100755 new mode 100644 diff --git a/Chap5/hat.js b/Chap5/hat.js old mode 100755 new mode 100644 diff --git a/Chap5/hata.html b/Chap5/hata.html old mode 100755 new mode 100644 diff --git a/Chap5/hata.js b/Chap5/hata.js old mode 100755 new mode 100644 diff --git a/Chap5/ortho.html b/Chap5/ortho.html old mode 100755 new mode 100644 diff --git a/Chap5/ortho.js b/Chap5/ortho.js old mode 100755 new mode 100644 diff --git a/Chap5/ortho1.html b/Chap5/ortho1.html old mode 100755 new mode 100644 diff --git a/Chap5/ortho1.js b/Chap5/ortho1.js old mode 100755 new mode 100644 diff --git a/Chap5/ortho2.html b/Chap5/ortho2.html old mode 100755 new mode 100644 diff --git a/Chap5/ortho2.js b/Chap5/ortho2.js old mode 100755 new mode 100644 diff --git a/Chap5/perspective.html b/Chap5/perspective.html old mode 100755 new mode 100644 diff --git a/Chap5/perspective.js b/Chap5/perspective.js old mode 100755 new mode 100644 diff --git a/Chap5/perspective1.html b/Chap5/perspective1.html old mode 100755 new mode 100644 diff --git a/Chap5/perspective1.js b/Chap5/perspective1.js old mode 100755 new mode 100644 diff --git a/Chap5/perspective2.html b/Chap5/perspective2.html old mode 100755 new mode 100644 diff --git a/Chap5/perspective2.js b/Chap5/perspective2.js old mode 100755 new mode 100644 diff --git a/Chap5/shadow.html b/Chap5/shadow.html old mode 100755 new mode 100644 diff --git a/Chap5/shadow.js b/Chap5/shadow.js old mode 100755 new mode 100644 diff --git a/Chap6/README.txt b/Chap6/README.txt old mode 100755 new mode 100644 diff --git a/Chap6/shadedCube.html b/Chap6/shadedCube.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedCube.js b/Chap6/shadedCube.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere1.html b/Chap6/shadedSphere1.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere1.js b/Chap6/shadedSphere1.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere2.html b/Chap6/shadedSphere2.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere2.js b/Chap6/shadedSphere2.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere3.html b/Chap6/shadedSphere3.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere3.js b/Chap6/shadedSphere3.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere4.html b/Chap6/shadedSphere4.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphere4.js b/Chap6/shadedSphere4.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphereEyeSpace.html b/Chap6/shadedSphereEyeSpace.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphereEyeSpace.js b/Chap6/shadedSphereEyeSpace.js old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphereObjectSpace.html b/Chap6/shadedSphereObjectSpace.html old mode 100755 new mode 100644 diff --git a/Chap6/shadedSphereObjectSpace.js b/Chap6/shadedSphereObjectSpace.js old mode 100755 new mode 100644 diff --git a/Chap6/wireSphere.html b/Chap6/wireSphere.html old mode 100755 new mode 100644 diff --git a/Chap6/wireSphere.js b/Chap6/wireSphere.js old mode 100755 new mode 100644 diff --git a/Chap7/README.txt b/Chap7/README.txt old mode 100755 new mode 100644 diff --git a/Chap7/SA2011_black.gif b/Chap7/SA2011_black.gif old mode 100755 new mode 100644 diff --git a/Chap7/bumpMap.html b/Chap7/bumpMap.html old mode 100755 new mode 100644 diff --git a/Chap7/bumpMap.js b/Chap7/bumpMap.js old mode 100755 new mode 100644 diff --git a/Chap7/bumpMap2.html b/Chap7/bumpMap2.html old mode 100755 new mode 100644 diff --git a/Chap7/bumpMap2.js b/Chap7/bumpMap2.js old mode 100755 new mode 100644 diff --git a/Chap7/cubet.html b/Chap7/cubet.html old mode 100755 new mode 100644 diff --git a/Chap7/cubet.js b/Chap7/cubet.js old mode 100755 new mode 100644 diff --git a/Chap7/hatImage1.html b/Chap7/hatImage1.html old mode 100755 new mode 100644 diff --git a/Chap7/hatImage1.js b/Chap7/hatImage1.js old mode 100755 new mode 100644 diff --git a/Chap7/hatImage2.html b/Chap7/hatImage2.html old mode 100755 new mode 100644 diff --git a/Chap7/hatImage2.js b/Chap7/hatImage2.js old mode 100755 new mode 100644 diff --git a/Chap7/hawaiiImage.html b/Chap7/hawaiiImage.html old mode 100755 new mode 100644 diff --git a/Chap7/hawaiiImage.js b/Chap7/hawaiiImage.js old mode 100755 new mode 100644 diff --git a/Chap7/hawaiiIsobel.html b/Chap7/hawaiiIsobel.html old mode 100755 new mode 100644 diff --git a/Chap7/hawaiisobel.js b/Chap7/hawaiisobel.js old mode 100755 new mode 100644 diff --git a/Chap7/honolulu256.js b/Chap7/honolulu256.js old mode 100755 new mode 100644 diff --git a/Chap7/honolulu4.js b/Chap7/honolulu4.js old mode 100755 new mode 100644 diff --git a/Chap7/pickCube.html b/Chap7/pickCube.html old mode 100755 new mode 100644 diff --git a/Chap7/pickCube.js b/Chap7/pickCube.js old mode 100755 new mode 100644 diff --git a/Chap7/pickCube2.html b/Chap7/pickCube2.html old mode 100755 new mode 100644 diff --git a/Chap7/pickCube2.js b/Chap7/pickCube2.js old mode 100755 new mode 100644 diff --git a/Chap7/pickCube3.html b/Chap7/pickCube3.html old mode 100755 new mode 100644 diff --git a/Chap7/pickCube3.js b/Chap7/pickCube3.js old mode 100755 new mode 100644 diff --git a/Chap7/pickCube4.html b/Chap7/pickCube4.html old mode 100755 new mode 100644 diff --git a/Chap7/pickCube4.js b/Chap7/pickCube4.js old mode 100755 new mode 100644 diff --git a/Chap7/pickCube5.html b/Chap7/pickCube5.html old mode 100755 new mode 100644 diff --git a/Chap7/pickCube5.js b/Chap7/pickCube5.js old mode 100755 new mode 100644 diff --git a/Chap7/reflectiingCube.html b/Chap7/reflectiingCube.html old mode 100755 new mode 100644 diff --git a/Chap7/reflectingCube.js b/Chap7/reflectingCube.js old mode 100755 new mode 100644 diff --git a/Chap7/reflectingSphere.html b/Chap7/reflectingSphere.html old mode 100755 new mode 100644 diff --git a/Chap7/reflectingSphere.js b/Chap7/reflectingSphere.js old mode 100755 new mode 100644 diff --git a/Chap7/reflectionMap.html b/Chap7/reflectionMap.html old mode 100755 new mode 100644 diff --git a/Chap7/reflectionMap.js b/Chap7/reflectionMap.js old mode 100755 new mode 100644 diff --git a/Chap7/reflectionMap2.html b/Chap7/reflectionMap2.html old mode 100755 new mode 100644 diff --git a/Chap7/reflectionMap2.js b/Chap7/reflectionMap2.js old mode 100755 new mode 100644 diff --git a/Chap7/render1.html b/Chap7/render1.html old mode 100755 new mode 100644 diff --git a/Chap7/render1.js b/Chap7/render1.js old mode 100755 new mode 100644 diff --git a/Chap7/render1v2.html b/Chap7/render1v2.html old mode 100755 new mode 100644 diff --git a/Chap7/render1v2.js b/Chap7/render1v2.js old mode 100755 new mode 100644 diff --git a/Chap7/render3.html b/Chap7/render3.html old mode 100755 new mode 100644 diff --git a/Chap7/render3.js b/Chap7/render3.js old mode 100755 new mode 100644 diff --git a/Chap7/render4.html b/Chap7/render4.html old mode 100755 new mode 100644 diff --git a/Chap7/render4.js b/Chap7/render4.js old mode 100755 new mode 100644 diff --git a/Chap7/render5.html b/Chap7/render5.html old mode 100755 new mode 100644 diff --git a/Chap7/render5.js b/Chap7/render5.js old mode 100755 new mode 100644 diff --git a/Chap7/textureCube1.html b/Chap7/textureCube1.html old mode 100755 new mode 100644 diff --git a/Chap7/textureCube1.js b/Chap7/textureCube1.js old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev2.html b/Chap7/textureCubev2.html old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev2.js b/Chap7/textureCubev2.js old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev3.html b/Chap7/textureCubev3.html old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev3.js b/Chap7/textureCubev3.js old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev4.html b/Chap7/textureCubev4.html old mode 100755 new mode 100644 diff --git a/Chap7/textureCubev4.js b/Chap7/textureCubev4.js old mode 100755 new mode 100644 diff --git a/Chap7/textureSquare.html b/Chap7/textureSquare.html old mode 100755 new mode 100644 diff --git a/Chap7/textureSquare.js b/Chap7/textureSquare.js old mode 100755 new mode 100644 diff --git a/Chap9/README.txt b/Chap9/README.txt old mode 100755 new mode 100644 diff --git a/Chap9/figure.html b/Chap9/figure.html old mode 100755 new mode 100644 diff --git a/Chap9/figure.js b/Chap9/figure.js old mode 100755 new mode 100644 diff --git a/Chap9/robotArm.html b/Chap9/robotArm.html old mode 100755 new mode 100644 diff --git a/Chap9/robotArm.js b/Chap9/robotArm.js old mode 100755 new mode 100644 diff --git a/Common/MV.js b/Common/MV.js old mode 100755 new mode 100644 diff --git a/Common/README.txt b/Common/README.txt old mode 100755 new mode 100644 diff --git a/Common/initShaders.js b/Common/initShaders.js old mode 100755 new mode 100644 diff --git a/Common/initShaders2.js b/Common/initShaders2.js old mode 100755 new mode 100644 diff --git a/Common/webgl-utils.js b/Common/webgl-utils.js old mode 100755 new mode 100644 From 44f65701c5048711c8b808e1bbb7953c03905f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 17:35:50 -0300 Subject: [PATCH 02/11] Common: Avoid variable redeclarations in same scope. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In JavaScript, differently from C/C++, varibles are function-scoped instead of block-scoped. This patch unifies the declaration of the same variables so that static analyzers don't complain about the code. Signed-off-by: Rogério Brito --- Common/MV.js | 31 +++++++++++++++++++------------ Common/initShaders.js | 7 ++++--- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 16f3f37..821431a 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -191,13 +191,14 @@ function equal( u, v ) function add( u, v ) { var result = []; + var i; if ( u.matrix && v.matrix ) { if ( u.length != v.length ) { throw "add(): trying to add matrices of different dimensions"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { throw "add(): trying to add matrices of different dimensions"; } @@ -219,7 +220,7 @@ function add( u, v ) throw "add(): vectors are not the same dimension"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { result.push( u[i] + v[i] ); } @@ -232,6 +233,7 @@ function add( u, v ) function subtract( u, v ) { var result = []; + var i; if ( u.matrix && v.matrix ) { if ( u.length != v.length ) { @@ -239,7 +241,7 @@ function subtract( u, v ) " of different dimensions"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { throw "subtract(): trying to subtact matrices" + " of different dimensions"; @@ -262,7 +264,7 @@ function subtract( u, v ) throw "subtract(): vectors are not the same length"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { result.push( u[i] - v[i] ); } @@ -275,19 +277,20 @@ function subtract( u, v ) function mult( u, v ) { var result = []; + var i; if ( u.matrix && v.matrix ) { if ( u.length != v.length ) { throw "mult(): trying to add matrices of different dimensions"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { throw "mult(): trying to add matrices of different dimensions"; } } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { result.push( [] ); for ( var j = 0; j < v.length; ++j ) { @@ -308,7 +311,7 @@ function mult( u, v ) throw "mult(): vectors are not the same dimension"; } - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { result.push( u[i] * v[i] ); } @@ -634,16 +637,18 @@ function flatten( v ) var floats = new Float32Array( n ); + var i; + if ( elemsAreArrays ) { var idx = 0; - for ( var i = 0; i < v.length; ++i ) { + for ( i = 0; i < v.length; ++i ) { for ( var j = 0; j < v[i].length; ++j ) { floats[idx++] = v[i][j]; } } } else { - for ( var i = 0; i < v.length; ++i ) { + for ( i = 0; i < v.length; ++i ) { floats[i] = v[i]; } } @@ -668,14 +673,16 @@ var sizeof = { function printm(m) { + var i; + if(m.length == 2) - for(var i=0; i" + gl.getShaderInfoLog( vertShdr ) + ""; alert( msg ); return -1; @@ -34,7 +35,7 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) gl.shaderSource( fragShdr, fragElem.text ); gl.compileShader( fragShdr ); if ( !gl.getShaderParameter(fragShdr, gl.COMPILE_STATUS) ) { - var msg = "Fragment shader failed to compile. The error log is:" + msg = "Fragment shader failed to compile. The error log is:" + "
" + gl.getShaderInfoLog( fragShdr ) + "
"; alert( msg ); return -1; @@ -47,7 +48,7 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) gl.linkProgram( program ); if ( !gl.getProgramParameter(program, gl.LINK_STATUS) ) { - var msg = "Shader program failed to link. The error log is:" + msg = "Shader program failed to link. The error log is:" + "
" + gl.getProgramInfoLog( program ) + "
"; alert( msg ); return -1; From 46ac2fe4d1dd80acaa846fca40fd6756e66abbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 17:47:29 -0300 Subject: [PATCH 03/11] Common: Avoid another variable redeclaration. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I missed this one in the previous commit. Signed-off-by: Rogério Brito --- Common/MV.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 821431a..b02f9e9 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -164,10 +164,12 @@ function mat4() function equal( u, v ) { + var i; + if ( u.length != v.length ) { return false; } if ( u.matrix && v.matrix ) { - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { return false; } for ( var j = 0; j < u[i].length; ++j ) { if ( u[i][j] !== v[i][j] ) { return false; } @@ -178,7 +180,7 @@ function equal( u, v ) return false; } else { - for ( var i = 0; i < u.length; ++i ) { + for ( i = 0; i < u.length; ++i ) { if ( u[i] !== v[i] ) { return false; } } } From 25f0931b23b7f08ac433d9bdf4bf78063ca4c33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 17:49:01 -0300 Subject: [PATCH 04/11] Common: Remove else's after if's that stop function executions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have an `if`-`else` command where we never continue the execution from the `if` block, then we can be free to unwrap the `else` body from the else. This improves readability by reducing one level of indentation. Note that there was one instance of this removal where the body of the `else` was not even indented, which made reading the code confusing (especially for those that program in languages like Python where indentation matters). Signed-off-by: Rogério Brito --- Common/MV.js | 55 ++++++++++++++++++++----------------------- Common/initShaders.js | 38 ++++++++++++++---------------- 2 files changed, 43 insertions(+), 50 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index b02f9e9..a03a9e8 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -179,10 +179,9 @@ function equal( u, v ) else if ( u.matrix && !v.matrix || !u.matrix && v.matrix ) { return false; } - else { - for ( i = 0; i < u.length; ++i ) { - if ( u[i] !== v[i] ) { return false; } - } + + for ( i = 0; i < u.length; ++i ) { + if ( u[i] !== v[i] ) { return false; } } return true; @@ -217,17 +216,16 @@ function add( u, v ) else if ( u.matrix && !v.matrix || !u.matrix && v.matrix ) { throw "add(): trying to add matrix and non-matrix variables"; } - else { - if ( u.length != v.length ) { - throw "add(): vectors are not the same dimension"; - } - for ( i = 0; i < u.length; ++i ) { - result.push( u[i] + v[i] ); - } + if ( u.length != v.length ) { + throw "add(): vectors are not the same dimension"; + } - return result; + for ( i = 0; i < u.length; ++i ) { + result.push( u[i] + v[i] ); } + + return result; } //---------------------------------------------------------------------------- @@ -261,17 +259,16 @@ function subtract( u, v ) else if ( u.matrix && !v.matrix || !u.matrix && v.matrix ) { throw "subtact(): trying to subtact matrix and non-matrix variables"; } - else { - if ( u.length != v.length ) { - throw "subtract(): vectors are not the same length"; - } - for ( i = 0; i < u.length; ++i ) { - result.push( u[i] - v[i] ); - } + if ( u.length != v.length ) { + throw "subtract(): vectors are not the same length"; + } - return result; + for ( i = 0; i < u.length; ++i ) { + result.push( u[i] - v[i] ); } + + return result; } //---------------------------------------------------------------------------- @@ -308,17 +305,16 @@ function mult( u, v ) return result; } - else { - if ( u.length != v.length ) { - throw "mult(): vectors are not the same dimension"; - } - for ( i = 0; i < u.length; ++i ) { - result.push( u[i] * v[i] ); - } + if ( u.length != v.length ) { + throw "mult(): vectors are not the same dimension"; + } - return result; + for ( i = 0; i < u.length; ++i ) { + result.push( u[i] * v[i] ); } + + return result; } //---------------------------------------------------------------------------- @@ -936,10 +932,9 @@ function normalMatrix(m, flag) var a = mat4(); a = inverse(transpose(m)); if(flag != true) return a; - else { + var b = mat3(); for(var i=0;i<3;i++) for(var j=0; j<3; j++) b[i][j] = a[i][j]; return b; - } } diff --git a/Common/initShaders.js b/Common/initShaders.js index 9b394ac..ccadd76 100644 --- a/Common/initShaders.js +++ b/Common/initShaders.js @@ -13,16 +13,15 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) alert( "Unable to load vertex shader " + vertexShaderId ); return -1; } - else { - vertShdr = gl.createShader( gl.VERTEX_SHADER ); - gl.shaderSource( vertShdr, vertElem.text ); - gl.compileShader( vertShdr ); - if ( !gl.getShaderParameter(vertShdr, gl.COMPILE_STATUS) ) { - msg = "Vertex shader failed to compile. The error log is:" - + "
" + gl.getShaderInfoLog( vertShdr ) + "
"; - alert( msg ); - return -1; - } + + vertShdr = gl.createShader( gl.VERTEX_SHADER ); + gl.shaderSource( vertShdr, vertElem.text ); + gl.compileShader( vertShdr ); + if ( !gl.getShaderParameter(vertShdr, gl.COMPILE_STATUS) ) { + msg = "Vertex shader failed to compile. The error log is:" + + "
" + gl.getShaderInfoLog( vertShdr ) + "
"; + alert( msg ); + return -1; } var fragElem = document.getElementById( fragmentShaderId ); @@ -30,16 +29,15 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) alert( "Unable to load vertex shader " + fragmentShaderId ); return -1; } - else { - fragShdr = gl.createShader( gl.FRAGMENT_SHADER ); - gl.shaderSource( fragShdr, fragElem.text ); - gl.compileShader( fragShdr ); - if ( !gl.getShaderParameter(fragShdr, gl.COMPILE_STATUS) ) { - msg = "Fragment shader failed to compile. The error log is:" - + "
" + gl.getShaderInfoLog( fragShdr ) + "
"; - alert( msg ); - return -1; - } + + fragShdr = gl.createShader( gl.FRAGMENT_SHADER ); + gl.shaderSource( fragShdr, fragElem.text ); + gl.compileShader( fragShdr ); + if ( !gl.getShaderParameter(fragShdr, gl.COMPILE_STATUS) ) { + msg = "Fragment shader failed to compile. The error log is:" + + "
" + gl.getShaderInfoLog( fragShdr ) + "
"; + alert( msg ); + return -1; } var program = gl.createProgram(); From c1e8f5813ec869949bc6176e43012426982830c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 17:57:25 -0300 Subject: [PATCH 05/11] Common: Fix spelling and mistakes in user visible messages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes some messages that are shown to the user. Signed-off-by: Rogério Brito --- Common/MV.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index a03a9e8..737b288 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -243,7 +243,7 @@ function subtract( u, v ) for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { - throw "subtract(): trying to subtact matrices" + + throw "subtract(): trying to subtract matrices" + " of different dimensions"; } result.push( [] ); @@ -257,7 +257,7 @@ function subtract( u, v ) return result; } else if ( u.matrix && !v.matrix || !u.matrix && v.matrix ) { - throw "subtact(): trying to subtact matrix and non-matrix variables"; + throw "subtact(): trying to subtact matrix and non-matrix variables"; } if ( u.length != v.length ) { @@ -280,12 +280,12 @@ function mult( u, v ) if ( u.matrix && v.matrix ) { if ( u.length != v.length ) { - throw "mult(): trying to add matrices of different dimensions"; + throw "mult(): trying to multiply matrices of different dimensions"; } for ( i = 0; i < u.length; ++i ) { if ( u[i].length != v[i].length ) { - throw "mult(): trying to add matrices of different dimensions"; + throw "mult(): trying to multiply matrices of different dimensions"; } } @@ -392,15 +392,15 @@ function scalem( x, y, z ) function lookAt( eye, at, up ) { if ( !Array.isArray(eye) || eye.length != 3) { - throw "lookAt(): first parameter [eye] must be an a vec3"; + throw "lookAt(): first parameter [eye] must be a vec3"; } if ( !Array.isArray(at) || at.length != 3) { - throw "lookAt(): first parameter [at] must be an a vec3"; + throw "lookAt(): second parameter [at] must be a vec3"; } if ( !Array.isArray(up) || up.length != 3) { - throw "lookAt(): first parameter [up] must be an a vec3"; + throw "lookAt(): third parameter [up] must be a vec3"; } if ( equal(eye, at) ) { @@ -527,11 +527,11 @@ function negate( u ) function cross( u, v ) { if ( !Array.isArray(u) || u.length < 3 ) { - throw "cross(): first argument is not a vector of at least 3"; + throw "cross(): first argument is not a vector of dimension at least 3"; } if ( !Array.isArray(v) || v.length < 3 ) { - throw "cross(): second argument is not a vector of at least 3"; + throw "cross(): second argument is not a vector of dimension at least 3"; } var result = [ From 8b48efa5ce171d712b1c33f8aecea1ea0a996242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:01:12 -0300 Subject: [PATCH 06/11] Common/webgl-utils.js: Add missing semicolon after assignment. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While JavaScript implicitly "inserts" missing semicolons under some conditions, it is better to make them explicitly, especially if we ever have the hope of running the code under tools like JSLint. Signed-off-by: Rogério Brito --- Common/webgl-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/webgl-utils.js b/Common/webgl-utils.js index c2b2918..11144ce 100644 --- a/Common/webgl-utils.js +++ b/Common/webgl-utils.js @@ -139,7 +139,7 @@ var create3DContext = function(canvas, opt_attribs) { } } return context; -} +}; return { create3DContext: create3DContext, From 165047feb086866b005d672d2752723a59adb1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:03:09 -0300 Subject: [PATCH 07/11] Common: Remove pesky trailing whitespaces. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rogério Brito --- Common/initShaders.js | 6 +++--- Common/initShaders2.js | 4 ++-- Common/webgl-utils.js | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Common/initShaders.js b/Common/initShaders.js index ccadd76..990b666 100644 --- a/Common/initShaders.js +++ b/Common/initShaders.js @@ -9,7 +9,7 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) var msg; var vertElem = document.getElementById( vertexShaderId ); - if ( !vertElem ) { + if ( !vertElem ) { alert( "Unable to load vertex shader " + vertexShaderId ); return -1; } @@ -25,7 +25,7 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) } var fragElem = document.getElementById( fragmentShaderId ); - if ( !fragElem ) { + if ( !fragElem ) { alert( "Unable to load vertex shader " + fragmentShaderId ); return -1; } @@ -44,7 +44,7 @@ function initShaders( gl, vertexShaderId, fragmentShaderId ) gl.attachShader( program, vertShdr ); gl.attachShader( program, fragShdr ); gl.linkProgram( program ); - + if ( !gl.getProgramParameter(program, gl.LINK_STATUS) ) { msg = "Shader program failed to link. The error log is:" + "
" + gl.getProgramInfoLog( program ) + "
"; diff --git a/Common/initShaders2.js b/Common/initShaders2.js index 49b5933..03c59c2 100644 --- a/Common/initShaders2.js +++ b/Common/initShaders2.js @@ -8,7 +8,7 @@ return xhr.status == okStatus ? xhr.responseText : null; }; - + function initShaders(gl, vShaderName, fShaderName) { function getShader(gl, shaderName, type) { var shader = gl.createShader(type), @@ -38,7 +38,7 @@ return null; } - + return program; }; diff --git a/Common/webgl-utils.js b/Common/webgl-utils.js index 11144ce..7653d86 100644 --- a/Common/webgl-utils.js +++ b/Common/webgl-utils.js @@ -160,5 +160,3 @@ window.requestAnimFrame = (function() { window.setTimeout(callback, 1000/60); }; })(); - - From 749803415e61265facb5b16d919c51d2d12dbd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:04:13 -0300 Subject: [PATCH 08/11] Common/webgl-utils.js: Trivial conversion of DOS to Unix line ends. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was automated with the `dos2unix` tool and while it may look enourmous, it *only* changes the EOL characters. Signed-off-by: Rogério Brito --- Common/webgl-utils.js | 324 +++++++++++++++++++++--------------------- 1 file changed, 162 insertions(+), 162 deletions(-) diff --git a/Common/webgl-utils.js b/Common/webgl-utils.js index 7653d86..3c93524 100644 --- a/Common/webgl-utils.js +++ b/Common/webgl-utils.js @@ -1,162 +1,162 @@ -/* - * Copyright 2010, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -/** - * @fileoverview This file contains functions every webgl program will need - * a version of one way or another. - * - * Instead of setting up a context manually it is recommended to - * use. This will check for success or failure. On failure it - * will attempt to present an approriate message to the user. - * - * gl = WebGLUtils.setupWebGL(canvas); - * - * For animated WebGL apps use of setTimeout or setInterval are - * discouraged. It is recommended you structure your rendering - * loop like this. - * - * function render() { - * window.requestAnimFrame(render, canvas); - * - * // do rendering - * ... - * } - * render(); - * - * This will call your rendering function up to the refresh rate - * of your display but will stop rendering if your app is not - * visible. - */ - -WebGLUtils = function() { - -/** - * Creates the HTLM for a failure message - * @param {string} canvasContainerId id of container of th - * canvas. - * @return {string} The html. - */ -var makeFailHTML = function(msg) { - return '' + - '' + - '
' + - '
' + - '
' + msg + '
' + - '
' + - '
'; -}; - -/** - * Mesasge for getting a webgl browser - * @type {string} - */ -var GET_A_WEBGL_BROWSER = '' + - 'This page requires a browser that supports WebGL.
' + - 'Click here to upgrade your browser.'; - -/** - * Mesasge for need better hardware - * @type {string} - */ -var OTHER_PROBLEM = '' + - "It doesn't appear your computer can support WebGL.
" + - 'Click here for more information.'; - -/** - * Creates a webgl context. If creation fails it will - * change the contents of the container of the - * tag to an error message with the correct links for WebGL. - * @param {Element} canvas. The canvas element to create a - * context from. - * @param {WebGLContextCreationAttirbutes} opt_attribs Any - * creation attributes you want to pass in. - * @return {WebGLRenderingContext} The created context. - */ -var setupWebGL = function(canvas, opt_attribs) { - function showLink(str) { - var container = canvas.parentNode; - if (container) { - container.innerHTML = makeFailHTML(str); - } - }; - - if (!window.WebGLRenderingContext) { - showLink(GET_A_WEBGL_BROWSER); - return null; - } - - var context = create3DContext(canvas, opt_attribs); - if (!context) { - showLink(OTHER_PROBLEM); - } - return context; -}; - -/** - * Creates a webgl context. - * @param {!Canvas} canvas The canvas tag to get context - * from. If one is not passed in one will be created. - * @return {!WebGLContext} The created context. - */ -var create3DContext = function(canvas, opt_attribs) { - var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; - var context = null; - for (var ii = 0; ii < names.length; ++ii) { - try { - context = canvas.getContext(names[ii], opt_attribs); - } catch(e) {} - if (context) { - break; - } - } - return context; -}; - -return { - create3DContext: create3DContext, - setupWebGL: setupWebGL -}; -}(); - -/** - * Provides requestAnimationFrame in a cross browser way. - */ -window.requestAnimFrame = (function() { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { - window.setTimeout(callback, 1000/60); - }; -})(); +/* + * Copyright 2010, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/** + * @fileoverview This file contains functions every webgl program will need + * a version of one way or another. + * + * Instead of setting up a context manually it is recommended to + * use. This will check for success or failure. On failure it + * will attempt to present an approriate message to the user. + * + * gl = WebGLUtils.setupWebGL(canvas); + * + * For animated WebGL apps use of setTimeout or setInterval are + * discouraged. It is recommended you structure your rendering + * loop like this. + * + * function render() { + * window.requestAnimFrame(render, canvas); + * + * // do rendering + * ... + * } + * render(); + * + * This will call your rendering function up to the refresh rate + * of your display but will stop rendering if your app is not + * visible. + */ + +WebGLUtils = function() { + +/** + * Creates the HTLM for a failure message + * @param {string} canvasContainerId id of container of th + * canvas. + * @return {string} The html. + */ +var makeFailHTML = function(msg) { + return '' + + '' + + '
' + + '
' + + '
' + msg + '
' + + '
' + + '
'; +}; + +/** + * Mesasge for getting a webgl browser + * @type {string} + */ +var GET_A_WEBGL_BROWSER = '' + + 'This page requires a browser that supports WebGL.
' + + 'Click here to upgrade your browser.'; + +/** + * Mesasge for need better hardware + * @type {string} + */ +var OTHER_PROBLEM = '' + + "It doesn't appear your computer can support WebGL.
" + + 'Click here for more information.'; + +/** + * Creates a webgl context. If creation fails it will + * change the contents of the container of the + * tag to an error message with the correct links for WebGL. + * @param {Element} canvas. The canvas element to create a + * context from. + * @param {WebGLContextCreationAttirbutes} opt_attribs Any + * creation attributes you want to pass in. + * @return {WebGLRenderingContext} The created context. + */ +var setupWebGL = function(canvas, opt_attribs) { + function showLink(str) { + var container = canvas.parentNode; + if (container) { + container.innerHTML = makeFailHTML(str); + } + }; + + if (!window.WebGLRenderingContext) { + showLink(GET_A_WEBGL_BROWSER); + return null; + } + + var context = create3DContext(canvas, opt_attribs); + if (!context) { + showLink(OTHER_PROBLEM); + } + return context; +}; + +/** + * Creates a webgl context. + * @param {!Canvas} canvas The canvas tag to get context + * from. If one is not passed in one will be created. + * @return {!WebGLContext} The created context. + */ +var create3DContext = function(canvas, opt_attribs) { + var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; + var context = null; + for (var ii = 0; ii < names.length; ++ii) { + try { + context = canvas.getContext(names[ii], opt_attribs); + } catch(e) {} + if (context) { + break; + } + } + return context; +}; + +return { + create3DContext: create3DContext, + setupWebGL: setupWebGL +}; +}(); + +/** + * Provides requestAnimationFrame in a cross browser way. + */ +window.requestAnimFrame = (function() { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { + window.setTimeout(callback, 1000/60); + }; +})(); From 7a3be864d05366d9601ba3ef4fc8181798e65b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:13:01 -0300 Subject: [PATCH 09/11] Common: Fix indentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some parts of the code had funky and inconsistent indentation. This change is trivial in the sense that it was automated by Emacs's indent-region command. This patch tries to make the indentation consistent with the standard of 4 spaces per level. Signed-off-by: Rogério Brito --- Common/MV.js | 293 +++++++++++++++++++++-------------------- Common/initShaders2.js | 72 +++++----- Common/webgl-utils.js | 174 ++++++++++++------------ 3 files changed, 269 insertions(+), 270 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 737b288..8960259 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -674,69 +674,69 @@ function printm(m) var i; if(m.length == 2) - for(i=0; i' + - '' + - '
' + - '
' + msg + '
' + - '
' + - ''; -}; + /** + * Creates the HTLM for a failure message + * @param {string} canvasContainerId id of container of th + * canvas. + * @return {string} The html. + */ + var makeFailHTML = function(msg) { + return '' + + '' + + '
' + + '
' + + '
' + msg + '
' + + '
' + + '
'; + }; -/** - * Mesasge for getting a webgl browser - * @type {string} - */ -var GET_A_WEBGL_BROWSER = '' + - 'This page requires a browser that supports WebGL.
' + - 'Click here to upgrade your browser.'; + /** + * Mesasge for getting a webgl browser + * @type {string} + */ + var GET_A_WEBGL_BROWSER = '' + + 'This page requires a browser that supports WebGL.
' + + 'Click here to upgrade your browser.'; -/** - * Mesasge for need better hardware - * @type {string} - */ -var OTHER_PROBLEM = '' + - "It doesn't appear your computer can support WebGL.
" + - 'Click here for more information.'; + /** + * Mesasge for need better hardware + * @type {string} + */ + var OTHER_PROBLEM = '' + + "It doesn't appear your computer can support WebGL.
" + + 'Click here for more information.'; -/** - * Creates a webgl context. If creation fails it will - * change the contents of the container of the - * tag to an error message with the correct links for WebGL. - * @param {Element} canvas. The canvas element to create a - * context from. - * @param {WebGLContextCreationAttirbutes} opt_attribs Any - * creation attributes you want to pass in. - * @return {WebGLRenderingContext} The created context. - */ -var setupWebGL = function(canvas, opt_attribs) { - function showLink(str) { - var container = canvas.parentNode; - if (container) { - container.innerHTML = makeFailHTML(str); - } - }; + /** + * Creates a webgl context. If creation fails it will + * change the contents of the container of the + * tag to an error message with the correct links for WebGL. + * @param {Element} canvas. The canvas element to create a + * context from. + * @param {WebGLContextCreationAttirbutes} opt_attribs Any + * creation attributes you want to pass in. + * @return {WebGLRenderingContext} The created context. + */ + var setupWebGL = function(canvas, opt_attribs) { + function showLink(str) { + var container = canvas.parentNode; + if (container) { + container.innerHTML = makeFailHTML(str); + } + }; - if (!window.WebGLRenderingContext) { - showLink(GET_A_WEBGL_BROWSER); - return null; - } + if (!window.WebGLRenderingContext) { + showLink(GET_A_WEBGL_BROWSER); + return null; + } - var context = create3DContext(canvas, opt_attribs); - if (!context) { - showLink(OTHER_PROBLEM); - } - return context; -}; + var context = create3DContext(canvas, opt_attribs); + if (!context) { + showLink(OTHER_PROBLEM); + } + return context; + }; -/** - * Creates a webgl context. - * @param {!Canvas} canvas The canvas tag to get context - * from. If one is not passed in one will be created. - * @return {!WebGLContext} The created context. - */ -var create3DContext = function(canvas, opt_attribs) { - var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; - var context = null; - for (var ii = 0; ii < names.length; ++ii) { - try { - context = canvas.getContext(names[ii], opt_attribs); - } catch(e) {} - if (context) { - break; - } - } - return context; -}; + /** + * Creates a webgl context. + * @param {!Canvas} canvas The canvas tag to get context + * from. If one is not passed in one will be created. + * @return {!WebGLContext} The created context. + */ + var create3DContext = function(canvas, opt_attribs) { + var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; + var context = null; + for (var ii = 0; ii < names.length; ++ii) { + try { + context = canvas.getContext(names[ii], opt_attribs); + } catch(e) {} + if (context) { + break; + } + } + return context; + }; -return { - create3DContext: create3DContext, - setupWebGL: setupWebGL -}; + return { + create3DContext: create3DContext, + setupWebGL: setupWebGL + }; }(); /** * Provides requestAnimationFrame in a cross browser way. */ window.requestAnimFrame = (function() { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { - window.setTimeout(callback, 1000/60); - }; + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { + window.setTimeout(callback, 1000/60); + }; })(); From f6acfc157abf949f7ffb0a67489125378343fda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:31:01 -0300 Subject: [PATCH 10/11] Common: Some extra spelling mistakes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rogério Brito --- Common/MV.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 8960259..25b012c 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -257,7 +257,7 @@ function subtract( u, v ) return result; } else if ( u.matrix && !v.matrix || !u.matrix && v.matrix ) { - throw "subtact(): trying to subtact matrix and non-matrix variables"; + throw "subtract(): trying to subtract matrix and non-matrix variables"; } if ( u.length != v.length ) { @@ -580,7 +580,7 @@ function normalize( u, excludeLastComponent ) function mix( u, v, s ) { if ( typeof s !== "number" ) { - throw "mix: the last paramter " + s + " must be a number"; + throw "mix: the last parameter " + s + " must be a number"; } if ( u.length != v.length ) { From da8356540d111f4b6bdcc5cf02e869df4f40df8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:31:35 -0300 Subject: [PATCH 11/11] Common/MV: Make indentation easier on the eyes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We may want to use an automatic indenter in the near future to take care of some other inconsistencies in the code. Signed-off-by: Rogério Brito --- Common/MV.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 25b012c..e9e6a84 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -932,10 +932,13 @@ function normalMatrix(m, flag) { var a = mat4(); a = inverse(transpose(m)); - if(flag != true) return a; + if (flag != true) + return a; var b = mat3(); - for(var i=0;i<3;i++) for(var j=0; j<3; j++) b[i][j] = a[i][j]; + for (var i=0;i<3;i++) + for(var j=0; j<3; j++) + b[i][j] = a[i][j]; return b; }