Holodisk/anim.scad
2020-12-31 14:15:57 +01:00

15 lines
351 B
OpenSCAD

// animation
function get_anim_keys() = [
0, // initial
0.1, // resting
0.3, // holodisk inserted
0.4, // laser raised
0.5, // start playing
0.7, // stop playing
0.8, // laser lowered, holodisk removing
1 // final
];
function anim(key_from, key_to, KEYS=get_anim_keys())
= max(0, min(($t - KEYS[key_from]) / (KEYS[key_to] - KEYS[key_from]), 1));