Last active
March 1, 2020 19:00
-
-
Save 143mailliw/c7a4f4da698dd68e43c99b5c3859b386 to your computer and use it in GitHub Desktop.
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
let x = %X% //replace this with X | |
let y = %Y% //replace this with Y | |
let index = %INDEX% //replace this with the index | |
let count = 400 | |
let fraction = index/count | |
let pi = Math.PI | |
let tau = Math.PI * 2 | |
let time = Date.now() | |
let projectionTime = Date.now() - 1583088932597 | |
let projectionStartTime = 1583088932597 | |
function towerIf(condition, a1, a2) { | |
return condition ? a1 : a2 | |
} | |
function lerp(frac,a,b){ | |
return (afrac + b(1-frac)) | |
} | |
function render() { | |
x_prime = (towerIf(index == 0,-9.5,towerIf(index == 1,-8.5,towerIf(index == 2,-7.5,towerIf(index == 3,-6.5,towerIf(index == 4,-5.5,towerIf(index == 5,-4.5,towerIf(index == 6,-9.5,0)))))))); | |
y_prime = (-towerIf(index == 0,-9.5,towerIf(index == 1,-9.5,towerIf(index == 2,-9.5,towerIf(index == 3,-9.5,towerIf(index == 4,-9.5,towerIf(index == 5,-9.5,towerIf(index == 6,-8.5,0)))))))); | |
h = 0; | |
s = 1; | |
v = towerIf(index < 9,1,0); | |
// Graphical Editor code will be placed before your Text Editor code upon export. | |
y_prime = y_prime; | |
x_prime = x_prime; | |
h = h; | |
s = s; | |
v = v; | |
// Effects code will be placed after your Text Editor code upon export. | |
return [x_prime, y_prime, h, s, v] | |
} | |
ext.exports = render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment