Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created August 6, 2012 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roundrobin/3271088 to your computer and use it in GitHub Desktop.
Save roundrobin/3271088 to your computer and use it in GitHub Desktop.
just another inlet to tributary
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