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
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
#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 |
#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); |
Learnings from working with Open Lighting Architecture for Mac OSX 10.9.5:
Getting the OLA c++ source, compiling it, and running the OLA daemon with Max/MSP to send pixel control data over E131.
- I had a lot of initial trouble getting OLA to compile and run on my system. My goal was to eventually control LEDs with DMX/E131 protocol using Max or another client application (built in Openframeworks, Cinder, or Processing).
- I found that my library compile problems were coming from Macports. The Official OLA documentation recommends installing with Macports but in practice Homebrew was a better option for me. Here is some info on Homebrew. http://brew.sh/ Once you have homebrew installed, you should be able to run the command
brew install ola --universal
in your terminal, which will install OLA to /usr/local/Cellar and symlink to /usr/local/lib directory. Sometimes homebrew installs the package but does not link it. You may have to run
So you want to bundle your openframeworks app and not have to worry about that pesky "data/" directory...
follow this stack overflow article:
http://stackoverflow.com/questions/4882572/how-to-bundle-an-openframeworks-application-in-xcode-relative-resource-linking
TLDR: First you need to tell xCode to copy your /bin/data directory into your application bundle by adding a build phase:
- Click on your project in the Project Navigator
- Select "Build Phases"
- Toggle open the "Run Script" section and paste in the following:
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 branches = [];//holds a list of p5.Vectors | |
var trunkSize = 10.4; | |
var currentBranchLocL = null; | |
var currentBranchLocR = null; | |
function setup() { | |
createCanvas(windowWidth, windowHeight); | |
} | |
function draw() { |
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
string bufferToString( const cinder::Buffer& buffer ) | |
{ | |
string s( static_cast<const char*>( buffer.getData() ) ); | |
if ( s.length() > buffer.getDataSize() ) { | |
s.resize( buffer.getDataSize() ); | |
} | |
return s; | |
} | |
uint8_t* bufferToUint8(const cinder::Buffer& buffer) |
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; | |
} |
NewerOlder