Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

Block or report user

Report or block roxlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roxlu
roxlu / ptf.cpp
Created Dec 27, 2011
Parallel Transport Frames - TEST
View ptf.cpp
//--------------------------------------------------------------
void testApp::setup(){
ofSetFrameRate(60);
ofSetVerticalSync(true);
ofBackground(33);
donnie.create(125);
donnie.si.drawUsingQuads();
//renderer.addSceneItem(donnie.si);
@roxlu
roxlu / testApp.h
Created Feb 7, 2012
Supersimp water simulation
View testApp.h
#pragma once
#include "ofMain.h"
#include "Roxlu.h"
struct point {
int i;
int j;
};
class testApp : public ofBaseApp{
View badwords.txt
ahole
anus
ash0le
ash0les
asholes
ass
Ass Monkey
Assface
assh0le
assh0lez
@roxlu
roxlu / save_binary.cpp
Created Feb 9, 2012
Saving data into a binary file (no endianness check)
View save_binary.cpp
#include "TwitterSearchTermQueue.h"
namespace roxlu {
TwitterSearchTermQueue::TwitterSearchTermQueue()
:filepath()
{
}
TwitterSearchTermQueue::~TwitterSearchTermQueue() {
@roxlu
roxlu / fix_header_includes.py
Created Feb 10, 2012
Fixing includes for openni framework
View fix_header_includes.py
#!/usr/bin/env python
import sys
import os
import re
# Create map of localfiles
local_files = []
for dirname, dirnames, filenames in os.walk('.'):
@roxlu
roxlu / testapp.cpp
Created Mar 16, 2012
Curl FTP upload
View testapp.cpp
//--------------------------------------------------------------
void testApp::setup(){
ftp.setup("ftp.example.com", "username", "password", "HTML/"); // HTML/ <-- must end with slash.
}
//--------------------------------------------------------------
void testApp::update(){
ofSetWindowTitle(ofToString(ofGetFrameRate()));
ftp.update();
}
@roxlu
roxlu / rxParticle.cpp
Created Mar 20, 2012
Poor mans Hyphae growth
View rxParticle.cpp
#include "rxParticle.h"
rxParticle::rxParticle(ofVec3f pos, float mass)
:position(pos)
,mass(mass)
,velocity(0)
,forces(0)
,age(0)
,lifetime(10)
{
@roxlu
roxlu / coordinate_system.cpp
Created Apr 6, 2012
Calculate coordinate system based on direction vector
View coordinate_system.cpp
void Tubes::computeEdgeCoordinateSystems() {
Vec3 dir;
float inv = 0.0f;
vector<Edge*>::iterator it = graph.edges.begin();
while(it != graph.edges.end()) {
Edge* e = (*it);
dir = graph.getEdgeDirection(e).normalize();
e->z_axis = dir;
if(fabsf(dir.x) > fabsf(dir.y)) {
inv = 1.0f / sqrtf(dir.x*dir.x + dir.z*dir.z);
@roxlu
roxlu / test.cpp
Created Apr 6, 2012
Parallel Transport Frames - from graph
View test.cpp
// Generate spiral
int prev_vertex = gr.addVertex(Vec3(0,0,0));
int prev_node = gr.addNode(new Node(prev_vertex));
int num_edges = 30;
float angle = 0;
float radius = 2.0f;
float y = 0;
for(int i = 0; i < num_edges; ++i) {
angle += ((float)TWO_PI/(num_edges*0.25));
float x = cos(angle) * radius;
View number_sequences.cpp
// source: http://stackoverflow.com/questions/10105229/c-c-puzzle-to-print-values-from-1-15-15-1-with-a-single-for-loop
for (int i = 1; i < 31; i++) {
int number = (1-i/16) * i + (i/16) * (31 - i);
printf("%d ", number);
}
You can’t perform that action at this time.