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

C++ ofxalembic::Reader类代码示例

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

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



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

示例1: update

//--------------------------------------------------------------
void testApp::update()
{
	float t = fmodf(ofGetElapsedTimef(), abc.getMaxTime());
	
	// update alemblic reader with time in sec
	abc.setTime(t);
}
开发者ID:hanasaan,项目名称:ofxAlembic,代码行数:8,代码来源:testApp.cpp


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


示例3: update

	void update()
	{
		float abc_range = (abc.getMaxTime() - abc.getMinTime());
		float t = fmodf(ofGetElapsedTimef(), abc_range) + abc.getMinTime();
		abc.setTime(t);
		
		abc.get("ClonerShape", mesh);
		
		updateMesh(mesh);
		
		light0.orbit(ofGetElapsedTimef() * 10, 0, 2000);
		light1.orbit(ofGetElapsedTimef() * -20, 60, 2000);
	}
开发者ID:satoruhiga,项目名称:ofws20014,代码行数:13,代码来源:ofApp.cpp


示例4: setup

//--------------------------------------------------------------
void testApp::setup()
{
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofBackground(0);
	
	string path = "sample.abc";
	
	// load allembic file
	abc.open(path);
	
	// show all drawable names
	abc.dumpNames();
}
开发者ID:hanasaan,项目名称:ofxAlembic,代码行数:15,代码来源:testApp.cpp


示例5: setup

	void setup()
	{
		ofSetFrameRate(60);
		ofSetVerticalSync(true);
		ofBackground(0);
		
		abc.open("sample.abc");
		
		abc.dumpNames();
		
		light0.setup();
		light0.setDiffuseColor(ofFloatColor(0.4, 0.4, 0.8));
		light1.setup();
		light1.setDiffuseColor(ofFloatColor(0.4, 0.8, 0.4));
	}
开发者ID:satoruhiga,项目名称:ofws20014,代码行数:15,代码来源:ofApp.cpp


示例6: 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);
}
开发者ID:hanasaan,项目名称:ofxAlembic,代码行数:45,代码来源:testApp.cpp


示例7: draw

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

	glPointSize(4);
	
	{
		ofMesh mesh;
		abc.get("/polymesh")->get(mesh);
		
		ofSetColor(255, 0, 0);
		mesh.draw();
	}

	{
		vector<ofVec3f> points;
		abc.get("/points")->get(points);
		
		ofSetColor(0, 255, 0);
		glBegin(GL_POINTS);
		for (int i = 0; i < points.size(); i++)
			glVertex3fv(points[i].getPtr());
		glEnd();
	}

	{
		vector<ofPolyline> curves;
		abc.get("/curves")->get(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);
}
开发者ID:Tonsty,项目名称:ofxAlembic,代码行数:43,代码来源:testApp.cpp


示例8: setup

//--------------------------------------------------------------
void testApp::setup()
{
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofBackground(0);
	glEnable(GL_DEPTH_TEST);
	
	string path = "perfume_global_site_003_sequence.abc";
	
	// load allembic file
	abc.open(path);
	
	// show all drawable names
	abc.dumpNames();

    // specular color, the highlight/shininess color //
	pointLight.setSpecularColor( ofColor(255.f, 255.f, 255.f));
    pointLight.setPosition(0, -100, 100);
    material.setShininess( 64 );
}
开发者ID:edy555,项目名称:ofxAlembic,代码行数:21,代码来源:testApp.cpp


示例9: draw

//--------------------------------------------------------------
void testApp::draw()
{
    ofEnableLighting();
    // the position of the light must be updated every frame,
    // call enable() so that it can update itself //
    pointLight.enable();
    material.begin();

	cam.begin();

	// get meshes and draw
	{
		ofMesh mesh;
		abc.get("/Aa-CHAN", mesh);
		ofSetColor(0, 0, 255);
		mesh.draw();
	}
	{
		ofMesh mesh;
		abc.get("/KASHIYUKA", mesh);
		ofSetColor(255, 0, 0);
		mesh.draw();
	}
	{
		ofMesh mesh;
		abc.get("/NOCCHi", mesh);
		ofSetColor(255, 255, 255);
		mesh.draw();
	}

	// or simply, abc.draw();

	cam.end();
	material.end();
	// turn off lighting //
    ofDisableLighting();
	
	ofSetColor(255);
	
	ofDrawBitmapString(ofToString(abc.getTime()) + "/" + ofToString(abc.getMaxTime()), 10, 20);
}
开发者ID:edy555,项目名称:ofxAlembic,代码行数:42,代码来源:testApp.cpp


