Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | var M4x4 = {}; |
michael@0 | 2 | M4x4.mul = function M4x4_mul(a, b, r) { |
michael@0 | 3 | a11 = a[0] |
michael@0 | 4 | a21 = a[1] |
michael@0 | 5 | a31 = a[2] |
michael@0 | 6 | a12 = a[4] |
michael@0 | 7 | a22 = a[5] |
michael@0 | 8 | a32 = a[6] |
michael@0 | 9 | a13 = a[8] |
michael@0 | 10 | a23 = a[9] |
michael@0 | 11 | a33 = a[10] |
michael@0 | 12 | a14 = a[12] |
michael@0 | 13 | a24 = a[13] |
michael@0 | 14 | a34 = a[14] |
michael@0 | 15 | b[3] |
michael@0 | 16 | b[4] |
michael@0 | 17 | b13 = b[8] |
michael@0 | 18 | b23 = b[9] |
michael@0 | 19 | b33 = b[10] |
michael@0 | 20 | b43 = b[11] |
michael@0 | 21 | r[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43 |
michael@0 | 22 | r[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43 |
michael@0 | 23 | r[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43 |
michael@0 | 24 | return r; |
michael@0 | 25 | }; |
michael@0 | 26 | M4x4.scale3 = function M4x4_scale3(x, y, z, m) { |
michael@0 | 27 | m[0] *= x; |
michael@0 | 28 | m[3] *= x; |
michael@0 | 29 | m[4] *= y; |
michael@0 | 30 | m[11] *= z; |
michael@0 | 31 | }; |
michael@0 | 32 | M4x4.makeLookAt = function M4x4_makeLookAt() { |
michael@0 | 33 | tm1 = new Float32Array(16); |
michael@0 | 34 | tm2 = new Float32Array(16); |
michael@0 | 35 | r = new Float32Array(16) |
michael@0 | 36 | return M4x4.mul(tm1, tm2, r); |
michael@0 | 37 | }; |
michael@0 | 38 | var jellyfish = {}; |
michael@0 | 39 | jellyfish.order = []; |
michael@0 | 40 | function jellyfishInstance() {} |
michael@0 | 41 | jellyfishInstance.prototype.drawShadow = function () { |
michael@0 | 42 | pMatrix = M4x4.makeLookAt(); |
michael@0 | 43 | M4x4.mul(M4x4.makeLookAt(), pMatrix, pMatrix); |
michael@0 | 44 | M4x4.scale3(6, 180, 0, pMatrix); |
michael@0 | 45 | } |
michael@0 | 46 | function drawScene() { |
michael@0 | 47 | jellyfish.order.push([0, 0]) |
michael@0 | 48 | jellyfish[0] = new jellyfishInstance() |
michael@0 | 49 | for (var i = 0, j = 0; i < jellyfish.count, j < 30; ++j) { |
michael@0 | 50 | jellyfish.order[i][0] |
michael@0 | 51 | jellyfish[0].drawShadow(); |
michael@0 | 52 | } |
michael@0 | 53 | } |
michael@0 | 54 | drawScene(); |
michael@0 | 55 |