This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body style="background:#fff;"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"></script> | |
<canvas id="canvas"></canvas> | |
<script id="jsbin-javascript"> |
This file contains hidden or 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
//CC2018 | |
document.addEventListener('paste', function(evt) { | |
//Import SVG copied to clipboard from Illustrator | |
//remove last hidden character that will otherwise break the import | |
if(document.activeElement.nodeName!="TEXTAREA"){ | |
var str=evt.clipboardData.getData('text/plain').slice(0, -1); | |
var svg=project.importSVG(str) | |
svg.clipped=false; | |
svg.children[0].remove() | |
svg.parent.insertChildren(svg.index,svg.removeChildren()); |
This file contains hidden or 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
include('https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.1/pixi.min.js'); | |
//const app = new PIXI.Application(); | |
let app = new PIXI.Application({ | |
width: 960, | |
height: 960, | |
antialias: true, | |
transparent: true, | |
resolution: 1 | |
}); |
This file contains hidden or 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
include('https://cdnjs.cloudflare.com/ajax/libs/tone/0.12.7/Tone.min.js') | |
const DEBUG=0; | |
function log(item){if(typeof console != "undefined" && console.log && DEBUG){var props=[];for(var a in arguments){props.push(arguments[a])}console.log(props.join(","));}} | |
var nodeCount=0; | |
var edgeCount=0; | |
function omitKeys(key,value){ | |
if (key=="Tone") return undefined; |
This file contains hidden or 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
{ | |
id:"Patch 1", | |
nodes:[ | |
{ | |
id:"Reverb 1", | |
type:"freeverb", | |
inlets:[ | |
//min max here? | |
{id:"dryWet", type:"control"}, | |
{id:"roomSize", type:"control"}, |
This file contains hidden or 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
//dynamic parenting for 3d layers | |
//from Dan Ebberts on forums I think.. | |
//Position | |
L=thisComp.layer("Object center"); | |
L.toWorld(L.effect(name)("3D Point")); | |
//Scale | |
L =thisComp.layer("Object center"); | |
[L.transform.scale[0]/100*value[0],L.transform.scale[1]/100*value[1],L.transform.scale[2]/100*value[2]]; |
This file contains hidden or 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 gif = new GIF({ | |
workers: 2, | |
quality: 10 | |
}); | |
gif.on('finished', function(blob) { | |
window.open(URL.createObjectURL(blob)); | |
}); |
This file contains hidden or 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
function roughenSegments(path,amp){ | |
var amp=amp || 10; | |
for(s in path.segments){ | |
var seg=path.segments[s]; | |
seg.point.x+=Math.random()*(2-1)*amp | |
seg.point.y+=Math.random()*(2-1)*amp | |
} | |
} | |
Item.prototype.roughen = function (amp) { |
This file contains hidden or 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
include('https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.3/svg.min.js'); | |
$('.canvas').prepend('<div id="root"></div>') | |
document.addEventListener('contextmenu', event => event.preventDefault()) | |
const DEBUG=true | |
function l(item) {if (typeof console != "undefined" && console.log && DEBUG) {var props=[];for(var a in arguments){props.push(arguments[a])}console.log(props.join(","))}} | |
var xOffset=$('.right_panel').offset().left | |
var yOffset=$('.right_panel').offset().top | |
function add(arr1,arr2){arr1.map(function (num, idx) {return num + arr2[idx]})} | |
function sub(arr1,arr2){arr1.map(function (num, idx) {return num - arr2[idx]})} |
This file contains hidden or 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
steps=128 | |
radius=160 | |
var wheel=new Group() | |
for(var i=0;i<steps;i++){ | |
var seg=new Path(); | |
var circum=radius*2*Math.PI | |
var step=circum/steps | |
seg.add([0,0],[radius,-step/2-0.5],[radius,step/2+0.5]) |