From b3a0d6eb435fc2584466106ef613b99100b0a470 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 22 Feb 2012 19:14:16 +0000 Subject: model load deom xml and vertigo effect --- bin/data/settings.xml | 2 +- map4.layout | 2 +- src/main.cpp | 2 +- src/testApp.cpp | 62 ++++++++++++++++++++++++++++++++++++++++----------- src/testApp.h | 7 +++++- 5 files changed, 58 insertions(+), 17 deletions(-) diff --git a/bin/data/settings.xml b/bin/data/settings.xml index 1804f5e..7a88929 100644 --- a/bin/data/settings.xml +++ b/bin/data/settings.xml @@ -1,5 +1,5 @@ - + diff --git a/map4.layout b/map4.layout index 9ee2048..98f5fcf 100644 --- a/map4.layout +++ b/map4.layout @@ -26,7 +26,7 @@ - + diff --git a/src/main.cpp b/src/main.cpp index d8de5c8..7391c9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,7 +17,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 1440,900, OF_FULLSCREEN); // <-------- setup the GL context + ofSetupOpenGL(&window, 2048,768, OF_FULLSCREEN); // <-------- setup the GL context //ofSetupOpenGL(&window, 1024,300, OF_WINDOW); glutIgnoreKeyRepeat(1); glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); //these don't work!!! diff --git a/src/testApp.cpp b/src/testApp.cpp index c2772aa..6f8b00f 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -6,6 +6,8 @@ testApp::~testApp(){ //-------------------------------------------------------------- void testApp::setup(){ + loadSettings("settings.xml"); + ofBackground(0,0,0); ///ofSetVerticalSync(true); @@ -16,16 +18,21 @@ void testApp::setup(){ glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE); glEnable (GL_COLOR_MATERIAL); + printf("loading %s at %f,%f,%f",model_name.c_str(),model_x,model_y,model_z); + //load the bottle model - the 3ds and the texture file need to be in the same folder - bottle.loadModel("tigerbottle.3DS", 1); - bottle.setRotation(0, 180, 1, 0, 0); - bottle.setPosition(0, 101, 0); + + model.loadModel(model_name, 1); + model.setRotation(0, 180, 1, 0, 0); + //model.setRotation(0, 90, 0, 1, 0); + model.setPosition(model_x, model_y, model_z); + //ofDisableArbTex(); mode=DISPLAY; - loadSettings("settings.xml"); + whichClip=0; texture.loadMovie(clips[whichClip]); @@ -54,11 +61,17 @@ void testApp::draw(){ switch(mode) { case CALIBRATE: drawBoard(0,225,0); - bottle.draw(); + ofPushMatrix(); + ofRotate(90,0,1,0); + model.draw(); + ofPopMatrix(); break; case DISPLAY: bindTexture(texture); - bottle.draw(); + ofPushMatrix(); + ofRotate(90,0,1,0); + model.draw(); + ofPopMatrix(); unbindTexture(texture); break; case NOTHING: @@ -82,6 +95,15 @@ void testApp::keyPressed(int key){ if (activeView<0) for (int i=0;i