本文整理汇总了C++中ofxalembic::Reader类的典型用法代码示例。如果您正苦于以下问题:C++ Reader类的具体用法?C++ Reader怎么用?C++ Reader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Reader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//--------------------------------------------------------------
void testApp::update()
{
float t = fmodf(ofGetElapsedTimef(), abc.getMaxTime());
// update alemblic reader with time in sec
abc.setTime(t);
}
示例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);
}
示例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);
}
示例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();
}
示例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));
}
示例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);
}
示例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);
}
示例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 );
}
示例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);
}
示例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");
}
示例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();
}
示例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
////
////
//// //}
//
//.........这里部分代码省略.........
示例13: update
//--------------------------------------------------------------
void testApp::update()
{
float t = fmodf(ofGetElapsedTimef(), abc.getMaxTime());
abc.setTime(t);
}
示例14: exit
void testApp::exit()
{
abc.close();
}
示例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);
}