diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-04-06 00:00:16 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-04-06 00:00:16 +0100 |
| commit | adc1fe0182495151eba174f7ab5b99a900e10b5e (patch) | |
| tree | 2b7baf06b652f8191d999ce10c1a1fb1ac1137c4 /morpher/src/testApp.cpp | |
| parent | 13efc34b839db4f16fcfb4ea0aa3f768f144cd65 (diff) | |
changed morphmesh to use associative keys for targets
Diffstat (limited to 'morpher/src/testApp.cpp')
| -rw-r--r-- | morpher/src/testApp.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/morpher/src/testApp.cpp b/morpher/src/testApp.cpp index 3b5779e..a55ee13 100644 --- a/morpher/src/testApp.cpp +++ b/morpher/src/testApp.cpp @@ -4,16 +4,16 @@ void testApp::setup(){ mesh=morphmesh(); //mesh.loadfile("Bird-test1.xml"); - if (mesh.loadfile("Bird-test.xml")) printf("mesh loaded with %i vertices, %i face indices, %i targets\n",mesh.getNumVertices(),mesh.getNumIndices(),mesh.getNumTargets()); + if (mesh.loadMesh("Bird-test.xml")) printf("mesh loaded with %i vertices, %i face indices, %i targets\n",mesh.getNumVertices(),mesh.getNumIndices(),mesh.getNumTargets()); else printf("XML not parsed\n"); texture.loadImage("texture2.jpg"); - + xr=yr=0; xo=yo=0; - + glEnable(GL_DEPTH_TEST); - + //movieExporter.setup(); } @@ -28,14 +28,14 @@ void testApp::update(){ void testApp::draw(){ //calculate morph targets float segment=(sin(ofGetElapsedTimef())*0.5)+0.5; - vector<int> targets; + vector<string> targets; vector<float> weights; - targets.push_back(0); + targets.push_back("bird 2"); weights.push_back(segment); - targets.push_back(1); + targets.push_back("bird"); weights.push_back(1.0-segment); //printf("drawing %f %f\n",segment,1.0-segment); - + ofBackground(0,0,0); bindTexture(texture); ofPushMatrix(); @@ -47,7 +47,7 @@ void testApp::draw(){ mesh.draw(targets,weights); ofPopMatrix(); unbindTexture(texture); - + ofSetHexColor(0xFFFFFF); ofDrawBitmapString("fps: "+ofToString(ofGetFrameRate(), 2), 10, 15); } |
