本文整理汇总了C++中ofEasyCam::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ofEasyCam::end方法的具体用法?C++ ofEasyCam::end怎么用?C++ ofEasyCam::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofEasyCam
的用法示例。
在下文中一共展示了ofEasyCam::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
//--------------------------------------------------------------
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);
}
示例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();
}
示例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);
}
示例4: draw
void draw()
{
ofEnableDepthTest();
cam.begin();
mesh.draw();
cam.end();
}
示例5: draw
//--------------------------------------------------------------
void testApp::draw()
{
cam.begin();
root.draw();
cam.end();
}
示例6: draw
void draw()
{
ofClear(0);
cam.begin();
neuron.debugDraw();
ofDrawAxis(100);
cam.end();
}
示例7: draw
//--------------------------------------------------------------
void ofApp::draw(){
cam.begin();
for (int i = 0; i < scene.getMeshes().size(); i++){
scene.getMeshes()[i]->drawWireframe();
}
cam.end();
}
示例8: 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();
}
示例9: draw
void draw() {
ofBackground(0);
cam.begin();
ofSetLineWidth(2);
ofSetColor(ofColor::red, 16);
mesh.drawWireframe();
glPointSize(4);
ofSetColor(ofColor::white);
controlPoints.draw();
cam.end();
}
示例10: draw
void draw()
{
ofEnableDepthTest();
cam.begin();
light0.enable();
light1.enable();
ofScale(0.3, 0.3, 0.3);
mesh.draw();
cam.end();
}
示例11: 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);
}
示例12: 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();
}
}
示例13: draw
//--------------------------------------------------------------
void testApp::draw()
{
ofEnableBlendMode(OF_BLENDMODE_ADD);
cam.begin();
ofEnableAlphaBlending();
sys.draw();
em.draw();
mod.draw();
mod2.draw();
cam.end();
}
示例14: draw
void draw() {
ofBackgroundGradient(64, 0);
if(reflect || sreflect)
env.draw(0,0,env.getWidth()/8,env.getHeight()/8);
if(sreflect)
env1.draw(env.getWidth()/8,0,env1.getWidth()/8,env1.getHeight()/8);
ofEnableDepthTest();
cam.begin();
shader.begin();
if(sreflect){
// shader.setUniform3f("CameraPos",cam.getGlobalPosition().x, cam.getGlobalPosition().y, cam.getGlobalPosition().z);
// shader.setUniformMatrix4f("ModelWorld4x4",cam.getGlobalTransformMatrix());
shader.setUniform3f("CameraPos",cam.getPosition().x, cam.getPosition().y, cam.getPosition().z);
shader.setUniformMatrix4f("ModelWorld4x4",cam.getModelViewMatrix());//getLocalTransformMatrix());
shader.setUniformTexture("frontMap", env,1);
shader.setUniformTexture("backMap", env1,2);
}
if(reflect){
shader.setUniformTexture("colorMap",env1,1);
shader.setUniformTexture("envMap", env,2);
}else if(sreflect==false){
shader.setUniformTexture("texture", img, 1);
shader.setUniform1f("time", ofGetElapsedTimef());
}
if(cube)
ofDrawBox(200);
else {
ofTranslate(0,-150,0);
ofRotateX(-90);
ofRotateY(-90);
ofRotateZ(45);
model.drawFaces();
}
shader.end();
cam.end();
ofDisableDepthTest();
ofDrawBitmapString(ofToString((int) ofGetFrameRate()), 10, 20);
}
示例15: draw
//--------------------------------------------------------------
void testApp::draw()
{
cam.begin();
glPointSize(4);
// get meshes and draw
{
ofMesh mesh;
abc.get("/Cloner/ClonerShape", mesh);
ofSetColor(255, 0, 0);
mesh.draw();
}
{
std::vector<glm::vec3> points;
abc.get("/Emitter/EmitterCloud", points);
ofSetColor(0, 255, 0);
glBegin(GL_POINTS);
for (int i = 0; i < points.size(); i++)
glVertex3fv(&points[i].x);
glEnd();
}
{
vector<ofPolyline> curves;
abc.get("/Tracer/TracerSpline", curves);
ofSetColor(0, 0, 255);
for (int i = 0; i < curves.size(); i++)
curves[i].draw();
}
// or simply, abc.draw();
cam.end();
ofSetColor(255);
ofDrawBitmapString(ofToString(abc.getTime()) + "/" + ofToString(abc.getMaxTime()), 10, 20);
}