コード例 #1
0
ファイル: myAmeManager.cpp プロジェクト: wasawi/a-me
//--------------------------------------------------------------
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);
	}
	
}
コード例 #2
0
void ofxFenster::draw() {
	if(isDestroyed)
		return;

	setActive();
	ofPoint size=getWindowSize();

	if ( bClearAuto == true) {
		ofClear(bgColor.r, bgColor.g, bgColor.b, bgColor.a);
	}
	ofViewport(0, 0, size.x, size.y);
	ofSetupScreenPerspective(size.x, size.y, OF_ORIENTATION_DEFAULT);

	ofGetWidth();

	ofNotifyEvent(events.draw, voidEventArgs);

	ofxFensterListenerList::iterator it=listeners.begin();
	while(it!=listeners.end()) {
		(*it)->draw(this);
		(*it)->isUpdated=false;
		++it;
	}
	win->swapBuffers();
	return;
}
コード例 #3
0
void ofFbo::begin() {
	bind();
	ofPushView();
	if(ofGetGLRenderer()){
		ofGetGLRenderer()->setCurrentFBO(this);
	}
	ofViewport(0, 0, getWidth(), getHeight(), false);
	ofSetupScreenPerspective(getWidth(), getHeight(), ofGetOrientation(), false);
}
コード例 #4
0
ファイル: cyrilApp.cpp プロジェクト: radiodario/cyril
void cyrilApp::toggleOrtho(void * _o) {
  ((cyrilApp *)_o)->isOrtho = !((cyrilApp *)_o)->isOrtho;
  if (((cyrilApp *)_o)->isOrtho) {
    //ofSetupScreenOrtho();
    ofSetupScreenOrtho(1200,1200,0,10);
  }
  else {
    ofSetupScreenPerspective(1200,1200,0,0,0);
  }
}
コード例 #5
0
ファイル: ofFbo.cpp プロジェクト: FlavioFalcao/openFrameworks
void ofFbo::begin(bool setupScreen) {
	if(!bIsAllocated) return;
	ofPushView();
	if(ofGetGLRenderer()){
		ofGetGLRenderer()->setCurrentFBO(this);
	}
	ofViewport();
	if(setupScreen){
		ofSetupScreenPerspective();
	}
	bind();
}
コード例 #6
0
 static int lua_graphics_set_perspective(lua_State *L) {
     float w = lua_isnumber(L, 1) ? lua_tonumber(L, 1): ofGetWidth();
     float h = lua_isnumber(L, 2) ? lua_tonumber(L, 2): ofGetHeight();
     
     float nearDist = lua_isnumber(L, 3) ? lua_tonumber(L, 3) : -1;
     float farDist = lua_isnumber(L, 4) ? lua_tonumber(L, 4) : -1;
     
     float fov = lua_isnumber(L, 5) ? lua_tonumber(L, 5) : -1;
     
     ofSetupScreenPerspective(w, h, OF_ORIENTATION_UNKNOWN, true, fov, nearDist, farDist);
     
     return 0;
 }
