This file contains hidden or 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: https://github.com/sansumbrella/Pockets/blob/master/src/archive/pockets/CurveUtils.cpp | |
template <typename T> | |
vector<T> Predator::curveThrough(const vector<T> &points) | |
{ | |
assert(points.size() > 2); | |
vector<T> curvePoints; | |
T p1 = points.at(0); | |
T p2 = points.at(1); | |
T p3 = points.at(2); |
This file contains hidden or 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
https://github.com/cinder/Cinder/blob/81e55e7eb76c7c856633eaed4679aca5ab6531f4/src/cinder/gl/GlslProg.cpp#L583 | |
https://github.com/cinder/Cinder/blob/master/src/cinder/gl/EnvironmentCore.cpp#L158 | |
Uniforms | |
------------- | |
ciModelMatrix | |
ciModelMatrixInverse | |
ciModelMatrixInverseTranspose | |
ciViewMatrix | |
ciViewMatrixInverse |
This file contains hidden or 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 doc = app.activeDocument; | |
var prefix = Window.prompt ("Rename prefix", "", "By Sharkbox"); | |
function transverseTree(layer){ | |
if( layer.visible ){ | |
layer.name = prefix + "-" + layer.name; | |
} | |
for( var i=0; i<layer.layers.length; i++){ | |
transverseTree( layer.layers[i] ); |
This file contains hidden or 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
// | |
// CiTextField.h | |
// CinderText | |
// | |
// Created by Charlie Whitney on 10/13/14. | |
// | |
// | |
#pragma once |
This file contains hidden or 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
// I was getting bad results, so I looked up uniform sphere distribution and got this: http://mathworld.wolfram.com/SpherePointPicking.html | |
float phi = ofRandom( 0, TWO_PI ); | |
float costheta = ofRandom( -1.0f, 1.0f ); | |
float rho = sqrt( 1.0f - costheta * costheta ); | |
float x = rho * cos( phi ); | |
float y = rho * sin( phi ); | |
float z = costheta; | |
ofVec3f randVec(x, y, z); |
This file contains hidden or 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
In Terminal: | |
> cd (the directory where the file is) | |
> sudo chmod 777 ./(filename) | |
It will ask you for the root password (the one your computer always asks you for when you try to install new software). Type it in and press enter, but know that it will appears like you aren't even typing. Dont' be fooled! |
This file contains hidden or 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
gl::setMatricesWindow( mFbo.getSize(), false ); | |
gl::pushMatrices(); | |
mFbo.bindFramebuffer();{ | |
gl::clear( Color(0,0,0) ); | |
gl::draw( mFace ); | |
}mFbo.unbindFramebuffer(); | |
gl::popMatrices(); | |
gl::setMatricesWindow( getWindowSize(), true ); |
This file contains hidden or 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 "cinder/app/AppBasic.h" | |
#include "cinder/gl/gl.h" | |
#include "cinder/gl/Fbo.h" | |
using namespace ci; | |
using namespace ci::app; | |
using namespace std; | |
class MirroredFboApp : public AppBasic { | |
public: |