text
stringlengths
0
2.2M
// left
camLeft.scale = 20;
camLeft.pan(-90);
cameras[3] = &camLeft;
/////////////////////
// DEFINE VIEWPORTS
/////////////////////
//
setupViewports();
//
/////////////////////
/////////////////////
// SETUP SWARM
/////////////////////
//
nodeSwarm.init(100, 50, 20);
//
/////////////////////
}
//--------------------------------------------------------------
void ofApp::setupViewports()
{
//call here whenever we resize the window
/////////////////////
// DEFINE VIEWPORTS
/////////////////////
//
float xOffset = ofGetWidth()/3;
float yOffset = ofGetHeight()/N_CAMERAS;
viewMain.x = xOffset;
viewMain.y = 0;
viewMain.width = xOffset * 2;
viewMain.height = ofGetHeight();
for (int i=0; i<N_CAMERAS; i++) {
viewGrid[i].x = 0;
viewGrid[i].y = yOffset * i;
viewGrid[i].width = xOffset;
viewGrid[i].height = yOffset;
}
//
/////////////////////
}
//--------------------------------------------------------------
void ofApp::update(){
}
//--------------------------------------------------------------
void ofApp::draw(){
ofDrawBitmapString("test", 10, 10);
//////////////////////////
// BACKGROUND HIGHLIGHT
//////////////////////////
//
ofDisableDepthTest();
ofPushStyle();
ofSetColor(100, 100, 100);
ofDrawRectangle(viewGrid[iMainCamera]);
ofPopStyle();
ofEnableDepthTest();
//
//////////////////////////
//////////////////////////
// DRAW ALL VIEWPORTS
//////////////////////////
//
//draw main viewport
cameras[iMainCamera]->begin(viewMain);
drawScene(iMainCamera);
//calculate mouse ray whilst this camera is active
updateMouseRay();
cameras[iMainCamera]->end();
//draw side viewports
for (int i=0; i<N_CAMERAS; i++)
{
cameras[i]->begin(viewGrid[i]);
drawScene(i);