Skip to content

Instantly share code, notes, and snippets.

cd DIRECTORY_WITH_.ruby-version_AND_Gemfile
brew update
brew upgrade ruby-build
rbenv install
gem install bundler
bundle install

Keybase proof

I hereby claim:

  • I am drewish on github.
  • I am drewish (https://keybase.io/drewish) on keybase.
  • I have a public key whose fingerprint is 4FFD A235 05DE 31CC E6C5 8F09 EC2E 7937 F120 9926

To claim this, I am signing this object:

@drewish
drewish / TrianglePaintApp.cpp
Created August 5, 2014 02:51
trying to figure out cinder screenToWorld
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/params/Params.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@drewish
drewish / TestMeshApp.cpp
Last active August 29, 2015 14:05
Simple demo to compare drawing 2D triangles with Cinder's VBO and TriMesh wrappers
// Simple demo to compare drawing 2D triangles with Cinder's VBO and TriMesh wrappers.
// https://drewish.com/2014/08/16/comparing-the-trimesh-and-vbomesh-in-cinder/
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Trimesh.h"
#include "cinder/params/Params.h"
using namespace ci;
@drewish
drewish / StarterApp.cpp
Created October 5, 2014 03:06
My Cinder StarterApp
#include "cinder/app/AppNative.h"
#include "cinder/Camera.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Utilities.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@drewish
drewish / polyline_area.cpp
Last active August 29, 2015 14:14
Area of a cinder::PolyLine2f
// Assumes line does not self intersecting
// Treats the line as closed (you wanted area right?)
// http://www.mathsisfun.com/geometry/area-irregular-polygons.html
float area( PolyLine2f line ) {
float sum = 0.0;
if ( line.size() > 1 ) {
PolyLine2f::iterator it;
Vec2f prev, curr;
for ( it = line.begin(), prev = *it++; it != line.end() ; it++ ) {
curr = *it;
/*
* Based off of http://sambro.is-super-awesome.com/2011/03/03/creating-a-proper-buffer-in-a-node-c-addon/
*/
static Local<Object> makeBuffer(char* data, size_t size) {
HandleScope scope;
// It ends up being kind of a pain to convert a slow buffer into a fast
// one since the fast part is implemented in JavaScript.
Local<Buffer> slowBuffer = Buffer::New(data, size);
// First get the Buffer from global scope...
@drewish
drewish / binding.gyp
Created September 11, 2012 07:51
gyp support for exiv2node
{
'targets': [
{
'target_name': 'exiv2',
'sources': [
'exiv2node.cc'
],
'xcode_settings': {
'OTHER_CFLAGS': [
'<!@(pkg-config --cflags exiv2)',
@drewish
drewish / SquarePerspectiveApp.cpp
Last active October 21, 2015 16:00
SquarePerspectiveApp
// About this: https://drewish.com/2014/08/23/using-cinder's-cameraortho-and-vbomesh-to-draw-cubes/
// Inspired by: http://onepointperspective.tumblr.com/post/7805032561/the-perspective-of-a-square
// Use with Cinder 0.9.x
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Utilities.h"
@drewish
drewish / cinder_docs_todo.md
Last active January 24, 2016 17:42
Cinder Documentation To Do

Needs documentation

CameraUi

  • Should document the effects of the various mouse button presses
  • Is there a way to limit camera moves?

Geom::Plane

  • Explain what the axes params mean.