Created
August 6, 2012 05:42
-
-
Save roundrobin/3271088 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; | |
var tub; | |
function randomXToY(minVal,maxVal,floatVal) | |
{ | |
var randVal = minVal+(Math.random()*(maxVal-minVal)); | |
return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal); | |
} | |
tributary.init = function(g) { | |
var defs = g.append('defs') | |
var filter = defs.append('filter') | |
.attr('id','wooble') | |
tub = filter.append('feTurbulence') | |
.attr('result','result0') | |
.attr('id','fe2') | |
.attr('seed','0') | |
.attr('numOctaves',11) | |
.attr('baseFrequency',0.01332); | |
g.tub = tub | |
g.circle = g.append("rect") | |
.attr("width",1500) | |
.attr("height",550) | |
.attr("fill","#FF00FF") | |
.attr("filter","url(#wooble)"); | |
}; | |
tributary.run = function(g,t) { | |
var delta = Math.floor(t*100); | |
if(delta % 100 == 0){ | |
//g.tub.node().baseFrequencyX.baseVal = t % 0.4; | |
//g.tub.node().baseFrequencyY.baseVal = t % 0.4; | |
} | |
//g.tub.attr('baseFrequency',0.001+(Math.random()*(0.4-0.001)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment