#include "testApp.h" //-------------------------------------------------------------- testApp::~testApp(){ saveSettings("settings.xml"); } //-------------------------------------------------------------- void testApp::setup(){ ofBackground(0,0,0); ///ofSetVerticalSync(true); //some model / light stuff glEnable (GL_DEPTH_TEST); glShadeModel (GL_SMOOTH); glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE); glEnable (GL_COLOR_MATERIAL); //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); //ofDisableArbTex(); mode=DISPLAY; loadSettings("settings.xml"); whichClip=0; texture.loadMovie(clips[whichClip]); texture.setLoopState(OF_LOOP_NORMAL); texture.play(); light=true; } //-------------------------------------------------------------- void testApp::update(){ texture.idleMovie(); } //-------------------------------------------------------------- void testApp::draw(){ for (int i=0;i': whichClip=(whichClip+1)%numClips; texture.stop(); texture.loadMovie(clips[whichClip]); texture.play(); break; case '/': light=!light; printf(light?"LIGHT ON\n":"LIGHT OFF\n"); break; } } void testApp::loadSettings(string filename){ //viewport settings are float/ normalised to 0..1 if( !XML.loadFile(filename) ){ printf("unable to load %s check data/ folder\n",filename.c_str()); }else{ if(XML.pushTag("map4")) { numViews=XML.getNumTags("view"); if(numViews) { views=new viewpoint[numViews]; for (int i=0;ikeys; XML.getAttributeNames("settings", keys, 0); mapsettings; for (int k=0;kkeys; XML.getAttributeNames("settings", keys, 0); for (int k=0;k