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
##################################################################### | |
# nDisplay config file | |
# | |
# This file demonstrates how to configure a simple powerwall based | |
# on 3 PCs. Each PC manages 2 output displays aligned vertically. | |
# | |
# Note: | |
# Before use, make sure all settings correspond to your system. | |
##################################################################### |
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 canvElt, | |
numFrames = 120, | |
duration = 3000, | |
recording = true, | |
time = 0 | |
function setup() { | |
canvElt = createCanvas(600, 600).elt; | |
noStroke(); |
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
'use strict' | |
var gif, canvElt, | |
numFrames = 30, | |
duration = 1200, | |
recording = true, | |
time = 0 | |
; | |
function setup() { |
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 gif, canvElt, | |
numFrames = 45, | |
duration = 1500, | |
recording = true, | |
time = 0, | |
gridW = 10, // number of cells in a row/column | |
margin = 0.15, | |
pts = [] |
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
function MagneticField() { | |
this.mmts = []; // magnetic moments in the field | |
this.addmmt = function(mx,my,px,py) { | |
this.mmts.push({ | |
m: new p5.Vector(mx,my), // the moment vector | |
pos: new p5.Vector(px,py) // its position in the field | |
}) | |
} |
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
/** | |
* Resize the image to a new width and height using nearest neigbor algorithm. To make the image scale | |
* proportionally, use 0 as the value for the wide or high parameter. | |
* For instance, to make the width of an image 150 pixels, and change | |
* the height using the same proportion, use resize(150, 0). | |
* Otherwise same usage as the regular resize(). | |
* | |
* Note: Disproportionate resizing squashes the "pixels" from squares to rectangles. | |
* This works about 10 times slower than the regular resize. Any suggestions for performance increase are welcome. | |
*/ |
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
color[] colors; | |
void getColorPalette(){ | |
try { | |
String[] strs = loadStrings("http://savemypalette.com/api/random/palettes/"); | |
saveStrings("colorData", strs); | |
JSONObject json = loadJSONObject("colorData"); | |
JSONArray cs = json.getJSONArray("colors"); |