Created
August 6, 2012 04:02
-
-
Save roundrobin/3270041 to your computer and use it in GitHub Desktop.
just another inlet to tributary
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 txt; | |
tributary.init = function(g) { | |
var defs = g.append('defs') | |
var filter = defs.append('filter') | |
.attr('id','wooble') | |
filter.append('feTurbulence') | |
.attr('result','result0') | |
.attr('id','fe2') | |
.attr('seed','0') | |
.attr('numOctaves','3') | |
.attr('baseFrequency','0.037'); | |
var feSpecularLighting = filter.append('feSpecularLighting') | |
.attr('result','result1') | |
.attr('specularExponent','24.3') | |
.attr('surfaceScale','2') | |
.attr('specularConstant','1') | |
feSpecularLighting.append('feDistantLight') | |
.attr('result','result1') | |
.attr('elevation','45') | |
.attr('azimuth','225') | |
var feDiffuseLighting = filter.append('feDiffuseLighting') | |
.attr('in','result0') | |
.attr('surfaceScale','3') | |
.attr('diffuseConstant','1.21') | |
.attr('result','result2') | |
feDiffuseLighting.append('feDistantLight') | |
.attr('azimuth','255') | |
.attr('elavation','42') | |
filter.append('feBlend') | |
.attr('in2','SourceGraphic') | |
.attr('mode','multiply') | |
.attr('surfaceScale','3') | |
.attr('result','result91') | |
filter.append('feComposite') | |
.attr('result','result92') | |
.attr('in','result1') | |
.attr('in2','result91') | |
.attr('k2','1') | |
.attr('k3','1') | |
.attr('operator','arithmetic') | |
filter.append('feComposite') | |
.attr('result','result92') | |
.attr('in','result1') | |
.attr('in2','SourceAlpha') | |
.attr('operator','in') | |
g.append("circle") | |
.attr("r",50) | |
.attr("cx",224) | |
.attr("cy",100) | |
.attr("fill","#ff00ff") | |
.attr("filter","url(#wooble)"); | |
}; | |
tributary.run = function(g,t) { | |
txt.text(t); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment