summaryrefslogtreecommitdiff
path: root/morpher/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'morpher/src/testApp.cpp')
-rw-r--r--morpher/src/testApp.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/morpher/src/testApp.cpp b/morpher/src/testApp.cpp
index 04ecd26..31dffb4 100644
--- a/morpher/src/testApp.cpp
+++ b/morpher/src/testApp.cpp
@@ -4,7 +4,12 @@
void testApp::setup(){
//mesh.loadfile("Bird-test1.xml");
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");
+ else printf("mesh XML file not parsed\n");
+
+ if (mesh.loadSeqs("Bird-anim-test.xml")) printf("animation loaded with %i sequences\n",mesh.getNumSequences());
+ else printf("animation XML file not parsed\n");
+
+ mesh.sequences["flap"].start();
texture.loadImage("texture2.jpg");
@@ -27,14 +32,10 @@ void testApp::update(){
void testApp::draw(){
//calculate morph targets
float segment=(sin(ofGetElapsedTimef())*0.5)+0.5;
- vector<string> targets;
- vector<float> weights;
- targets.push_back("bird 2");
- weights.push_back(segment);
- targets.push_back("bird");
- weights.push_back(1.0-segment);
- //printf("drawing %f %f\n",segment,1.0-segment);
-
+ vector<morphWeight> testweight;
+ testweight.push_back(morphWeight("bird 2",segment));
+ testweight.push_back(morphWeight("bird",1.0-segment));
+
ofBackground(0,0,0);
bindTexture(texture);
ofPushMatrix();
@@ -43,7 +44,8 @@ void testApp::draw(){
ofRotate(yr,1,0,0);
ofRotate(180,1,0,0);
ofScale(2.0,2.0,2.0);
- mesh.draw(targets,weights);
+ //mesh.draw(testweight);
+ mesh.drawAnimated();
ofPopMatrix();
unbindTexture(texture);