From adc1fe0182495151eba174f7ab5b99a900e10b5e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 6 Apr 2012 00:00:16 +0100 Subject: changed morphmesh to use associative keys for targets --- morpher/src/testApp.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'morpher/src/testApp.cpp') 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 targets; + vector targets; vector 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); } -- cgit v1.2.3