Esempio n. 1
0
//--------------------------------------------------------------
void testApp::draw()
{
	/// Scene Manager draw
	// ------------------
	
	setDrawFloorAuto(true);
	
	int main_screen_width = 1920;
	int main_screen_height = 1200;
	
	main_screen_width = min(main_screen_width, ofGetWidth());
	main_screen_height = min(main_screen_height, ofGetHeight());
	
	ramCameraManager::instance().setActiveCamera(0);
	
	ofPushView();
	ofViewport(0, 0, 1920, 1200);
	
	ramBeginCamera();
	drawFloor();
	ramEndCamera();
	
	sceneManager.draw();
	ofPopView();
	
	int screen_w = 1280, screen_h = 720;
	
	int inv_screen_height = ofGetHeight() - screen_h;
	
	for (int i = 0; i < 5; i++)
	{
		ofPushView();
		
		ofCamera *screen_camera = ramCameraManager::instance().getCamera(i + 1);
		
		ofViewport(ofRectangle(main_screen_width + i * screen_w, inv_screen_height, screen_w, screen_w));
		ramCameraManager::instance().setActiveCamera(i + 1);
		
		screen_camera->begin();
		drawFloor();
		screen_camera->end();
		
		sceneManager.draw();
		
		ofPopView();
	}

	ramCameraManager::instance().setActiveCamera(0);
	
	setDrawFloorAuto(false);
}
Esempio n. 2
0
//--------------------------------------------------------------
void myAmeManager::draw()
{
	
	ofSetColor(255,255,255,255);
    cam.begin();

	ofPushMatrix();												//	save the old coordinate system  
		ofScale(1.0f, -1.0f);										//	flip the y axis vertically, so that it points upward  
		myVolume.drawVolume(0,0,0, ofGetHeight(), 0);				//	draw Volume
		mesh_tracker_interaction.draw(cam, myData);					//	draw mesh

		ofPushView();
			myData.draw();												//	draw tracker
			ofSetupScreenPerspective(ofGetWidth(), ofGetHeight(),OF_ORIENTATION_DEFAULT,true,50,0,1000);
		ofPopView();
	ofPopMatrix();												//	restore the previous coordinate system  
	
	cam.end();

	if(bStadisticsVisible)
	{
		myTracker.draw();
		//logTracker::getInstance()->draw(1000, 30);
	}
	
}
Esempio n. 3
0
void BufferCont::drawSolution(){
	
	float size = m_view[camBot].width<m_view[camBot].height ? m_view[camBot].width : m_view[camBot].height;
	if (g_showPop)	drawPoint(m_view[viewBot], m_cam[camBot], m_solPoint.front());

	m_cam[camBot].begin(m_view[viewBot]);
	ofSetColor(255, 0, 0);
	ofVec3f start, end;
	start.x = -size / 2;	start.y = -size / 2;		start.z = 0;
	end.x = size / 2; 		end.y = -size / 2;		end.z = 0;
	ofDrawArrow(start, end, 5.0);
	m_font.drawString("x1", end.x, end.y);
	end.x = -size / 2; end.y = size / 2; end.z = 0;
	ofDrawArrow(start, end, 5.0);
	m_font.drawString("x2", end.x, end.y);
	m_cam[camBot].end();

	ofPushView();
	ofViewport(m_view[viewBot]);
	ofSetupScreen();
	stringstream ss;
	ss << "evals: " << Global::msp_global->mp_problem->getEvaluations();
	ofSetColor(0, 0, 0);
	m_font.drawString(ss.str(), 5, 25);
	ofPopView();

}
Esempio n. 4
0
//--------------------------------------------------------------
void ofxGLEditor::draw() {
	ofPushView();
	ofPushMatrix();
	ofPushStyle();
	
		ofEnableAlphaBlending();
	
		if(!bHideEditor) {
			if(m_fileDialog->isActive()) {
				m_fileDialog->draw();
			}
			else {
				m_editors[m_currentEditor]->draw();
			}
		}
		else { // make sure to update animation timing even if not drawn
			m_editors[m_currentEditor]->updateTimestamps();
		}
		
		ofDisableAlphaBlending();
	
	ofPopStyle();
	ofPopMatrix();
	ofPopView();

//	glDisable(GL_LIGHTING);
//    glDisable(GL_DEPTH_TEST);
//	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
Esempio n. 5
0
void ofxComposer::draw(){
    ofPushView();
    ofPushStyle();
    ofPushMatrix();
    
    ofEnableAlphaBlending();
    for(int i = 0; i < patches.size(); i++){
        patches[i]->draw();
    }
    
    if ( bGLEditor && (selected >= 0)){
        if (patches[selected]->getType() == "ofShader"){
            editorFbo.begin();
            ofClear(0, 150);
            ofRotate(180, 0, 1, 0);
            editor.draw();
            editorFbo.end();
        } else {
            editorFbo.begin();
            ofClear(0, 50);
            editorFbo.end();    
        }
    } 
    
    if (selectedDot >= 0){
        ofLine(patches[selectedDot]->getOutPutPosition(), ofPoint(ofGetMouseX(),ofGetMouseY()));
    }
    
    ofDisableBlendMode();
    ofEnableAlphaBlending();
    
    ofPopMatrix();
    ofPopStyle();
    ofPopView();
}
Esempio n. 6
0
void ofxCalibImage::draw3DGrid(ofxATANCamera &Camera, bool bDrawErrors){
    
    ofPushStyle();
    ofPushView();
    ofSetLineWidth(2);
    ofSetColor(0, 0, 255);

    for(int i=0; i< (int) mvGridCorners.size(); i++){
        for(int dirn=0; dirn<4; dirn++)
            if(mvGridCorners[i].aNeighborStates[dirn].val > i){
                TooN::Vector<3> v3; v3[2] = 0.0;
                v3.slice<0,2>() = vec(mvGridCorners[i].irGridPos);
                TooN::Vector<2> A = Camera.Project( PTAMM::project(mse3CamFromWorld * v3));
                
                v3.slice<0,2>() = vec(mvGridCorners[mvGridCorners[i].aNeighborStates[dirn].val].irGridPos);
                TooN::Vector<2> B = Camera.Project( PTAMM::project(mse3CamFromWorld * v3));
                ofLine(A[0], A[1], B[0], B[1]);
            }
    }
    
    if(bDrawErrors){
        ofSetColor(255,0, 255);
        ofSetLineWidth(1);
        for(int i=0; i< (int) mvGridCorners.size(); i++){
            TooN::Vector<3> v3; v3[2] = 0.0;
            v3.slice<0,2>() = vec(mvGridCorners[i].irGridPos);
            TooN::Vector<2> v2Pixels_Projected = Camera.Project( PTAMM::project(mse3CamFromWorld * v3));
            TooN::Vector<2> v2Error = mvGridCorners[i].Params.v2Pos - v2Pixels_Projected;
            TooN::Vector<2> B = v2Pixels_Projected + 10.0 * v2Error;
            ofLine(v2Pixels_Projected[0], v2Pixels_Projected[1], 
                   B[0], B[1]);
        }
    }
};
Esempio n. 7
0
//----------------------------------------
void ofCamera::begin(ofRectangle rect) {
	if(!isActive) ofPushView();
	isActive = true;
	
	ofSetCoordHandedness(OF_RIGHT_HANDED);
	
	// autocalculate near/far clip planes if not set by user
	float nc = nearClip, fc = farClip;
	if(nearClip == 0 || farClip == 0) {
		float dist = rect.height * 0.5f / tanf(PI * fov / 360.0f);
		nc = (nearClip == 0) ? dist / 100.0f : nearClip;
		fc = (farClip == 0) ? dist * 10.0f : farClip;
	}
	
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	if(isOrtho) {
		//			if(vFlip) glOrtho(0, width, height, 0, nearDist, farDist);
		//			else 
#ifndef TARGET_OPENGLES
		glOrtho(0, rect.width, 0, rect.height, nc, fc);
#endif		
	} else {
		gluPerspective(fov, rect.width/rect.height, nc, fc);
	}
	
	glMatrixMode(GL_MODELVIEW);
	glLoadMatrixf(ofMatrix4x4::getInverseOf(getGlobalTransformMatrix()).getPtr());
	//ofViewport(rect.x, rect.y, rect.width, rect.height);
}
Esempio n. 8
0
//--------------------------------------------------------------
void testApp::draw() {
	
	simpleCam.begin(); // ofRectangle(ofGetWidth(), ofGetHeight(), 10000, -10000)
	
	if(bdrawdebug){
        ofDrawAxis(100);
    }
	
	ofPushView();
	
	ofTranslate(-(colsmesh*distsmesh)*0.5, -(rowsmesh*distsmesh)*0.5, 0);
	
	blackmesh.draw();
	myhand.draw(true);
	
	ofPopView();
	
	simpleCam.end();
	
	// finally, a report:
	//ofSetHexColor(0xff0000);
	ofSetColor(255,0,0);
	char reportStr[1024];
	sprintf(reportStr, "deformable mesh\nKEY 'o' to select ID particles --\nKEY 'p' to select ID particles ++\nKEY 'm' for move particles\nKEY 'f' for apply vector forces to strings\nfps: %f", ofGetFrameRate());
	
	if(bdrawdebug){
        ofDrawBitmapString(reportStr, 20, 600);
    }

}
Esempio n. 9
0
//----------------------------------------
void ofCamera::begin(ofRectangle viewport) {
	if(!isActive) ofPushView();
	isActive = true;

	ofSetCoordHandedness(OF_RIGHT_HANDED);

	// autocalculate near/far clip planes if not set by user
	calcClipPlanes(viewport);

	glMatrixMode(GL_PROJECTION);
	ofLoadIdentityMatrix();
	
	if(isOrtho) {
		//			if(vFlip) glOrtho(0, width, height, 0, nearDist, farDist);
		//			else
#ifndef TARGET_OPENGLES
		glOrtho(0, viewport.width, 0, viewport.height, nearClip, farClip);
#else
		ofMatrix4x4 ortho;
		ortho.makeOrthoMatrix(0, viewport.width, 0, viewport.height, nearClip, farClip);
		ofLoadMatrix( ortho );
#endif
	} else {
		
		ofMatrix4x4 persp;
		persp.makePerspectiveMatrix( fov, viewport.width/viewport.height, nearClip, farClip );
		ofLoadMatrix( persp );
		//gluPerspective(fov, viewport.width/viewport.height, nearClip, farClip);
	}

	glMatrixMode(GL_MODELVIEW);
	ofLoadMatrix( ofMatrix4x4::getInverseOf(getGlobalTransformMatrix()) );
	ofViewport(viewport);
}
Esempio n. 10
0
//--------------------------------------------------------------
void testApp::render_texture(ofEventArgs &args)
{
//    ofClear(127, 0, 0, 1);
//    
//    float w = cml->tex_width();
//    float h = cml->tex_height();
//    
//    ofPushView();
//    ofViewport(ofRectangle(0,0,w,h));
//    ofSetupScreenOrtho(w, h, -1, 1);
//    ofSetColor(255);
//
//    glClearColor(0.5, 0, 0, 1);
//    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    ofClear(255 * 0.5, 0, 0, 1);
    
    float w = cml->tex_width();
    float h = cml->tex_height();
    
    ofPushView();
    ofViewport(0,0,w,h,true);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, w, 0, h, -1, 1);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    
    //kinect.drawDepth(0, 0, w, h);
    colorMap.draw(0, 0, w, h);
    //cml->get_hue_tex_ref( kinect.getRawDepthPixels() ).draw( 0, 0, w, h );
    ofPopView();
}
Esempio n. 11
0
//--------------------------------------------------------------
void testApp::draw(){
	ofRectangle viewLeft = ofGetCurrentViewport();
	viewLeft.width /= 2.0f;
	ofRectangle viewRight = viewLeft;
	viewRight.x += viewLeft.width;

	ofPushStyle();
	ofNoFill();
	ofSetColor(255);
	ofRect(viewLeft);
	ofRect(viewRight);
	ofPopStyle();

	if (!(indexLeft == cameraIndices.end() || indexRight == cameraIndices.end())) {
		CorrespondenceSetd::iterator it;
		ofMesh pointsLeft, pointsRight;
		for (it = dataSet.begin(); it != dataSet.end(); it++) {
			if (it->cameraID1 == *indexLeft && it->cameraID2 == *indexRight) {
				pointsLeft.addVertex(it->getXY1());
				pointsLeft.addColor(ofFloatColor((it->xy2[0] + 1.0f) / 2.0f, (1.0f - it->xy2[1]) / 2.0f, 0));

				pointsRight.addVertex(it->getXY2());
				pointsRight.addColor(ofFloatColor((it->xy1[0] + 1.0f) / 2.0f, (1.0f - it->xy1[1]) / 2.0f, 0));
			}
		}
		
		ofPushView();
		glPointSize(5.0f);
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();

		ofViewport(viewLeft);
		pointsLeft.drawVertices();
		ofViewport(viewRight);
		pointsRight.drawVertices();

		ofPopView();
	}

	if (indexLeft != cameraIndices.end())
		ofDrawBitmapString(ofToString(*indexLeft), viewLeft.x + 10, viewLeft.height - 10);
	if (indexRight != cameraIndices.end())
		ofDrawBitmapString(ofToString(*indexRight), viewRight.x + 10, viewRight.height - 10);

	stringstream message;
	message << "Cameras {";
	set<int>::iterator it;
	for (it = cameraIndices.begin(); it != cameraIndices.end(); it++) {
		if (it != cameraIndices.begin())
			message << ", ";
		message << *it;
	}
	message << "}" << endl;
	
	ofDrawBitmapString(message.str(), 20, 30);

}
Esempio n. 12
0
	void ftParticleFlow::draw(int _x, int _y, int _width, int _height) {
		ofPushView();
		ofTranslate(_x, _y);
		ofScale(_width / numParticlesX, _height / numParticlesY);
		drawParticleShader.update(particleMesh, numParticles, particlePositionSwapBuffer.getBackTexture(), particleAgeLifespanMassSizeSwapBuffer.getBackTexture(), twinkleSpeed.get());
		
		ofPopView();
	}
Esempio n. 13
0
void ofFbo::begin() {
	bind();
	ofPushView();
	if(ofGetGLRenderer()){
		ofGetGLRenderer()->setCurrentFBO(this);
	}
	ofViewport(0, 0, getWidth(), getHeight(), false);
	ofSetupScreenPerspective(getWidth(), getHeight(), ofGetOrientation(), false);
}
// ---------------------------------------------------------------------------------------------------------------------------------------------------
//
void ofxOculusRift::draw( ofVec2f pos, ofVec2f size )
{
	// Todo: rewrite this
	
	
	ofPushView();
	
		// draw into the new fbo we have made
		ofSetColor( 255 );
		glBindFramebuffer(GL_FRAMEBUFFER, framebufferID);
			ofClear(0,0,0);
			eyeFboLeft.draw( 0.0f, 0.0f );
			eyeFboRight.draw( eyeFboLeft.getWidth(), 0.0f );
	
			// is this being drawn correctly?
	
		glBindFramebuffer(GL_FRAMEBUFFER, 0);
		
		ofSetMatrixMode(OF_MATRIX_PROJECTION);
		ofLoadIdentityMatrix();
		ofSetMatrixMode(OF_MATRIX_MODELVIEW);
		ofLoadIdentityMatrix();
		
		ofSetColor( 255 );
			
		if( doWarping )
		{
			glEnable( GL_TEXTURE_2D );
			glBindTexture(GL_TEXTURE_2D, colorTextureID);
			
			renderDistortedEyeNew( true,  0.0f, 0.0f, 0.5f, 1.0f);
			renderDistortedEyeNew( false, 0.5f, 0.0f, 0.5f, 1.0f);
			
			glDisable( GL_TEXTURE_2D );
		}
		
	ofPopView();

	/*
	glBegin(GL_TRIANGLE_STRIP);
		glTexCoord2f(pos.x,			pos.y		);   glVertex2f(-1.0f, -1.0f);
		glTexCoord2f(pos.x+size.x,	pos.y	 	);   glVertex2f(0.0f, -1.0f);
		glTexCoord2f(pos.x,			pos.y+size.y);   glVertex2f(-1.0f, 1.0f);
		glTexCoord2f(pos.x+size.x,	pos.y+size.y);   glVertex2f(0.0f, 1.0f);
	glEnd();
	 */
	
	if( !doWarping )
	{
		ofSetColor(255);
		eyeFboLeft.draw( 0.0f, 0.0f );
		eyeFboRight.draw( eyeFboLeft.getWidth(), 0.0f );
	}
	
	needSensorReadingThisFrame = true;
}
Esempio n. 15
0
void MissingControl::drawPlan(float x, float y, float side) {
	ofPushView();
	ofViewport(x, y, side, side);
	ofSetupScreenOrtho(side, side, OF_ORIENTATION_DEFAULT, false, -stageHeight, stageHeight);
	ofTranslate(side / 2, side / 2);
	float scale = side / stageSize;
	ofScale(scale, scale, scale);
	drawScene(false);
	ofPopView();
}
Esempio n. 16
0
void SecondCamera::begin(ofRectangle viewport)
{
	ofPushView();
	ofViewport(viewport);
	
	glMatrixMode(GL_PROJECTION);
	glLoadMatrixf(matProjection.getPtr());
	
	glMatrixMode(GL_MODELVIEW);
	glLoadMatrixf(matModelView.getPtr());
}
//---------
void ThreadSet::drawProjectionSpace() {
	ofPushView();
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	for(auto thread : *this) {
		thread.drawProjectionSpace();
	}
	ofPopView();
}
Esempio n. 18
0
	void ftParticleFlow::draw(int _x, int _y, int _width, int _height, ofTexture& _velocity) {
		ofPushView();
		ofTranslate(_x, _y);
		ofScale(_width / numParticlesX, _height / numParticlesY);
        if (!bStretch) {
            drawParticleShader.update(particleMesh, numParticles, particlePositionSwapBuffer.getBackTexture(), particleAgeLifespanMassSizeSwapBuffer.getBackTexture(), twinkleSpeed.get(), hueToRgb);
        } else {
            drawParticleStretchedShader.update(particleMesh, numParticles, particlePositionSwapBuffer.getBackTexture(), particleAgeLifespanMassSizeSwapBuffer.getBackTexture(), twinkleSpeed.get(), hueToRgb, _velocity, particleTexture, stretchFactor.get());
        }
		
		ofPopView();
	}
Esempio n. 19
0
void ofFbo::begin(bool setupScreen) {
	if(!bIsAllocated) return;
	ofPushView();
	if(ofGetGLRenderer()){
		ofGetGLRenderer()->setCurrentFBO(this);
	}
	ofViewport();
	if(setupScreen){
		ofSetupScreenPerspective();
	}
	bind();
}
Esempio n. 20
0
//----------------------------------------
void ofx2DCam::begin(ofRectangle _viewport){
    viewport = _viewport;
    ofPushView();
    ofViewport(viewport);
    ofSetupScreenOrtho(viewport.width, viewport.height, nearClip, farClip);
    ofPushMatrix();
    ofRotateX(orientation.x);
    ofRotateY(orientation.y);
  
    ofTranslate(translation*orientationMatrix);
    ofScale(scale,scale,scale);
    
}
//--------------------------------------------------------------
void ofApp::draw(){
    
    depthImage.draw(0, 0);
    
    ofPushView();
	tracker.getOverlayCamera().begin(ofRectangle(0, 0, 640, 480));
	tracker.draw();
	tracker.getOverlayCamera().end();
	ofPopView();
    
    ofDrawBitmapStringHighlight(ofToString((int) ofGetFrameRate()) + " FPS", 20, 30);

}
Esempio n. 22
0
//----------------------------------------
void ofCamera::begin(ofRectangle viewport) {
	if(!isActive) ofPushView();
	isActive = true;

	ofViewport(viewport.x,viewport.y,viewport.width,viewport.height);
	ofSetOrientation(ofGetOrientation(),vFlip);

	ofSetMatrixMode(OF_MATRIX_PROJECTION);
	ofLoadMatrix( getProjectionMatrix(viewport) );

	ofSetMatrixMode(OF_MATRIX_MODELVIEW);
	ofLoadViewMatrix( getModelViewMatrix() );
}
Esempio n. 23
0
 void Informer::draw( 
   float x, float y, float w, float h )
 {
   ofPushView();
   ofViewport(x,y,w,h);
   for(auto &info:I)
   {
     if(info.second.delay<=0)
     {
       info.second.iNode->draw();
     }      
   }
   ofPopView();
 }
