float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Mark Kriegsman's Anti-aliased light bar example: http://pastebin.com/g8Bxi6zW | |
#include <FastLED.h> | |
#define LED_PIN 13 // hardware SPI pin SCK | |
#define NUM_LEDS 250 | |
#define COLOR_ORDER RGB | |
#define LED_TYPE WS2811 | |
#define MAX_BRIGHTNESS 255 // watch the power! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "FastLED.h" | |
// MarqueeOverlay | |
// | |
// Code to overlay a 'marquee' effect on top | |
// of other animations, e.g. to highlight individual | |
// letters of a sign one after another, while | |
// still allowing the underlying animations to show through. | |
// | |
// Initially designed for the "YUM cart" for Burning Man 2015. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <EthernetUdp.h> | |
#define USE_OCTOWS2811 | |
#include <OctoWS2811.h> | |
#include <FastLED.h> | |
// enter desired universe and subnet (sACN first universe is 1) | |
#define DMX_SUBNET 0 | |
#define DMX_UNIVERSE 1 //**Start** universe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Circles of dots. | |
// Created using Processing 3.5.3. | |
// | |
// Code by @marcedwards from @bjango. | |
// | |
// A GIF of this code can be seen here: | |
// https://twitter.com/marcedwards/status/1144236924095234053 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float heleCirkel = TWO_PI; //tau | |
void setup() { | |
size(500,500); | |
background(0); | |
smooth(); | |
} | |
void draw() { | |
background(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Stripe WebGl Gradient Animation | |
* All Credits to Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* https://kevinhufnagl.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fragment shader | |
// | |
// RGBA color to RGBA greyscale | |
// | |
// smooth transition based on u_colorFactor: 0.0 = original, 1.0 = greyscale | |
// | |
// http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ | |
// "The luminosity method is a more sophisticated version of the average method. | |
// It also averages the values, but it forms a weighted average to account for human perception. | |
// We’re more sensitive to green than other colors, so green is weighted most heavily. The formula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |
Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.
Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.
If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.
NewerOlder