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
// simple thread class | |
class MyCustomThread : public ofThread { | |
protected: | |
virtual void threadedFunction() { | |
while(true) { | |
cout << "My own custom thread!" << endl; | |
ofSleepMillis(3000); | |
} | |
} | |
}; |
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
// Check 1. | |
//ofLogToFile("of.log"); | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
ofLog(OF_LOG_VERBOSE,"log something"); | |
ofLog(OF_LOG_VERBOSE,"Something to log"); | |
ofLog(OF_LOG_VERBOSE,"Something else to log"); | |
/* | |
Output of Check 1: | |
OF: OF_VERBOSE: log something |
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
//---------------------------------------- | |
void ofLight::setAmbientColor(const ofFloatColor& c) { | |
if(glIndex==-1) return; | |
ambientColor = c; | |
glLightfv(GL_LIGHT0 + glIndex, GL_AMBIENT, &c.r); | |
} | |
//---------------------------------------- | |
void ofLight::setDiffuseColor(const ofFloatColor& c) { | |
if(glIndex==-1) return; |
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 "testApp.h" | |
void testApp::setup(){ | |
ofBackground(33,33,33); | |
light.enable(); | |
// light.setDirectional(); | |
// light.setSpotlight(45.0, 0.2f); | |
light.setPointLight(); |
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 "testApp.h" | |
#include "ofMaterial.h" | |
void testApp::setup(){ | |
ofBackground(33,33,33); | |
my_fbo.allocate(ofGetWidth(),ofGetHeight()); | |
ofEnableNormalizedTexCoords(); | |
} | |
void testApp::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
// testapp.h | |
class testApp : public ofBaseApp{ | |
public: | |
ofVideoGrabber my_grabber; | |
void setup(); | |
void update(); | |
void 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
//! \p detail can be between 0 ( = icosahedron) and 8 (extremely detailed sphere) | |
//! a value of 2 yelds already very good results. | |
ref<Geometry> vl::makeIcosphere(const vec3& pos, Real diameter, int detail, bool remove_doubles) | |
{ | |
ref<Geometry> geom = new Geometry; | |
geom->setObjectName("Icosphere"); | |
ref<ArrayFloat3> coords = new ArrayFloat3; | |
ref<ArrayFloat3> norms = new ArrayFloat3; |
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
GL_ZERO -> GL_ZERO | |
GL_ZERO -> GL_ONE | |
GL_ZERO -> GL_SRC_COLOR | |
GL_ZERO -> GL_ONE_MINUS_SRC_COLOR | |
GL_ZERO -> GL_DST_COLOR | |
GL_ZERO -> GL_ONE_MINUS_DST_COLOR | |
GL_ZERO -> GL_SRC_ALPHA | |
GL_ZERO -> GL_ONE_MINUS_SRC_ALPHA | |
GL_ZERO -> GL_DST_ALPHA | |
GL_ZERO -> GL_ONE_MINUS_DST_ALPHA |
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 "BlendModeTester.h" | |
#include "error.h" | |
BlendModeTester::BlendModeTester() | |
:is_initialized(false) | |
,num_tex(1) | |
,curr_mode(0) | |
,page(0) | |
,item(0) | |
{ |
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
vector<ofVec3f> bottom; | |
vector<ofVec3f> top; | |
for(float i = 0; i < 10; ++i) { | |
float a = (i/10) * TWO_PI; | |
float x = cos(a) * 5; | |
float z = sin(a) * 5; | |
ofVec3f vec(x,0,z); | |
mesh.addVertex(vec); | |
verts.push_back(vec); | |
} |
OlderNewer