当前位置: 首页>>代码示例>>C++>>正文


C++ ofEasyCam类代码示例

本文整理汇总了C++中ofEasyCam的典型用法代码示例。如果您正苦于以下问题:C++ ofEasyCam类的具体用法?C++ ofEasyCam怎么用?C++ ofEasyCam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ofEasyCam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ofBackgroundGradient

//--------------------------------------------------------------
void testApp::draw() {
    ofBackgroundGradient(ofColor(50), ofColor(0));
    // draw from the live kinect
//    ofSetColor(255);
//    kinect.drawDepth(10, 10, 400, 300);
//    kinect.draw(420, 10, 400, 300);

    
    glEnable(GL_DEPTH_TEST);
    static ofEasyCam cam;
    cam.begin();
    ofScale(1, -1);
    ofTranslate(-320, -240);
    
    ofSetColor(255);
    mesh.drawFaces();

//    glPointSize(10);
//    mesh.drawVertices();
    
    cam.end();
    
    ofSetColor(0);
    ofDrawBitmapString(ofToString(ofGetFrameRate()), 20, 20);
}
开发者ID:daanvanhasselt,项目名称:kinect_mesh,代码行数:26,代码来源:testApp.cpp

示例2: draw

	void draw()
	{
		ofEnableDepthTest();
		
		cam.begin();
		
		ofDisableLighting();
		cube->draw(5000);
		
		cube->enable();
		cube->bind();
		{
			light.enable();
			light.setAmbientColor(ofColor(50, 50, 50));
			
			float t = ofGetElapsedTimef() * 0.5;
			light.setPosition(ofSignedNoise(1, 0, 0, t) * 2000,
							  ofSignedNoise(0, 1, 0, t) * 2000,
							  ofSignedNoise(0, 0, 1, t) * 2000);

			ofDrawSphere(0, 0, 0, 200);
			
			light.disable();
		}
		cube->unbind();
		cube->disable();
		
		cam.end();
	}
开发者ID:satoruhiga,项目名称:ofxOpenGLPrimitives,代码行数:29,代码来源:ofApp.cpp

示例3: draw