コード例 #7
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();
}
コード例 #8
0
ファイル: view.cpp プロジェクト: a2mSystemes/ofxLibRocket
void View::draw()
{
	ofPushView();
	ofViewport(getBounds());
	
	ofSetupScreenPerspective(getWidth(), getHeight());
	ofNoFill();
	ofSetColor(getColor());
	
	ofPushMatrix();
	ofTranslate(getWidth()*.5, getHeight()*.5, 0);
	ofTranslate(offset);
	ofRotateX(ofNoise(rotX)*360);
	ofRotateY(ofNoise(rotY)*360);
	float s = (ofNoise(scale)-.5)*30;
	ofScale(s, s, s);
	ofBox(200);
	
	ofPopMatrix();
	ofPopView();
}
コード例 #9
0
ファイル: ofFbo.cpp プロジェクト: aleonard/KinectWorkshop
void ofFbo::begin() {
	bind();
	ofPushView();
	ofViewport(0, 0, getWidth(), getHeight(), false);
	ofSetupScreenPerspective(getWidth(), getHeight(), ofGetOrientation(), false);
}
コード例 #10
0
void testApp::standardDraw() {
	
	//aberration = ofMap(mouseX, 0, targetWidth, 0, 1);
	//pointBrightness = ofMap(mouseY, 0, targetHeight(), 0, 1);
	
	//DO NOT F-ING DELETE THIS MOFOS :) 
	ofEnableAlphaBlending();
	
	chroma.begin();
	float fov = panel.getValueF("fov");
	float dist = connexionCamera.getZoom();
	ofSetupScreenPerspective(ofGetWidth(), ofGetHeight(), OF_ORIENTATION_DEFAULT, false, fov, dist / 1000.f, dist * 1000.f);
	
	connexionCamera.minZoom = panel.getValueF("minZoom");
	connexionCamera.maxZoom = panel.getValueF("maxZoom");
	
	ofPushStyle();

	if( ofGetFrameNum() < 20 || !panel.getValueB("do_trails") ){
		ofClear(0, 0, 0, 255);
	}else{
		ofSetColor(0, 0, 0, ofMap(connexionCamera.quaternionChangeAmount, 0,panel.getValueF("fboScale"), 255,100, true));	
		ofFill();
		ofRect(0, 0, targetWidth, targetHeight);
	}

	ofPopStyle();

	ofPushMatrix();
	
	connexionCamera.draw(mouseX, mouseY, !panel.getValueB("bFreezeParticles"));

	glDisable(GL_DEPTH_TEST);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE);
	glEnable(GL_ALPHA_TEST);
	glAlphaFunc(GL_GREATER, 0);
	
	// super helpful: http://pmviewer.sourceforge.net/method.php
	glEnable(GL_POINT_SMOOTH);
	glEnable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB);
	
	dofShader.begin();
	
	float rgbBrightness = panel.getValueF("rgbBrightness");
	
	dofShader.setUniform1f("focusDistance", (panel.getValueB("smartFocalPlane") ? connexionCamera.getZoom() : 0) + panel.getValueF("focus_offset"));
	dofShader.setUniform1f("aperture", aperture);
	dofShader.setUniform1f("pointBrightness", pointBrightness);
	dofShader.setUniform1f("rgbBrightness", rgbBrightness);
	dofShader.setUniform1f("maxPointSize", panel.getValueF("maxPointSize"));
	

	if (panel.getValueB("bDrawParticles")){
		glPushMatrix();
		glScalef(1 / frameScaleFactor, 1 / frameScaleFactor, 1 / frameScaleFactor);
		PS.drawAll();
		glPopMatrix();
	}

	dofShader.end();
	
	float sphereSize = 10000;
	sphereShader.begin();
	
	sphereShader.setUniform1f("alpha", panel.getValueF("sphere_alpha"));
	sphereShader.setUniform1f("redScale", panel.getValueF("sphere_red"));
	sphereShader.setUniform1f("greenScale", panel.getValueF("sphere_green"));
	sphereShader.setUniform1f("blueScale", panel.getValueF("sphere_blue"));
	
	
	glColor4f(1, 1, 1, panel.getValueF("sphere_alpha"));
	ofFill();
	ofRotateX(-90);
	ofSphere(sphereSize);
	sphereShader.end();
	
	ofPopMatrix();
	
	// clear the alpha on the fbo
	glColorMask(0, 0, 0, 1);
	glClearColor(0, 0, 0, 1);
	glClear(GL_COLOR_BUFFER_BIT);
	glColorMask(1, 1, 1, 1);

	chroma.end();
	
	drawWithAberration();
	
	SP.draw();
}
コード例 #11
0
void ofCairoRenderer::setupScreen(){
	if(!surface || !cr) return;

	ofSetupScreenPerspective();	// assume defaults
}