Orientation() { base::mParamGroup.setName(getName()); base::mParamGroup.add(mSpeed.set("speed", 0.05, 0.001, 0.1)); base::mParamGroup.add(mLigPos.set("light_pos", ofVec3f(0,0,0), ofVec3f(-600,-600,-600), ofVec3f(600,600,600))); base::mParamGroup.add(mLigDirection.set("light_direction", ofVec3f(0,0,0), ofVec3f(-360,-360,-360), ofVec3f(360,360,360))); }
//-------------------------------------------------------------- void testApp::setup() { ofSetFrameRate(60); ofSetVerticalSync(true); ofBackground(0); keyValue.setup(5500); params.setName("params"); params.add( param1.set("param1float", 0.5f) ); params.add( param2.set("param2bool", false) ); params.add( param3.set("param3vec2", ofVec2f(0.1,0.2)) ); }
//---------- TextField::TextField(ofParameter<string> & parameter) : TextField(parameter.getName()) { this->textField->onTextChange += [this] (string text) { if(!this->disableTextFieldEvents) { this->parameter->set(text); } }; this->parameter->addListener(this, &TextField::parameterCallback); }
void setup(string name) { gui.setup(name); gui.add(nwLength.set("NW Length", defaultLength, minLength, maxLength)); gui.add(nwSpeed.set("NW Speed", 0, -maxSpeed, maxSpeed)); gui.add(neLength.set("NE Length", defaultLength, minLength, maxLength)); gui.add(neSpeed.set("NE Speed", 0, -maxSpeed, maxSpeed)); gui.add(seLength.set("SE Length", defaultLength, minLength, maxLength)); gui.add(seSpeed.set("SE Speed", 0, -maxSpeed, maxSpeed)); gui.add(swLength.set("SW Length", defaultLength, minLength, maxLength)); gui.add(swSpeed.set("SW Speed", 0, -maxSpeed, maxSpeed)); }
void setup(){ ofSetVerticalSync(false); w=ofGetScreenWidth(); h=ofGetScreenHeight(); ofDisableArbTex(); img.load("1.jpg"); player.load("1.mp4"); player.play(); player.setLoopState(OF_LOOP_NORMAL); gray = img; gray.setImageType(OF_IMAGE_GRAYSCALE); wc.load("wcolor.vert","wcolor.frag"); ofFbo::Settings s; s.depthStencilAsTexture=true; s.useDepth=true; s.width=w; s.height=h; fboDepth.allocate(s); fbo.allocate(w,h); fbo.begin(); ofClear(0,0,100,255); fbo.end(); gui.setup(); gui.add(stepGradient.set("step gradient", .0015, -1., 1.)); gui.add(advectStep.set("step advect", .0015, -.1, .1)); gui.add(flipHeightMap.set("flip height map", 0.7, 0., 2.)); gui.add(time.set("time", 0., 0., 1.)); gui.add(advectMatrix.set("advect matrix", ofVec4f(0.1), ofVec4f(-1.), ofVec4f(1.))); gui.add(switchVideo.set("switch video", false)); }
BoxPerticle(ofTexture & tex , int max_num_box = 400):mTex(tex), maxNumBox(max_num_box) { base::mParamGroup.add(mBoxNum.set("num_box", 10, 1, maxNumBox)); base::mParamGroup.add(mRotationSpeed.set("rotation_speed", 0.1, 0, 0.4)); base::mParamGroup.add(mBoxSize.set("box_size", 10, 0, 600)); base::mParamGroup.add(mSpacing.set("spaceing", 10, 1, 100)); base::mParamGroup.add(mCloudSize.set("cloud_size", 600, 100, 2000)); base::mParamGroup.add(mCol.set("color", ofColor(255,255,255,255), ofColor(0,0,0), ofColor(255,255,255,255))); base::mParamGroup.add(mRandomCol.set("random_color", false)); for (int i = 0; i < maxNumBox; i++) { mBox.push_back(ofBoxPrimitive()); } }
void ofxGtkSwitch::set(ofParameter<bool> &p){ param.makeReferenceTo(p); if(p.isReadOnly()) set_sensitive(false); listener.unsubscribe(); update(); listener = param.newListener([&](const bool& b){ set_state(param); }); if(!con){ con = connect_property_changed_with_return("state", [&](){ param.set(get_state()); }); } }
void clamp(ofParameter<T>& x) { x = ofClamp(x, x.getMin(), x.getMax()); }
// --------------------------------------------------------------------------------------- // void setup() { ofSetFrameRate(60); ofSetVerticalSync(true); ofBackground(0); ofxCL::Context::listDevices(); ocl.setup( 0, true ); noiseProgram.load("NoiseKernel.cl"); methodNames.push_back( "GradientNoiseImage2d" ); methodNames.push_back( "RidgedMultiFractalImage2d" ); methodNames.push_back( "MonoFractalImage2d" ); methodNames.push_back( "TurbulenceImage2d" ); Resolution.addListener(this, &ofApp::resolutionChanged); gui.setup("Settings", "Settings.xml"); gui.add( methodIndex.set( "methodIndex", 3, 0, methodNames.size()-1 ) ); gui.add( Resolution.set( "Resolution", 1024, 2, 4096 ) ); gui.add( Scale.set( "Scale", 1.0, 0.0, 1.0 ) ); gui.add( ScaleMultiplier.set( "Scale Multiplier", 3.0, 0.001, 100.0f ) ); gui.add( Lacunarity.set( "Lacunarity", 2.02f, 0.001f, 10.0f ) ); gui.add( Increment.set( "Increment", 1.0f, -1.0, 1.0f ) ); gui.add( Octaves.set( "Octaves", 3.3f, 0.001, 20.0f ) ); gui.add( Amplitude.set( "Amplitude", 1.0f, 0.001, 10.0f ) ); gui.add( AutoMove.set( "AutoMove", true ) ); gui.add( AutoMoveMagnitude.set( "AutoMoveMagnitude", 0.5f, 0.001, 10.0f ) ); drawGui = true; fontSmall.loadFont("DIN.otf", 8 ); }