constructor(start, end, duration) { this.start = start; this.end = end; this.direction = normalize(sub(this.end, this.start)); this.up = [0, 1, 0]; this.duration = duration || 1.0; }
ribbonPath.points.forEach(function (_, i) { let [x, y, z] = ribbonPath.points[i]; let [dx, dy, dz] = ribbonPath.slopes[i]; let v = sub( normalize([x, y, z]), normalize(ribbonPath.center), ); let u = normalize(ribbonPath.slopes[i]); let w = cross(u, v); let [a, b, c] = add([x, y, z], scale(w, +0.1)); let [d, e, f] = add([x, y, z], scale(w, -0.1)); ribbon.addPoint([x, y, z], w); });