Esempio n. 24
0
void ofxGLEditor::draw() {

	ofPushView();
	ofPushMatrix();
	ofPushStyle();
		glEditor[currentEditor]->Render();
	ofPopStyle();
	ofPopMatrix();
	ofPopView();

	glDisable(GL_LIGHTING);
	glDisable(GL_DEPTH_TEST);

}
Esempio n. 25
0
//--------------------------------------------------------------
void ofApp::draw() {

    //--
    // 2d view

    drawViewportOutline(viewport2D);

    // keep a copy of your viewport and transform matrices for later
    ofPushView();

    // tell OpenGL to change your viewport. note that your transform matrices will now need setting up
    ofViewport(viewport2D);

    // setup transform matrices for normal oF-style usage, i.e.
    //  0,0=left,top
    //  ofGetViewportWidth(),ofGetViewportHeight()=right,bottom
    ofSetupScreen();

    ofFill();
    ofSetColor(220);
    for(int x = 0; x < 1000; x += 20) {
        for(int y = 0; y < 1000; y += 20) {
            ofCircle(x, y, sin((x + y) / 100.0f + ofGetElapsedTimef()) * 5.0f);
        }
    }

    // restore the old viewport (now full view and oF coords)
    ofPopView();
    //--


    //--
    // 3d view

    drawViewportOutline(viewport3D);

    // note the camera accepts the viewport as an argument
    // this is so that the camera can be aware of which viewport
    // it is acting on
    //
    // ofPushView() / ofPopView() are automatic
    camera.begin(viewport3D);
    ofDrawGrid(100);
    camera.end();
    //--


    ofDrawBitmapString("Press [space] to randomize viewports", 20, 20);
}
Esempio n. 26
0
void ofFbo::begin(bool setupScreen) {
	ofPushView();
	if(ofGetGLRenderer()){
		ofGetGLRenderer()->setCurrentFBO(this);
	}
	ofViewport(0, 0, getWidth(), getHeight(), false);
	if(setupScreen){
        ofOrientation orient = ofGetOrientation();
#ifdef TARGET_OF_IPHONE
        orient = OF_ORIENTATION_DEFAULT;
#endif
		ofSetupScreenPerspective(getWidth(), getHeight(), orient, false);
	}
	bind();
}
Esempio n. 27
0
//--------------------------------------------------------------
void ofxCubeMap::beginDrawingInto3D( GLuint _face )
{
	ofPushView();

	beginDrawingInto2D( _face );

	glMatrixMode( GL_PROJECTION );
	glLoadIdentity();

	glLoadMatrixf( getProjectionMatrix().getPtr() );

  	glMatrixMode( GL_MODELVIEW );
	ofPushMatrix();
	glLoadMatrixf( getLookAtMatrixForFace( _face ).getPtr() );

}
Esempio n. 28
0
//--------------------------------------------------------------
void ofxFileDialog::draw() {
	if(!m_active) {return;}
	
	// default size if not set
	if(m_width == 0 || m_height == 0) {
		resize(ofGetWidth(), ofGetHeight());
	}

	ofPushStyle();
	ofPushView();
		ofEnableAlphaBlending(); // for fontstash
		ofViewport(0, 0, m_width, m_height);
		ofFill();
	
		// font color
		s_font->setColor(m_settings->getTextColor(), m_settings->getAlpha());
		s_font->setShadowColor(m_settings->getTextShadowColor(), m_settings->getAlpha());
	
		// draw current path
		int pathWidth = s_font->stringWidth(m_path);
		if(pathWidth > m_visibleWidth) { // make sure right side is visible
			s_font->drawString(m_path, m_visibleWidth-pathWidth, s_charHeight);
		}
		else {
			s_font->drawString(m_path, 0, s_charHeight);
		}
	
		// indent and draw dialogs
		ofTranslate(s_charWidth*4, 0);
		switch(m_mode) {
			case SAVEAS:
				drawSaveAs();
				break;
			case OPEN:
				drawOpen();
				break;
			case NEWFOLDER:
				drawNewFolder();
				break;
		}
	
	ofPopView();
	ofPopStyle();

	// update animation timestamps
	updateTimestamps();
}
Esempio n. 29
0
//----------------------------------------
void ofCamera::begin(ofRectangle viewport) {
	if(!isActive) ofPushView();
	isActive = true;

	ofSetCoordHandedness(OF_RIGHT_HANDED);

	// autocalculate near/far clip planes if not set by user
	calcClipPlanes(viewport);

	ofSetMatrixMode(OF_MATRIX_PROJECTION);
	ofLoadIdentityMatrix();

	ofLoadMatrix( this->getProjectionMatrix(viewport) );

	ofSetMatrixMode(OF_MATRIX_MODELVIEW);
	ofLoadMatrix( ofMatrix4x4::getInverseOf(getGlobalTransformMatrix()) );
	ofViewport(viewport);
}
Esempio n. 30
0
//--------------------------------------------------------------
void ofApp::draw(){
	
	ofBackgroundGradient(100, 50);
	
	camera.begin();
	this->lineSet.updateIndexBuffer(this->shift);
	this->drawScene();
	this->cameraCursorCached = this->camera.getCursorWorld();
	this->drawCursor();
	camera.end();
	
	//--
	//draw zoomed
	//
	if (this->shift) {
		zoomed.begin();
		ofClear(0,0,0,255);
		ofPushView();
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		
		glScalef(10.0f, 10.0f, 1.0f);
		
		ofVec3f offset = this->camera.worldToCamera(this->camera.getCursorWorld());
		offset.z = 0.0f;
		ofTranslate(-offset);
		
		glMultMatrixf(camera.getProjectionMatrix().getPtr());
		
		glMatrixMode(GL_MODELVIEW);
		glLoadMatrixf(camera.getModelViewMatrix().getPtr());
		this->drawScene();
		this->drawCursor();
		ofPopView();
		zoomed.end();
		zoomed.draw(0, ofGetHeight(), zoomed.getWidth(), - zoomed.getHeight());
	}
	//
	//--
	
 	this->drawInstructions();
}