Skip to content

Instantly share code, notes, and snippets.

@ptvans
Created June 17, 2013 03:46
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 ptvans/5794548 to your computer and use it in GitHub Desktop.
Save ptvans/5794548 to your computer and use it in GitHub Desktop.
boating scene 01
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"description":"boating scene 01","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12},"scene.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":true,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/mRhwEL7.png"}
var svg1 = d3.select("svg");
tributary.loop_type = "period";
tributary.duration = 1070;
var bounceY = -10;
var bounceX = 20;
var mebounce = 20;
var merotate = -4;
tributary.run = function(g,t) {
svg1.select("#me")
.attr("transform", "rotate(" + [t * merotate, 659, 296] + ") translate(" + [0, t * mebounce * bounceY] + ") ")
svg1.select("#wave")
.attr("transform", "translate(" + [t * bounceX, t * -2 * bounceY] + ")")
svg1.select("#arms")
.attr("transform", "rotate(" + [t * merotate, 260, 457] + ") ")
svg1.select("#legs")
.attr("transform", "rotate(" + [t * 5 * merotate, 596, 687] + ") ")
svg1.select("#head")
.attr("transform", "rotate(" + [t * merotate, 534, 1008] + ") ")
svg1.select("#cabin")
.attr("transform", "rotate(" + [-t * 4, 245, 539] + ")")
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment