wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile
source ~/.profile #permanently add PATH to profile
go get github.com/github/git-lfs
cp gocode/bin/git-lfs /usr/bin #might have to run this command as sudo
#General rules for working with shaders in OpenFrameworks
- in main.cpp, set the GL version to 3,2:
ofGLWindowSettings settings;
settings.setGLVersion(3,2);
ofCreateWindow(settings);
- in ofApp.h, declare your shader member variable:
ofShader shader;
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 "ofApp.h" //include ofApp so you can use OF defined functions and vars | |
class Ball { | |
public: | |
Ball();//constructor | |
~Ball();//destructor | |
//current ball position, you'll need to initialize | |
//this somewhere in your constructor or another method | |
ofVec2f mBallPos; | |
bool checkIntersects(const ofVec2f &positionToCheck); |
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
Sailboat.prototype = { | |
constructor: Sailboat, | |
sail : function(){ | |
if(this.xpos > width) | |
{ | |
this.xpos = -200; | |
this.ypos = random(height); | |
} | |
this.xpos = this.xpos + this.speed; | |
} |
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 particles = []; | |
function draw(){ | |
for (var i = 0; i < particles.length; i++) { | |
//render your elipse with particle properties as x and y values | |
ellipse(particles[i].positionX, ...); | |
}; | |
} |
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
ANNUAL | JAN | FEB | MAR | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC | YEARS | # CITIES | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Average Temperature (F) | 7 | 24.5 | 18.3 | 10 | 3.4 | -0.8 | -4.3 | -6.7 | -7.1 | -3.5 | 4.6 | 15.7 | 23.7 | 23 | 48 | |
Average High Temperature (F) | 5.7 | 25.9 | 18.2 | 7.4 | 0.2 | -3.1 | -6.3 | -8.6 | -9.2 | -5.4 | 3.7 | 16.4 | 25.2 | 16 | 28 | |
Average Low Temperature (F) | -6.7 | 15.9 | 7.4 | -3.9 | -11.6 | -15.6 | -19.4 | -22.5 | -23.4 | -19.7 | -10.3 | 4.2 | 14.9 | 16 | 28 | |
Average Precipitation (in) | 16.4 | 1.1 | 1.3 | 1.6 | 1.7 | 1.5 | 1.3 | 1.5 | 1.4 | 1.6 | 1.4 | 1.1 | 1.1 | 17 | 26 |
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
p5.prototype.loadTable = function (path) { | |
var callback = null; | |
var options = []; | |
var header = false; | |
var sep = ','; | |
var decrementPreload = p5._getDecrementPreload.apply(this, arguments); | |
var args = new Array(arguments.length); | |
for (var i = 0; i < args.length; ++i) { | |
args[i] = arguments[i]; | |
} |
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
#description: convert an image sequence to an animated gif, and resize to 500px x 500px, preserving aspect ratio | |
convert -delay 0 -loop 0 resize 500x500 defaultCanvas0-000000*.png animated-500.gif |
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 case: converting image sequence to .mp4 video | |
#official documentation: https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images | |
#description: | |
# An image sequence follows the pattern, defaultCanvas0-000000000.png (9 zeros) | |
# video codec is libx264 | |
# pixel format yuv420p | |
# output file is named out.mp4 | |
ffmpeg -i 'defaultCanvas0-%9d.png' -c:v libx264 -pix_fmt yuv420p out.mp4 | |
#if you want your image sequence to start on a different number than index 0, use the -start_number parameter |
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
#on mac and linux | |
# xvf means [x]: extract, [v]: verbosely, [f]: following is filename | |
tar xvf [tar_name].tar #replace [tar_name] with name of tar | |
#on windows | |
#you could use cygwin or the 7-zip utility: http://www.7-zip.org/ |
NewerOlder