draw = {
const points = [];
const colors = [];
const point = new THREE.Vector3();
const color = new THREE.Color();
color.setRGB(Math.cos(t * 0.00011) * 0.5 + 1, Math.cos(t * 0.002) * 0.5 + 1, Math.cos(t * 0.003) * 0.5 + 1)
for ( var i = buffers.last_t; i < t && points.length < MAX_SEGMENTS * 3; i += 10 ) {
point.x = Math.cos((i * 0.0091)) * 0.9 * width / 2 ;
point.y = Math.sin((i * 0.015)) * 0.9 * height / 2;
points.push( point.x, point.y, point.z );
colors.push(color.r, color.g, color.b);
}
buffers.positions.set(buffers.positions.array.slice(points.length));
buffers.positions.set(points, MAX_SEGMENTS * 3 - points.length);
buffers.colors.set(buffers.colors.array.slice(colors.length).map(x => x * 0.95), 0);
buffers.colors.set(colors, MAX_SEGMENTS * 3 - colors.length);
buffers.positions.needsUpdate = true;
buffers.colors.needsUpdate = true;
buffers.last_t = t;
}