• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ofEasyCam类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了ofEasyCam类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: drawPoint

void BufferCont::drawPoint(ofRectangle &view, ofEasyCam & cam, vector <ofVec3f> &data){

	m_vbo.setVertexData(&data[0], data.size(), GL_STATIC_DRAW);
	m_vbo.setNormalData(&m_sizes.front()[0], m_sizes.front().size(), GL_STATIC_DRAW);
	m_vbo.setColorData(&m_indiColor.front()[0], m_indiColor.front().size(), GL_STATIC_DRAW);
	glDepthMask(GL_FALSE);
	//ofEnableBlendMode(OF_BLENDMODE_ADD);
	ofEnablePointSprites();

	m_shader.begin();
	cam.begin(view);
	m_texture.bind();
	m_vbo.draw(GL_POINTS, 0, data.size());
	m_texture.unbind();
	cam.end();
	m_shader.end();

	ofDisablePointSprites();
	//ofDisableBlendMode();
	glDepthMask(GL_TRUE);
}
开发者ID:benmyb,项目名称:OFEC_v0.4.2,代码行数:21,代码来源:BufferCont.cpp


示例3: 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


示例4: 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


示例5: draw

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


示例6: draw

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


示例7: draw

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


示例8: 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


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: update

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


示例14: 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


示例15: 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


示例16: 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


示例17: update

//--------------------------------------------------------------
void testApp::update()
{
	sys.get()->setCameraPosition(ofxSPK::toSPK(cam.getPosition()));
	sys.update();

	em.setPosition(ofSignedNoise(1, 0, 0, ofGetElapsedTimef() * 0.5) * 1400,
				   ofSignedNoise(0, 1, 0, ofGetElapsedTimef() * 0.5) * 1400,
				   ofSignedNoise(0, 0, 1, ofGetElapsedTimef() * 0.5) * 1400);

	em.tilt(0.1);
	em.pan(15);
	em.roll(-3.5);

	em.update();

	mod.update();
	mod2.update();

	mod.setPosition(ofSignedNoise(100, 0, 0, ofGetElapsedTimef() * 0.1) * 1000,
				   ofSignedNoise(0, 100, 0, ofGetElapsedTimef() * 0.1) * 1000,
				   ofSignedNoise(0, 0, 100, ofGetElapsedTimef() * 0.1) * 1000);

	mod2.setPosition(ofSignedNoise(500, 0, 0, ofGetElapsedTimef() * 0.5) * 200,
					ofSignedNoise(0, 500, 0, ofGetElapsedTimef() * 0.5) * 200,
					ofSignedNoise(0, 0, 500, ofGetElapsedTimef() * 0.5) * 200);

	ofSetWindowTitle(ofToString(ofGetFrameRate()));
}
开发者ID:egelor,项目名称:ofxSPK,代码行数:29,代码来源:testApp.cpp


示例18: trackpad_magnify

void trackpad_magnify(float magnification) {
	checkGesture(TRACKPAD_MAGNIFY);
	
	magnifyVelocity = magnification;
	magnifyPosition += magnifyVelocity;
	
	cam = camStart;
	cam.dolly(magnifyScale * -magnifyPosition);
}
开发者ID:UIKit0,项目名称:RAMDanceToolkit,代码行数:9,代码来源:testApp.cpp


示例19: trackpad_rotate

void trackpad_rotate(float rotation) {
	checkGesture(TRACKPAD_ROTATE);
	
	rotationVelocity = rotation;
	rotationPosition += rotationVelocity;
	
	cam = camStart;
	cam.pan(-rotationPosition); // should be orbit instead of pan
}
开发者ID:UIKit0,项目名称:RAMDanceToolkit,代码行数:9,代码来源:testApp.cpp


示例20: setup

		void setup() {
            ofSetFrameRate(60);
            ofSetVerticalSync(true);

            dw=ofGetScreenWidth();
			dh=ofGetScreenHeight();
			ofDisableArbTex();
            fbo.allocate(dw,dh);
            shader.load("shaders/fluid.vert","shaders/fluid.frag");

			camera.setFarClip(100000);
			camera.setNearClip(.1);
            if ( !allocate_data () ){
                    cout<<"error allocate!"<<endl;
                    exit();
			}
            clear_data ();

			gui.setup();
            gui.setPosition(ofPoint(10,10));

			gui.add(size_cube.setup("size box", 100.0f,0.0f,255.0f));
            gui.add(dvel.setup("draw velocity", true));
            gui.add(dden.setup("draw density",  false));

			gui.add(TaddSource.setup("add source",false));
			gui.add(Bclear.setup("clear source",false));

			gui.add(addX.setup("add x",false));
			gui.add(addY.setup("add y",false));
			gui.add(addZ.setup("add z",false));
			gui.add(dt.setup("time delta", 0.9f,0.0f,25.0f));
			gui.add(diff.setup("diffuse",  0.0f,0.0f,25.0f));
			gui.add(visc.setup("viscosity", 0.0f,0.0f,25.0f));
			gui.add(force.setup("add force",30.0f,0.0f,60.0f));
			gui.add(source.setup("density", 200.0f,0.0f,600.0f));
			gui.add(source_alpha.setup("alpha",0.05,0.0,1.0));
			gui.add(drawAbstacle.setup("draw abstacle",false));
			gui.add(drawAxis.setup("draw Axis",true));

			gui.add(sourcePosX.setup("source posX", 0,-10,SIZE));
			gui.add(sourcePosY.setup("source posY", 0,-10,SIZE));
			gui.add(sourcePosZ.setup("source posZ", 0,-10,SIZE));
		}
开发者ID:kashimAstro,项目名称:3DFlare,代码行数:44,代码来源:main.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ofFbo类代码示例发布时间:2022-05-31
下一篇:
C++ ofColor类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap