diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/gfx3d/gradient.js | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx3d/gradient.js')
-rw-r--r-- | includes/js/dojox/gfx3d/gradient.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/includes/js/dojox/gfx3d/gradient.js b/includes/js/dojox/gfx3d/gradient.js deleted file mode 100644 index fa93720..0000000 --- a/includes/js/dojox/gfx3d/gradient.js +++ /dev/null @@ -1,41 +0,0 @@ -if(!dojo._hasResource["dojox.gfx3d.gradient"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.gfx3d.gradient"] = true; -dojo.provide("dojox.gfx3d.gradient"); - -dojo.require("dojox.gfx3d.vector"); -dojo.require("dojox.gfx3d.matrix"); - -(function(){ - var dist = function(a, b){ return Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)); }; - var N = 32; - - dojox.gfx3d.gradient = function(model, material, center, radius, from, to, matrix){ - // summary: calculate a cylindrical gradient - // model: dojox.gfx3d.lighting.Model: color model - // material: Object: defines visual properties - // center: Object: center of the cylinder's bottom - // radius: Number: radius of the cylinder - // from: Number: from position in radians - // to: Number: from position in radians - // matrix: dojox.gfx3d.Matrix3D: the cumulative transformation matrix - // tolerance: Number: tolerable diffirence in colors between gradient steps - - var m = dojox.gfx3d.matrix, v = dojox.gfx3d.vector, mx = m.normalize(matrix), - f = m.multiplyPoint(mx, radius * Math.cos(from) + center.x, radius * Math.sin(from) + center.y, center.z), - t = m.multiplyPoint(mx, radius * Math.cos(to) + center.x, radius * Math.sin(to) + center.y, center.z), - c = m.multiplyPoint(mx, center.x, center.y, center.z), step = (to - from) / N, r = dist(f, t) / 2, - mod = model[material.type], fin = material.finish, pmt = material.color, - colors = [{offset: 0, color: mod.call(model, v.substract(f, c), fin, pmt)}]; - - for(var a = from + step; a < to; a += step){ - var p = m.multiplyPoint(mx, radius * Math.cos(a) + center.x, radius * Math.sin(a) + center.y, center.z), - df = dist(f, p), dt = dist(t, p); - colors.push({offset: df / (df + dt), color: mod.call(model, v.substract(p, c), fin, pmt)}); - } - colors.push({offset: 1, color: mod.call(model, v.substract(t, c), fin, pmt)}); - - return {type: "linear", x1: 0, y1: -r, x2: 0, y2: r, colors: colors}; - }; -})(); - -} |