示例10: setup

//--------------------------------------------------------------
void testApp::setup()
{
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofBackground(0);
	
	string path = "perfume_global_site_003_sequence.abc";
	
	abc.open(path);
	
	shader.watch("shader.vert", "shader.frag");
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:13,代码来源:testApp.cpp


示例11: setup

//--------------------------------------------------------------
void testApp::setup()
{
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofBackground(0);

	numTextured = 0;
	
	string path = "3DCursor_Alembic.abc";
	ofDisableArbTex();

	texture.loadImage("textSphere_cursor.png");

	// load allembic file
	abc.open(path);
	
	// show all drawable names
	abc.dumpNames();

	meshNames = abc.getNames();
}
开发者ID:andreasmuller,项目名称:ofxAlembic,代码行数:22,代码来源:testApp.cpp


示例12: setup

void ofApp::setup() {
	
    drawFaceBox = false;
	
    gui.setup("panel"); // most of the time you don't need a name but don't forget to call setup
    gui.add(adjustments.set("adjustments", ofPoint(0, 0, 0), -ofPoint(200,200,200), ofPoint(200,200,200)));
    gui.add(showWireframe.set("showWireframe", false));
    gui.add(showFilled.set("showFilled", false));
    gui.add(scaleFac.set("scaleFac", 1, 0.1, 2.0));
    gui.add(playback.set("playback", false));
    gui.add(playbackAudio.set("playbackAudio", false));
	gui.add(drawFaceBox.set("draw face box", false));
	
    gui.loadFromFile("adjustments.xml");
    

    //sndPlayer.loadSound("/Users/zachlieberman/Dropbox/+PopTech_Toyota_Footage/SH002_Craig_test/SH002_1-2.aif");
    //sndPlayer.setLoop(true);
    //sndPlayer.setVolume(0);
    //sndPlayer.play();
    

    bSaving = false;

    
#ifdef JAMES
	shotManager.footageBasePath = "/Volumes/CHOPPER/_ToyotaXpopTech_/GOLD_Footage/";
#else 
    shotManager.footageBasePath = "/Users/zachlieberman/Desktop/GOLD_Footage/";
#endif 
    
	shotManager.setup();

//	shotManager.loadShot("SH001", FDM); //jackie portrait
//	shotManager.loadShot("SH002", FDM); //craig portrait
    shotManager.loadShot("SH011", FDM); //matt portrait
	//NOT ALIGNED AFTER CUT -- NO EYES AFTER CUT
//	shotManager.loadShot("SH004", FDM); //craig scifi
//	shotManager.loadShot("SH005", FDM); //Jackie SMOG
//	shotManager.loadShot("SH006", FDM); //jackie "made fuel cells important to me"
//	shotManager.loadShot("SH007", FDM); //MATT "Innovative technology"
//	shotManager.loadShot("SH008", FDM); //JACKiE change the way communities
//	shotManager.loadShot("SH009", FDM); //JACKIE 'states, nations, the world'
//	shotManager.loadShot("SH010", FDM); //CRAIG mental models;
//shotManager.loadShot("SH011", FDM); //CRAIG "we did it"
//	shotManager.loadShot("SH011", FDM); //CRAIG "we did it"


    FDM.loadFrame(0, frame);            // load frame 0
    FDM.loadFrame(0, firstFrame);
    
    cout << FDM.numFrames << endl;
    
	ofSetVerticalSync(true);
	
	light.enable();
	light.setPosition(+500, +500, +500);
    
	string testSequenceFolder = dataPath + "aCam/";
    
	CCM.loadCalibration(
                        testSequenceFolder + "matrices/rgbCalib.yml",
                        testSequenceFolder + "matrices/depthCalib.yml",
                        testSequenceFolder + "matrices/rotationDepthToRGB.yml",
                        testSequenceFolder + "matrices/translationDepthToRGB.yml");
	
    int ppWidth = ofNextPow2(CCM.rgbCalibration.getDistortedIntrinsics().getImageSize().width);
    int ppHeight = ofNextPow2(CCM.rgbCalibration.getDistortedIntrinsics().getImageSize().height);
    
    
    targetFbo.allocate(CCM.rgbCalibration.getDistortedIntrinsics().getImageSize().width,
                       CCM.rgbCalibration.getDistortedIntrinsics().getImageSize().height,GL_RGBA32F);

   

    CM.CCM = CCM;
	CM.setup();
    
    

//    // save head and tranform
//    
//    //CCM.extrinsics
//    
////    ofxAlembic::Writer writer;
////    string path = "cam.abc";
////    writer.open(path, 24);
////
////    writer.addXform("/box", CCM.extrinsics);
////    //if (j == 0){
////        ofBoxPrimitive box;
////        box.set(40);
////        writer.addPolyMesh("/box/boxShape", box.getMesh());
////    //}
////
////        // draw the box of orientation using new alexmbic style
////        
////        
////    //}
//    
//.........这里部分代码省略.........
开发者ID:imclab,项目名称:fuelProduction,代码行数:101,代码来源:ofApp.cpp


示例13: update

//--------------------------------------------------------------
void testApp::update()
{
	float t = fmodf(ofGetElapsedTimef(), abc.getMaxTime());
	abc.setTime(t);
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:6,代码来源:testApp.cpp


示例14: exit

void testApp::exit()
{
	abc.close();
}
开发者ID:hanasaan,项目名称:ofxAlembic,代码行数:4,代码来源:testApp.cpp


示例15: draw

void ofApp::draw(){
    
    
#ifndef NO_ALEMBIC
    float t = currentFrame / 24.0;
    if (t > abc.getMaxTime()){
        t = abc.getMaxTime();
    }
    abc.setTime(t);
#endif
    
	targetFbo.begin();
    ofViewport(ofRectangle(0,0,1920, 1080));
    
    
	ofClear(0,0,0,0);
    glClear(GL_DEPTH);
    
    
    CM.cameraStart();
    
    
    CM.drawCameraInternals(frame.img, frame.mask, backgroundPlate);

   
    ofPushMatrix();
        ofScale(-scaleFac,scaleFac,scaleFac);
        ofTranslate(ofVec3f(-adjustments->x,adjustments->y,adjustments->z));
        
        drawMesh(frame.head, ofColor::darkGoldenRod);
        drawMesh(frame.rightEye, ofColor::red);
        drawMesh(frame.leftEye, ofColor::blue);
        
        ofPushStyle();
        
        //ofScale(10,10,10);
        ofNoFill();
        ofNode n;
        FDM.getOrientation(frame, n);
        n.draw();
        ofSetColor(255);
        ofMatrix4x4 mat = n.getGlobalTransformMatrix();
        ofMultMatrix(mat);
		if(drawFaceBox){
			ofBoxPrimitive(100, 100, 100).draw();
		}

        
        ofPopStyle();
	ofPopMatrix();

    
    ofPolyline curve;

#ifndef NO_ALEMBIC
    vector<ofPolyline> curvesMe;
    abc.get("SplineSpline", curvesMe);
#endif
    
    
    
    
    
    ofSetColor(ofColor::white);

	////////////////
    
	ofDisableDepthTest();
    CM.cameraEnd();
    ofEnableAlphaBlending();
	targetFbo.end();
    targetFbo.getTextureReference().drawSubsection(0, 0, 1920/2, 1080/2, 0, targetFbo.getHeight() - 1080, 1920, 1080);
    gui.draw();
    
    
    //FDM.maskStandIn.draw(mouseX, mouseY);
}
开发者ID:imclab,项目名称:fuelProduction,代码行数:77,代码来源:ofApp.cpp


示例16: setup

//--------------------------------------------------------------
void testApp::setup()
{
	ofSetVerticalSync(true);
	ofSetFrameRate(60);
	ofBackground(0);
	
	string path = "sample.abc";
	
	{
		ofxAlembic::Writer writer;
		
		if (writer.open(path, 30)) // export at 30fps
		{
			for (int f = 0; f < 60; f++)
			{
				// points
				{
					vector<ofVec3f> points;
					
					for (int i = 0; i < 10; i++)
					{
						ofVec3f p;
						p.x = ofRandom(-300, 300);
						p.y = ofRandom(-300, 300);
						p.z = ofRandom(-300, 300);
						points.push_back(p);
					}
					
					writer.addPoints("/points", points);
				}
				
				// curves
				{
					vector<ofPolyline> curves;
					
					for (int i = 0; i < 10; i++)
					{
						ofPolyline poly;
						
						for (int n = 0; n < 100; n++)
						{
							ofVec3f v;
							v.x = ofSignedNoise(1, 0, 0, n * 0.01 + f * 10 + i) * 300;
							v.y = ofSignedNoise(0, 1, 0, n * 0.01 + f * 10 + i) * 300;
							v.z = ofSignedNoise(0, 0, 1, n * 0.01 + f * 10 + i) * 300;
							poly.addVertex(v);
						}
						
						curves.push_back(poly);
					}
					
					writer.addCurves("/curves", curves);
				}
				
				// mesh
				{
					ofMesh mesh;
					
					int num = ofRandom(1, 10) * 3;
					
					for (int i = 0; i < num; i++)
					{
						ofVec3f p;
						p.x = ofRandom(-300, 300);
						p.y = ofRandom(-300, 300);
						p.z = ofRandom(-300, 300);
						mesh.addVertex(p);
					}
					
					writer.addPolyMesh("/polymesh", mesh);
				}
			}
		}
	}
	
	abc.open(path);
	
	abc.dumpNames();
}
开发者ID:Tonsty,项目名称:ofxAlembic,代码行数:80,代码来源:testApp.cpp


示例17: draw

//--------------------------------------------------------------
void testApp::draw()
{
	ofFill();

	cam.begin();
	/*
	glPointSize(4);
	
	// get meshes and draw
	
	{
		ofMesh mesh;
		abc.get("/Cloner/ClonerShape", mesh);
		
		ofSetColor(255, 0, 0);
		mesh.draw();
	}

	{
		vector<ofVec3f> points;
		abc.get("/Emitter/EmitterCloud", points);
		
		ofSetColor(0, 255, 0);
		glBegin(GL_POINTS);
		for (int i = 0; i < points.size(); i++)
			glVertex3fv(points[i].getPtr());
		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();
	
	//ofMesh mesh;
	//abc.get("/Null/Sphere/SphereShape", mesh);
	//cout << mesh.getNumNormals() << endl;

	//ofLight l;
	//l.setPosition(mesh.getCentroid() + ofVec3f(0,0,0));
	//l.enable();
	//ofSetColor(ofColor::white);
	//ofSetColor(255, 0, 0);
	/*
	ofEnableDepthTest();
	texture.getTextureReference().bind();
//	mesh.draw();
	abc.draw();
	texture.getTextureReference().unbind();
	ofDisableDepthTest();
	*/
	//glCullFace( GL_FRONT );

	//abc.draw();

	ofEnableDepthTest();

	glEnable( GL_CULL_FACE );

	glCullFace( GL_BACK );
	//*

	ofSetColor( 255, 255, 255, 255.0 * 0.5 );

	for( int i=0; i<meshNames.size(); i++ ){
		ofxAlembic::IGeom *geo = abc.get( meshNames[i] );
		if( i == numTextured ){
			geo->drawTextured( &texture );
		}else{
			geo->draw();
		}
	}
	//*/
	glCullFace( GL_FRONT );
	ofSetColor( 255, 255, 255, 255.0 * 0.5 );
	//*
	for( int i=0; i<meshNames.size(); i++ ){
		ofxAlembic::IGeom *geo = abc.get( meshNames[i] );
		if( i == numTextured ){
			geo->drawTextured( &texture );
		}else{
			geo->draw();
		}
	}
	//*/
	glDisable( GL_CULL_FACE );

	cam.end();
	
	ofSetColor(255);
	
//.........这里部分代码省略.........
开发者ID:andreasmuller,项目名称:ofxAlembic,代码行数:101,代码来源:testApp.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ oglplus::Context类代码示例发布时间:2022-05-31
下一篇:
C++ ofx::ImageEffectDescriptor类代码示例发布时间: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