Ejemplo n.º 1
0
    Gui(App *a, OscAdapter *o){
        app = a;
        osc = o;
        gui.setup();
        setasPanel.setup();
        setasPanel.setPosition(10, 250);
        init();

        bVisible = true;
        load();
    }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
		void setup() {
            ofSetFrameRate(60);
            ofSetVerticalSync(true);

            dw=ofGetScreenWidth();
			dh=ofGetScreenHeight();
			ofDisableArbTex();
            fbo.allocate(dw,dh);
            shader.load("shaders/fluid.vert","shaders/fluid.frag");

			camera.setFarClip(100000);
			camera.setNearClip(.1);
            if ( !allocate_data () ){
                    cout<<"error allocate!"<<endl;
                    exit();
			}
            clear_data ();

			gui.setup();
            gui.setPosition(ofPoint(10,10));

			gui.add(size_cube.setup("size box", 100.0f,0.0f,255.0f));
            gui.add(dvel.setup("draw velocity", true));
            gui.add(dden.setup("draw density",  false));

			gui.add(TaddSource.setup("add source",false));
			gui.add(Bclear.setup("clear source",false));

			gui.add(addX.setup("add x",false));
			gui.add(addY.setup("add y",false));
			gui.add(addZ.setup("add z",false));
			gui.add(dt.setup("time delta", 0.9f,0.0f,25.0f));
			gui.add(diff.setup("diffuse",  0.0f,0.0f,25.0f));
			gui.add(visc.setup("viscosity", 0.0f,0.0f,25.0f));
			gui.add(force.setup("add force",30.0f,0.0f,60.0f));
			gui.add(source.setup("density", 200.0f,0.0f,600.0f));
			gui.add(source_alpha.setup("alpha",0.05,0.0,1.0));
			gui.add(drawAbstacle.setup("draw abstacle",false));
			gui.add(drawAxis.setup("draw Axis",true));

			gui.add(sourcePosX.setup("source posX", 0,-10,SIZE));
			gui.add(sourcePosY.setup("source posY", 0,-10,SIZE));
			gui.add(sourcePosZ.setup("source posZ", 0,-10,SIZE));
		}
Ejemplo n.º 5
0
	// ---------------------------------------------------------------------------------------
	//
	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 );
	}
Ejemplo n.º 6
0
void setup() {
	ofSetVerticalSync(true);
	ofSetWindowShape(1024, 768);

	// we add this listener before setting up so the initial circle resolution is correct
	circleResolution.addListener(this, &ofApp::circleResolutionChanged);
	ringButton.addListener(this,&ofApp::ringButtonPressed);

	gui.setup(); // most of the time you don't need a name
	gui.add(filled.setup("fill", true));
	gui.add(radius.setup( "radius", 140, 10, 300 ));
	gui.add(center.setup("center",ofVec2f(ofGetWidth()*.5,ofGetHeight()*.5),ofVec2f(0,0),ofVec2f(ofGetWidth(),ofGetHeight())));
	gui.add(color.setup("color",ofColor(100,100,140),ofColor(0,0),ofColor(255,255)));
	gui.add(circleResolution.setup("circle res", 5, 3, 90));
	gui.add(twoCircles.setup("two circles"));
	gui.add(ringButton.setup("ring"));
	gui.add(screenSize.setup("screen size", ""));

	bHide = true;

	ring.loadSound("ring.wav");
}
Ejemplo n.º 7
0
    void setup() {
        ofBackground(255);
        ofSetFrameRate(60);
        
        config.load("config.xml");
        defaultLength = config.getFloatValue("cable/length/default");
        minLength = config.getFloatValue("cable/length/min");
        maxLength = config.getFloatValue("cable/length/max");
        host = config.getValue("osc/host");
        sendPort = config.getIntValue("osc/sendPort");
        receivePort = config.getIntValue("osc/receive");
        
        oscSend.setup(host, sendPort);
        oscReceive.setup(receivePort);
        
        local.setup("Local");
        remote.setup("Remote");
        
        zeros.setup("Zeros");
        zeros.add(nwZero.setup("NW Zero"));
        zeros.add(neZero.setup("NE Zero"));
        zeros.add(seZero.setup("SE Zero"));
        zeros.add(swZero.setup("SW Zero"));

        nwZero.addListener(this, &ofApp::zeroNW);
        neZero.addListener(this, &ofApp::zeroNE);
        seZero.addListener(this, &ofApp::zeroSE);
        swZero.addListener(this, &ofApp::zeroSW);
        
        local.gui.loadFromFile("settings.xml");
        
        local.gui.setPosition(10, 10);
        zeros.setPosition(10, 200);
        remote.gui.setPosition(10, 310);
        
    }