예제 #1
0
//--------------------------------------------------------------
void ofApp::setup(){

    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofBackground(0);
    ofSetLogLevel(OF_LOG_SILENT);
    
    setupViewports();
    
    parameters.setup();
    robot.setup("192.168.1.9",parameters); // <-- swap with your robot's ip address
    
    setupGUI();
    positionGUI();
    
    // setup path controller
    path.setup();
    line = buildPath();
    // load/create different paths
    path.set(line);
    vector<Path *> pathPtrs;
    pathPtrs.push_back(&path);
    paths.setup(pathPtrs);
    
    feedRate = 0.001;
}
//--------------------------------------------------------------
void testApp::setup(){

	ofSetVerticalSync(true);
	ofBackground(70, 70, 70);
	ofEnableSmoothing();
	glEnable(GL_DEPTH_TEST);


	//--
	// Setup cameras

	iMainCamera = 0;
	bCamParent = false;

	// user camera
	camEasyCam.setTarget(nodeSwarm);
	camEasyCam.setDistance(100);
	cameras[0] = &camEasyCam;


	// front
	camFront.scale = 20;
	cameras[1] = &camFront;

	// top
	camTop.scale = 20;
	camTop.tilt(-90);
	cameras[2] = &camTop;

	// left
	camLeft.scale = 20;
	camLeft.pan(-90);
	cameras[3] = &camLeft;

	//
	//--



	//--
	// Define viewports

	setupViewports();

	//
	//--




	//--
	// Setup swarm

	// swarm is a custom ofNode in this example (see Swarm.h / Swarm.cpp)
	nodeSwarm.init(100, 50, 10);

	//
	//--
}
예제 #3
0
//--------------------------------------------------------------
void testApp::setup(){
	
	ofSetVerticalSync(true);
	ofBackground(70, 70, 70);
	glEnable(GL_DEPTH_TEST);
	
//	glEnable(GL_CULL_FACE);
//	glEnable(GL_LIGHTING);
//	glEnable(GL_LIGHT0);
//	glEnable(GL_COLOR_MATERIAL);
	
	
	/////////////////////
	// SETUP CAMERAS
	/////////////////////	
	//
	iCurrentCamera = 1;
	
	// user camera
	camEasyCam.setDistance(1);
	camEasyCam.setTarget(nodeSwarm);
	cameras[0] = &camEasyCam;

	
	// front
	camFront.scale = 20;
	cameras[1] = &camFront;
	
	// top
	camTop.scale = 20;
	camTop.tilt(-90);
	cameras[2] = &camTop;
	
	// left
	camLeft.scale = 20;
	camLeft.pan(-90);
	cameras[3] = &camLeft;
	
	//
	/////////////////////
	
	/////////////////////
	// DEFINE VIEWPORTS
	/////////////////////	
	//
	setupViewports();
	//
	/////////////////////	
	
	/////////////////////
	// SETUP SWARM
	/////////////////////	
	//
	nodeSwarm.init(200, 50, 20);
	//
	/////////////////////	
	
}
예제 #4
0
//--------------------------------------------------------------
void testApp::setup(){
	
	ofSetVerticalSync(true);
	ofBackground(70, 70, 70);
	ofEnableSmoothing();
	glEnable(GL_DEPTH_TEST);
	
	
	/////////////////////
	// SETUP CAMERAS
	/////////////////////	
	//
	iMainCamera = 0;
	bCamParent = false;
	
	// user camera
	camEasyCam.setTarget(nodeSwarm);
	camEasyCam.setDistance(100);
	cameras[0] = &camEasyCam;

	
	// front
	camFront.scale = 20;
	cameras[1] = &camFront;
	
	// top
	camTop.scale = 20;
	camTop.tilt(-90);
	cameras[2] = &camTop;
	
	// left
	camLeft.scale = 20;
	camLeft.pan(-90);
	cameras[3] = &camLeft;
	
	
	/////////////////////
	// DEFINE VIEWPORTS
	/////////////////////	
	//
	setupViewports();
	//
	/////////////////////	
	
	
	
	/////////////////////
	// SETUP SWARM
	/////////////////////	
	//
	nodeSwarm.init(100, 50, 20);
	//
	/////////////////////	
	
}
예제 #5
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofBackground(0);
    ofSetLogLevel(OF_LOG_NOTICE);
    setupViewports();
    
    parameters.setup();
    robot.setup(parameters);
    setupGUI();
    setupTimeline();
    positionGUI();
}
예제 #6
0
//--------------------------------------------------------------
void ofApp::setup(){

    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofBackground(0);
    ofSetLogLevel(OF_LOG_SILENT);
    
    setupViewports();
    
    parameters.setup();
    robot.setup("192.168.1.9",parameters); // <-- swap with your robot's ip address
    
    setupGUI();
    positionGUI();
    
    
    // setup mocap
    string localIP  = "192.168.1.140";
    string serverIP = "192.168.1.10";
    setupMocap(localIP,serverIP,1);
}
예제 #7
0
//--------------------------------------------------------------
void testApp::windowResized(int w, int h){
	setupViewports();
}
예제 #8
0
//--------------------------------------------------------------
void testApp::setup(){
	
	ofSetVerticalSync(true);
	ofBackground(70, 70, 70);
	ofEnableSmoothing();
	glEnable(GL_DEPTH_TEST);
	
	
	/////////////////////
	// SETUP CAMERAS
	/////////////////////	
	//
	iMainCamera = 0;
	bCamParent = false;
	
	// user camera
	camEasyCam.setTarget(nodeSwarm);
	camEasyCam.setDistance(100);
	cameras[0] = &camEasyCam;

	
	// front
	camFront.scale = 20;
	cameras[1] = &camFront;
	
	// top
	camTop.scale = 20;
	camTop.tilt(-90);
	cameras[2] = &camTop;
	
	// left
	camLeft.scale = 20;
	camLeft.pan(-90);
	cameras[3] = &camLeft;
	
	//since we're going to be accessing
	//the matricies for this camera
	//every frame, let's cache them
	//for speed
	for (int i=0; i<N_CAMERAS; i++)
		cameras[i]->cacheMatrices();
	
	//
	/////////////////////
	
	
	
	/////////////////////
	// DEFINE VIEWPORTS
	/////////////////////	
	//
	setupViewports();
	//
	/////////////////////	
	
	
	
	/////////////////////
	// SETUP SWARM
	/////////////////////	
	//
	nodeSwarm.init(100, 50, 20);
	//
	/////////////////////	
	
}
예제 #9
0
//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){
    setupViewports();
    positionGUI();
}