Beispiel #1
0
//--------------------------------------------------------------
void testApp::setup(){
	
	
	//ofSetFrameRate(50);
	lastUpdateTime = ofGetElapsedTimef();
	
	
	ofBackground(0);

	//rocket.pos.set(ofGetWidth()/2, ofGetHeight()*0.8, 0);
	setupScenes(); 
	
	
	cameraManager.init();
	//cameraManager.shutter = 35; 
	motionManager.init(cameraManager.getWidth(), cameraManager.getHeight()); 
	
	
	setupControlPanel();
	
	soundPlayer.defaultPath = "../../../Sounds/";
	
	
	soundPlayer.addSound("Crackle", "RocketFountain", 1, 1.2, 0.5,"mp3");
	soundPlayer.addSound("ExplosionSynth1", "ExplosionSynth1");
	
	soundPlayer.addSound("mortar", "SynthThud", 1, 0.8, 0.2, "mp3");
	soundPlayer.globalVolume = 1;
	
	gui.hide();
	

}
Beispiel #2
0
void userComboScene::setup()
{
	statusMessage	= "none";
	bPanelOn		= true;
	
	setupControlPanel();
	
}
Beispiel #3
0
//--------------------------------------------------------------
void testApp::setup(){
    ofSetFrameRate(60); //smooth
    ofSetVerticalSync(true);

    guiScreen = ofRectangle(0.f,0.f,1024.f, 768.f); //laptop screen
    presentationScreen = ofRectangle(guiScreen.getWidth(),0.f, 1920.f, 1080.f); // 1080p output projector screen
    
    ofBackground(0,0,0); //any colour as long as its black
    
    //openNI
    
    openNIDevice.setup();
    openNIDevice.addImageGenerator();
    openNIDevice.addDepthGenerator();
    openNIDevice.addInfraGenerator();
    openNIDevice.setRegister(true);
    openNIDevice.setMirror(true);
    openNIDevice.addUserGenerator();
    openNIDevice.setMaxNumUsers(1); //there can be only one!
    openNIDevice.start();
    
    // set properties for all user masks and point clouds
    //openNIDevice.setUseMaskPixelsAllUsers(true); // if you just want pixels, use this set to true
    openNIDevice.setUseMaskTextureAllUsers(true); // this turns on mask pixels internally AND creates mask textures efficiently
    openNIDevice.setUsePointCloudsAllUsers(true);
    openNIDevice.setPointCloudDrawSizeAllUsers(2); // size of each 'point' in the point cloud
    openNIDevice.setPointCloudResolutionAllUsers(2); // resolution of the mesh created for the point cloud eg., this will use every second depth pixel
    
    verdana.loadFont(ofToDataPath("verdana.ttf"), 24);
    
    //last setup time....
    
    timeOfPreviousFrame = ofGetElapsedTimef();
    
    eyes.vertical = false;
    breasts.vertical = false;
    crotch.vertical = false;
    
    eyes.velocity = ofVec3f();
    breasts.velocity = ofVec3f();
    crotch.velocity = ofVec3f();
    
    eyes.size = ofVec3f(0.f, 40.f ,0.f);
    breasts.size = ofVec3f(0.f, 40.f ,0.f);
    crotch.size = ofVec3f(0.f, 40.f ,0.f);
    
    setupControlPanel();
    
//    renderManager.allocateForNScreens(1, presentationScreen.getWidth(), presentationScreen.getHeight());
//    renderManager.loadFromXml("RenderManager.xml");
    
    presentationScreenFBO.allocate(presentationScreen.getWidth(), presentationScreen.getHeight());
    
    plane.setSource(presentationScreenFBO);
	plane.setCalibrateMode(true);
	plane.load("warp.bin");
}
//--------------------------------------------------------------
void testApp::setup(){
	
	ofSetWindowTitle("OpenFrameworks MPM Fluid Demo");
	ofBackground(0,0,0);
	
	bEpsCapture = false;
	bFullscreen = false;
	bShowControlPanel = true;
	ofSetFullscreen(bFullscreen);

	fluid.setup(100000);
	scaleFactor = 6.4;	// FYI: this is computed from (screensize/gridSizeX)
 
	setupControlPanel();
}  
Beispiel #5
0
//--------------------------------------------------------------
void testApp::setup(){
    ofSetFrameRate(60); //smooth
    ofSetVerticalSync(true);

    guiScreen = ofRectangle(0.f,0.f,1024.f, 768.f); //laptop screen
    presentationScreen = ofRectangle(guiScreen.getWidth(),0.f, 1920.f, 1080.f); // 1080p output projector screen
    
    ofBackground(0,0,0);
    
    previousMousePosition = ofVec2f(mouseX, mouseY);
    
    //openNI
    
    openNIDevice.setup();
    openNIDevice.addImageGenerator();
    openNIDevice.addDepthGenerator();
    openNIDevice.setRegister(true);
    openNIDevice.setMirror(true);
    openNIDevice.addUserGenerator();
    openNIDevice.setMaxNumUsers(1); //there can be only one
    openNIDevice.start();
    
    // set properties for all user masks and point clouds
    //openNIDevice.setUseMaskPixelsAllUsers(true); // if you just want pixels, use this set to true
    openNIDevice.setUseMaskTextureAllUsers(true); // this turns on mask pixels internally AND creates mask textures efficiently
    openNIDevice.setUsePointCloudsAllUsers(true);
    openNIDevice.setPointCloudDrawSizeAllUsers(2); // size of each 'point' in the point cloud
    openNIDevice.setPointCloudResolutionAllUsers(2); // resolution of the mesh created for the point cloud eg., this will use every second depth pixel
    
    verdana.loadFont(ofToDataPath("verdana.ttf"), 24);
    
    //last setup time....
    
    timeOfPreviousFrame = ofGetElapsedTimef();
    
    previousLeftHandPosition = ofVec3f();
    previousRightHandPosition = ofVec3f();
    
    leftHandMagnitude = 0.f;
    rightHandMagnitude = 0.f;
    
    setupControlPanel();
}
//--------------------------------------------------------------
void calibrationManager::setup(){

	calibrationInfo.loadImage("images/calibrationInfo.png");
	font.loadFont("fonts/HelveticaNeueMed.ttf", 32);

	nDivisionsWidth = 4;
	nDivisionsHeight = 3;

	nPosition = 0;
	pos  = 0;

	inputEnergy = 0;			// we need it?

	bAutomatic = false;
	bPreAutomatic = false;
	bAmInAutodrive = false;

	startTime = ofGetElapsedTimef();
	preTimePerDot = 10.0;
	recordTimePerDot = 0.4;
	totalTimePerDot = preTimePerDot + recordTimePerDot;
	bInAutoRecording = false;
	autoPct = 0;

	calibrationRectangle.x = 0;
	calibrationRectangle.y = 0;
	calibrationRectangle.width = 1024;
	calibrationRectangle.height = 768;

	setupControlPanel();
	fitter.setup(nDivisionsWidth, nDivisionsHeight);

	smoothing = 1.0f;
	menuEnergy = 1;
	
	bPreAutomatic = false;

}
//--------------------------------------------------------------
void GrafPlayerApp::setup(){

	
	ofxXmlSettings xmlUser;
	xmlUser.loadFile("appSettings.xml");
	string username = xmlUser.getValue("project_folder","default");
	
	pathToSettings = "projects/"+username+"/settings/";//"settings/default/";
	myTagDirectory = "projects/"+username+"/tags/";
	
	ofAddListener(ofEvents.mouseMoved, this, &GrafPlayerApp::mouseMoved);
	ofAddListener(ofEvents.mousePressed, this, &GrafPlayerApp::mousePressed);
	ofAddListener(ofEvents.mouseReleased, this, &GrafPlayerApp::mouseReleased);
	ofAddListener(ofEvents.mouseDragged, this, &GrafPlayerApp::mouseDragged);
	ofAddListener(ofEvents.keyPressed, this, &GrafPlayerApp::keyPressed);
	ofAddListener(ofEvents.keyReleased, this, &GrafPlayerApp::keyReleased);

	screenW			= ofGetWidth();
	screenH			= ofGetHeight();
	
	mode			= PLAY_MODE_LOAD;
	lastX			= 0;
	lastY			= 0;
	bShowPanel		= true;
	bRotating		= false;
	bShowName		= false;
	bShowTime		= false;
	bUseFog			= true;
	bUseMask		= true;
	bTakeScreenShot = false;
	bUseGravity		= true;
	bUseAudio		= true;
	bUseArchitecture= true;
	modeRender		= GA_RMODE_NORMAL;
	modeDualScreen	= GA_SCREENS_NORMAL;
	
	
	prevStroke		= 0;
	currentTagID	= 0;
	waitTime		= 2.f;
	waitTimer		= waitTime;
	rotationY		= -45;
	tagMoveForce	= .1;
	tagPosVel.set(0,0,0);
	z_const			= 16;
	bUseGlobalZ		= false;
	lastUpdatedZ	= -1;
	
	fontSS.loadFont("fonts/frabk.ttf",9);
	fontS.loadFont("fonts/frabk.ttf",14);
	fontL.loadFont("fonts/frabk.ttf",22);
	imageMask.loadImage("images/mask.jpg");
	
	float FogCol[3]={0,0,0};
    glFogfv(GL_FOG_COLOR,FogCol);
    glFogi(GL_FOG_MODE, GL_LINEAR);
    glFogf(GL_FOG_DENSITY, 0.05f);
	fogStart = 370;
    fogEnd   = 970;
	
	// controls
	setupControlPanel();
	updateControlPanel();
	
	if(panel.getValueB("use_rb") ) modeRender = GA_RMODE_RB;

	particleDrawer.setup(screenW,screenH);
	
	// fbo
	#ifdef GA_STACK_SCREENS
		fbo.allocate(screenW*2,screenH*2 );
	#else
		fbo.allocate(screenW,screenH );
	#endif
	
	pWarper.initWarp( screenW,screenH,screenW*WARP_DIV,screenH*WARP_DIV );
	pWarper.recalculateWarp();
	pWarper.loadFromXml(pathToSettings+"warper.xml");
	
	// audio
	audio.setup();
	
	#ifdef GA_STACK_SCREENS
		archPhysics.setup(screenW,screenH);
		archPhysics.floorH = screenH*2;
	#else
		archPhysics.setup(screenW,screenH);
	#endif
	
	archPDropTime = 0;
	
	if(bUseArchitecture)
	{
		archPhysics.archImage.loadImage(pathToSettings+"arch.jpg");
		archPhysics.loadFromXML(pathToSettings+"architecture.xml");
		createWarpedArchitecture();
	}
	
	// red blue stuff
	fboLeft.allocate(screenW,screenH );
	fboRight.allocate(screenW,screenH );
	
	loadStatus = "No tags loaded.";
	if(panel.getValueB("AUTO_LOAD") )
	{
		preLoadTags(0);
	}
	
	bSetup = true;
	
	
	gIO.setup("0","Graffiti Analysis","3.0");
	
}
//--------------------------------------------------------------------------
void testApp::setup() {	
	doScreenshots = false;
	screenshotCount = 0;
	
	ofxDaito::setup("oscSettings.xml");
	ofxConnexion::start();
	ofAddListener(ofxConnexion::connexionEvent, this, &testApp::connexionEvent);
	ofxConnexion::setLed(false);
	
	frameScaleFactor = .6;
	frameW = 320 * frameScaleFactor;
	frameH = 240 * frameScaleFactor;
	int numParticles = frameW * frameH;
	
	SP.setup(frameW, frameH);
	SP.loadDirectory("input/otherTest/");
	
	notifier.setup("network.xml");
	notifier.enable();
	ofAddListener(notifier.theEvent,this,&testApp::eventsIn);		
	
	state = VIZAPP_PARTICLES_FREE;
	
	setupControlPanel();
	if( bDebugMode == false ){
		ofSetFullscreen(true);
		panel.hide();
	}
		
	bJustLoadedUser = false;	
	pointBrightness = .5;
	aberration		= .02;
	aperture		= .01;
	
	dofShader.load("shaders/DOFCloud");
	sphereShader.load("shaders/SphereShader");
	
	timeLastLoaded = ofGetElapsedTimef();

	bDoUnload = false;

	PS.setup(numParticles);
	
	isMousePressed = false;
	
	chroma.allocate(targetWidth, targetHeight);
	chroma.begin();
	ofClear(0, 0, 0, 255);
	chroma.end();
	
	bTogglePlayer = panel.getValueB("toggle_mode");
	
	for(int k = 0; k < PS.particles.size(); k++){	
		PS.particles[k].queueState(PARTICLE_FLOCKING,  0.0);
	}
	
	connexionCamera.setup(PS);
	currentMsg = "app started";
	
	isSlow = false;
	slowState = 0;
	
	ofEnableAlphaBlending();
	
	keyPressed('f');
	keyPressed('h');
	
	ofSetSphereResolution(16);
}