Holodisk/anim.scad

15 lines
351 B
OpenSCAD
Raw Normal View History

2020-12-22 19:38:48 +00:00
// 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));