//--------------------------------------------------------------
void testApp::draw()
{
    shader.begin();
    shader.setUniform1f("elapsedTime", ofGetElapsedTimef());
    shader.setUniform2f("mouse", mouseX, mouseY);
    shader.setUniform2f("resolution", ofGetWindowWidth(), ofGetWindowHeight());
    shader.end();
    
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
	
	ofEnableAlphaBlending();
    
	cam.begin();

    shader.begin();

	for (int i = 0; i < abc.size(); i++)
	{
		ofMesh mesh;
		if (abc.get(i, mesh))
		{
			ofSetColor(255);
			mesh.draw();
			// mesh.drawWireframe();
		}
	}

    shader.end();

	cam.end();
    
    glDisable(GL_DEPTH_TEST);
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:36,代码来源:testApp.cpp

示例4: draw

	void draw()
	{
		ofEnableDepthTest();
		
		cam.begin();
		mesh.draw();
		cam.end();
	}
开发者ID:satoruhiga,项目名称:ofws20014,代码行数:8,代码来源:ofApp.cpp

示例5: draw

//--------------------------------------------------------------
void testApp::draw()
{
	cam.begin();
	
	root.draw();
	
	cam.end();
}
开发者ID:alexeyroudenko,项目名称:ofxInteractivePrimitives,代码行数:9,代码来源:testApp.cpp

示例6: draw

 void draw()
 {
     ofClear(0);
     cam.begin();
     neuron.debugDraw();
     ofDrawAxis(100);
     cam.end();
 }
开发者ID:hanasaan,项目名称:ofxPerceptionNeuron,代码行数:8,代码来源:ofApp.cpp

示例7: draw

//--------------------------------------------------------------
void ofApp::draw(){

    
    cam.begin();
    for (int i = 0; i < scene.getMeshes().size(); i++){
        scene.getMeshes()[i]->drawWireframe();
    }
    cam.end();
}
开发者ID:ofZach,项目名称:fuelWork,代码行数:10,代码来源:ofApp.cpp

示例8: trackpad_mouse_scroll

void trackpad_mouse_scroll(float delta_x, float delta_y) {
	checkGesture(TRACKPAD_SCROLL);
	
	scrollVelocity.set(delta_x, delta_y);
	scrollPosition += scrollVelocity;
	
	cam = camStart;
	cam.truck(scrollScale * scrollPosition.x);
	cam.boom(scrollScale * -scrollPosition.y);
}
开发者ID:UIKit0,项目名称:RAMDanceToolkit,代码行数:10,代码来源:testApp.cpp

示例9: draw

    void draw() {
        ofBackground(100);
        cam.begin();
        ofSetColor(ofRandom(255), ofRandom(255),ofRandom(255));
        ofDrawBox(0, 0, 0, 200, 200, 200);
        ofTranslate(-128, -128, -128);
        mesh.draw();
        cam.end();

    }
开发者ID:nimabeh,项目名称:CCLab_oF_Final,代码行数:10,代码来源:main.cpp

示例10: draw

	void draw() {
		ofBackground(0);
		cam.begin();
		ofSetLineWidth(2);
		ofSetColor(ofColor::red, 16);
		mesh.drawWireframe();
		glPointSize(4);
		ofSetColor(ofColor::white);
		controlPoints.draw();
		cam.end();
	}
开发者ID:YCAMInterlab,项目名称:mapamok,代码行数:11,代码来源:main.cpp

示例11: draw

	void draw()
	{
		ofEnableDepthTest();
		
		cam.begin();
		light0.enable();
		light1.enable();

		ofScale(0.3, 0.3, 0.3);
		mesh.draw();
		cam.end();
	}
开发者ID:satoruhiga,项目名称:ofws20014,代码行数:12,代码来源:ofApp.cpp

示例12: update

//--------------------------------------------------------------
void testApp::update()
{
	root.update();
	
	if (root.hasFocusObject())
	{
		cam.disableMouseInput();
	}
	else
	{
		cam.enableMouseInput();
	}
}
开发者ID:alexeyroudenko,项目名称:ofxInteractivePrimitives,代码行数:14,代码来源:testApp.cpp

示例13: draw

//--------------------------------------------------------------
void testApp::draw(){
	ofBackgroundGradient(ofColor(64), ofColor(0));
	
	ofSetColor(255);
	ofDrawBitmapString("rotate: " + ofToString(rotationPosition), 10, 20);
	ofDrawBitmapString("swipe: " + ofToString(swipePosition), 10, 40);
	ofDrawBitmapString("magnify: " + ofToString(magnifyPosition), 10, 60);
	ofDrawBitmapString("scroll: " + ofToString(scrollPosition), 10, 80);
	ofDrawBitmapString("position: " + ofToString(mousePosition), 10, 100);
	cam.begin();
	
	ofPushMatrix();
	ofTranslate(0, -180, 0);
	ofDrawGrid(1000, 40, false, false, true, false);
	ofPopMatrix();
	
	ofSetColor(ofColor::gray);	
	mesh.drawWireframe();
	
	glPointSize(2);
	ofSetColor(ofColor::white);
	mesh.drawVertices();
	cam.end();
	
	int n = mesh.getNumVertices();
	float nearestDistance = 0;
	ofVec2f nearestVertex;
	int nearestIndex;
	ofVec2f mouse(mouseX, mouseY);
	for(int i = 0; i < n; i++) {
		ofVec3f cur = cam.worldToScreen(mesh.getVertex(i));
		float distance = cur.distance(mouse);
		if(i == 0 || distance < nearestDistance) {
			nearestDistance = distance;
			nearestVertex = cur;
			nearestIndex = i;
		}
	}
	
	ofSetColor(ofColor::gray);
	ofLine(nearestVertex, mouse);
	
	ofNoFill();
	ofSetColor(ofColor::yellow);
	ofSetLineWidth(2);
	ofCircle(nearestVertex, 4);
	ofSetLineWidth(1);
	
	ofVec2f offset(10, -10);
	ofDrawBitmapStringHighlight(ofToString(nearestIndex), mouse + offset);
}
开发者ID:UIKit0,项目名称:RAMDanceToolkit,代码行数:52,代码来源:testApp.cpp

示例14: draw

//--------------------------------------------------------------
void testApp::draw(){
    
   
    //draw the fbos directly
    if (drawFbos) {
        //draw fbo1 contents in the top left
        ofPushMatrix();
        ofTranslate(0, 0);
        fbo1.draw(0, 0);
        ofPopMatrix();

        //draw fbo2 contents in the underneath it
        ofPushMatrix();
        ofTranslate(0, ofGetHeight()/2.0);
        //here we pass the size arguments as well, so oF will scale it to fit
        fbo2.draw(0, 0, ofGetWidth()/2.0, ofGetHeight()/2.0);
        ofPopMatrix();

        //draw main fbo
        ofPushMatrix();
        ofTranslate(ofGetWidth()/2.0, 0);
        Mainfbo.draw(0,0);
        ofPopMatrix();
        
        //Pointeur souris
        ofFill();
        ofSetColor(255, 0, 0);
        ofSphere(ofGetMouseX(), ofGetMouseY(), 5);
        
        //draw some borders
        ofSetColor(255);
        ofSetLineWidth(3);
        ofLine(ofGetWidth()/2.0, 0, ofGetWidth()/2.0, ofGetHeight());
        ofLine(0, ofGetHeight()/2.0, ofGetWidth()/2.0, ofGetHeight()/2.0);
    } else {
        
        //or you can use getTextureReference() and bind the fbo contents
        //to use as a texture.
        //you will need texture coordinates set in your mesh for this to work

        ofClear(30);
        cam.begin();
        Mainfbo.getTextureReference().bind();
        mesh1.draw();
        Mainfbo.getTextureReference().unbind();
        cam.end();

    }
}
开发者ID:MrMDeluxe,项目名称:generative,代码行数:50,代码来源:testApp.cpp

示例15: draw

//--------------------------------------------------------------
void testApp::draw()
{
	ofEnableBlendMode(OF_BLENDMODE_ADD);
	
	cam.begin();

	ofEnableAlphaBlending();
	sys.draw();

	em.draw();
	
	mod.draw();
	mod2.draw();

	cam.end();
}
开发者ID:egelor,项目名称:ofxSPK,代码行数:17,代码来源:testApp.cpp


注:本文中的ofEasyCam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。