Bezier curves
just playing
by schrodingers
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.13/processing.min.js"></script>
<canvas></canvas>
CSS
</style> <script type="text/javascript"> window.addEventListener('load', function() {
var scripts=document.body.getElementsByTagName('script');
var canvases=document.body.getElementsByTagName('canvas');
new Processing(canvases[0], scripts[0].text);
}
, false);
// Here prevent javascript in body from throwing error </script> <style>
JavaScript
/*
title: Processing curvas
date: 2016-03-27
*/
float y;
int n = 15;
void setup() {
size(600, 600);
}
void draw() {
background(45);
colorMode(HSB, 360, 1, 1);
noFill();
strokeWeight(1);
y = map(y, -frameCount, height, height, frameCount % 720);
curvs(n);
}
void curvs(int n) {
for (int i = 0; i < n; i++) {
stroke(330 / i, .9, 0.85);
bezier(0, height / 2 + 10 * i, width / 2, y, width / 2, y, width, height / 2 + 10 * i);
}
}