diff --git a/Makefile b/Makefile index 4277d8d..ac6c695 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ endif # make sure the the OF_ROOT location is defined ifndef OF_ROOT - OF_ROOT=$(realpath ../../../../../../../..) + OF_ROOT=$(realpath ../../../../../../../../../..) endif # call the project makefile! diff --git a/addons.make b/addons.make index a9a69fc..89c2f7b 100644 --- a/addons.make +++ b/addons.make @@ -1,2 +1,3 @@ +ofxGui ofxKinect ofxSocketIO diff --git a/bin/lumihoopDebug.app/Contents/MacOS/lumihoopDebug b/bin/lumihoopDebug.app/Contents/MacOS/lumihoopDebug index fd9590d..8f46b7b 100755 Binary files a/bin/lumihoopDebug.app/Contents/MacOS/lumihoopDebug and b/bin/lumihoopDebug.app/Contents/MacOS/lumihoopDebug differ diff --git a/config.make b/config.make index 5ce204d..043b1fe 100644 --- a/config.make +++ b/config.make @@ -6,9 +6,9 @@ ################################################################################ # OF ROOT # The location of your root openFrameworks installation -# (default) OF_ROOT = ../../../../../../../.. +# (default) OF_ROOT = ../../../../../../../../../.. ################################################################################ -# OF_ROOT = ../../../../../../../.. +# OF_ROOT = ../../../../../../../../../.. ################################################################################ # PROJECT ROOT diff --git a/lumihoop.xcodeproj/project.pbxproj b/lumihoop.xcodeproj/project.pbxproj index 12abe37..c67ceef 100644 --- a/lumihoop.xcodeproj/project.pbxproj +++ b/lumihoop.xcodeproj/project.pbxproj @@ -805,6 +805,359 @@ sourceTree SOURCE_ROOT + 78F524ADA8DDC5DF3F460FA5 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxToggle.h + path + ../../../../addons/ofxGui/src/ofxToggle.h + sourceTree + SOURCE_ROOT + + B07D6C52C2FE371D2B91739E + + fileRef + E118568A6BABFFADB75DB858 + isa + PBXBuildFile + + E118568A6BABFFADB75DB858 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxToggle.cpp + path + ../../../../addons/ofxGui/src/ofxToggle.cpp + sourceTree + SOURCE_ROOT + + CC050FCE6035B4BAFB0D11B1 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxSliderGroup.h + path + ../../../../addons/ofxGui/src/ofxSliderGroup.h + sourceTree + SOURCE_ROOT + + 413B65A0F41D699F37AB4C06 + + fileRef + 99B37C8367EB4811EEF8E78D + isa + PBXBuildFile + + 99B37C8367EB4811EEF8E78D + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxSliderGroup.cpp + path + ../../../../addons/ofxGui/src/ofxSliderGroup.cpp + sourceTree + SOURCE_ROOT + + D41FA502010DB4C51A4C1390 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxSlider.h + path + ../../../../addons/ofxGui/src/ofxSlider.h + sourceTree + SOURCE_ROOT + + A2953313263AE1234930247E + + fileRef + AEA7CD14AC4CC1AF68D59D19 + isa + PBXBuildFile + + AEA7CD14AC4CC1AF68D59D19 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxSlider.cpp + path + ../../../../addons/ofxGui/src/ofxSlider.cpp + sourceTree + SOURCE_ROOT + + 4EBE44F173B46F539D0F4741 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxPanel.h + path + ../../../../addons/ofxGui/src/ofxPanel.h + sourceTree + SOURCE_ROOT + + CE6F136678038366969711AB + + fileRef + 27CE0445D02D803853EC74E8 + isa + PBXBuildFile + + 27CE0445D02D803853EC74E8 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxPanel.cpp + path + ../../../../addons/ofxGui/src/ofxPanel.cpp + sourceTree + SOURCE_ROOT + + F100E30570234E337922C10C + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxLabel.h + path + ../../../../addons/ofxGui/src/ofxLabel.h + sourceTree + SOURCE_ROOT + + 81BE400C35825643551A3190 + + fileRef + 73799D65360CD587DCAE90A0 + isa + PBXBuildFile + + 73799D65360CD587DCAE90A0 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxLabel.cpp + path + ../../../../addons/ofxGui/src/ofxLabel.cpp + sourceTree + SOURCE_ROOT + + 44C0961009D36089EBA9C36F + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxGuiGroup.h + path + ../../../../addons/ofxGui/src/ofxGuiGroup.h + sourceTree + SOURCE_ROOT + + CFFFBA144E8160ECC1C97982 + + fileRef + BD6A6ADD1A79B85E833FBDF1 + isa + PBXBuildFile + + BD6A6ADD1A79B85E833FBDF1 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxGuiGroup.cpp + path + ../../../../addons/ofxGui/src/ofxGuiGroup.cpp + sourceTree + SOURCE_ROOT + + 607FCA3A979EBCF02F0B00FC + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxGui.h + path + ../../../../addons/ofxGui/src/ofxGui.h + sourceTree + SOURCE_ROOT + + 481083C90D96C0AAA580E194 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxButton.h + path + ../../../../addons/ofxGui/src/ofxButton.h + sourceTree + SOURCE_ROOT + + A61B54CA66E926867C59D2C6 + + fileRef + AE859610F3926950EBBC8B13 + isa + PBXBuildFile + + AE859610F3926950EBBC8B13 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxButton.cpp + path + ../../../../addons/ofxGui/src/ofxButton.cpp + sourceTree + SOURCE_ROOT + + EE3013E1AD254D862ADCA585 + + explicitFileType + sourcecode.c.h + fileEncoding + 30 + isa + PBXFileReference + name + ofxBaseGui.h + path + ../../../../addons/ofxGui/src/ofxBaseGui.h + sourceTree + SOURCE_ROOT + + A763ED608B35AE3310251DEE + + children + + BA20A4B3FEF378FA209B9E4E + EE3013E1AD254D862ADCA585 + AE859610F3926950EBBC8B13 + 481083C90D96C0AAA580E194 + 607FCA3A979EBCF02F0B00FC + BD6A6ADD1A79B85E833FBDF1 + 44C0961009D36089EBA9C36F + 73799D65360CD587DCAE90A0 + F100E30570234E337922C10C + 27CE0445D02D803853EC74E8 + 4EBE44F173B46F539D0F4741 + AEA7CD14AC4CC1AF68D59D19 + D41FA502010DB4C51A4C1390 + 99B37C8367EB4811EEF8E78D + CC050FCE6035B4BAFB0D11B1 + E118568A6BABFFADB75DB858 + 78F524ADA8DDC5DF3F460FA5 + + isa + PBXGroup + name + src + sourceTree + <group> + + 480A780D8D0308AE4A368801 + + children + + A763ED608B35AE3310251DEE + + isa + PBXGroup + name + ofxGui + sourceTree + <group> + + 106B9A6182DF98E835C09B47 + + fileRef + BA20A4B3FEF378FA209B9E4E + isa + PBXBuildFile + + BA20A4B3FEF378FA209B9E4E + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 30 + isa + PBXFileReference + name + ofxBaseGui.cpp + path + ../../../../addons/ofxGui/src/ofxBaseGui.cpp + sourceTree + SOURCE_ROOT + 6948EE371B920CB800B5AC1A children @@ -820,6 +1173,7 @@ children + 480A780D8D0308AE4A368801 9683228C705CA3FF4F2EA945 1654D1369875BFEFCE99E26C @@ -985,6 +1339,7 @@ $(OF_CORE_HEADERS) src + ../../../../addons/ofxGui/src ../../../../addons/ofxKinect/libs ../../../../addons/ofxKinect/libs/libfreenect ../../../../addons/ofxKinect/libs/libfreenect/include @@ -1072,6 +1427,7 @@ $(OF_CORE_HEADERS) src + ../../../../addons/ofxGui/src ../../../../addons/ofxKinect/libs ../../../../addons/ofxKinect/libs/libfreenect ../../../../addons/ofxKinect/libs/libfreenect/include @@ -1148,6 +1504,14 @@ E4B69E200A3A1BDC003C02F2 E4B69E210A3A1BDC003C02F2 + 106B9A6182DF98E835C09B47 + A61B54CA66E926867C59D2C6 + CFFFBA144E8160ECC1C97982 + 81BE400C35825643551A3190 + CE6F136678038366969711AB + A2953313263AE1234930247E + 413B65A0F41D699F37AB4C06 + B07D6C52C2FE371D2B91739E A410FD233F75B688B03CBAE3 4F535557DDB78E33E89755AB 07925661608857C519CE1E55 @@ -1254,6 +1618,7 @@ $(OF_CORE_HEADERS) src + ../../../../addons/ofxGui/src ../../../../addons/ofxKinect/libs ../../../../addons/ofxKinect/libs/libfreenect ../../../../addons/ofxKinect/libs/libfreenect/include @@ -1331,6 +1696,7 @@ $(OF_CORE_HEADERS) src + ../../../../addons/ofxGui/src ../../../../addons/ofxKinect/libs ../../../../addons/ofxKinect/libs/libfreenect ../../../../addons/ofxKinect/libs/libfreenect/include diff --git a/lumihoop.xcodeproj/project.xcworkspace/xcuserdata/thibaultmaekelbergh.xcuserdatad/UserInterfaceState.xcuserstate b/lumihoop.xcodeproj/project.xcworkspace/xcuserdata/thibaultmaekelbergh.xcuserdatad/UserInterfaceState.xcuserstate index 907a183..3253af3 100644 Binary files a/lumihoop.xcodeproj/project.xcworkspace/xcuserdata/thibaultmaekelbergh.xcuserdatad/UserInterfaceState.xcuserstate and b/lumihoop.xcodeproj/project.xcworkspace/xcuserdata/thibaultmaekelbergh.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 05278d6..65fbc0d 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -22,6 +22,12 @@ void ofApp::setup(){ ofSetWindowShape(1024, 768); ofSetCircleResolution(64); ofSetFrameRate(60); + + // MARK: - Initialise debug interface + gui.setup(); + gui.add(slider.setup("Beamer distance", 0.5, 0, 1.0)); + + debugMode = true; } void ofApp::update() { @@ -45,7 +51,6 @@ void ofApp::update() { void ofApp::draw() { ofBackground(0); - // ofDrawBitmapStringHighlight(ofApp::status, 20, 20); // MARK: - Draw hoop if global vars are not null if(hoopX && hoopY && hoopScale) { @@ -56,15 +61,13 @@ void ofApp::draw() { } // MARK: - Display the pointcloud & start easyCam - easyCam.begin(); - glPushMatrix(); - ofScale(1, -1, -1); - ofTranslate(0, 0, -100); - ofEnableDepthTest(); - pointCloud.drawVertices(); - ofDisableDepthTest(); - ofPopMatrix(); - easyCam.end(); + drawPointCloud(); + + // MARK: - Draw debug interface + if(debugMode) { + ofDrawBitmapStringHighlight(ofApp::status, 10, 100); + gui.draw(); + } } // MARK: - #BIND_ON_CONNECT @@ -86,6 +89,20 @@ void ofApp::gotEvent(string& name) { status = name; } +//-------------------------------------------------------------- +// MARK: - #DRAWS +void ofApp::drawPointCloud() { + easyCam.begin(); + glPushMatrix(); + ofScale(1, -1, -1); + ofTranslate(0, 0, -100); + ofEnableDepthTest(); + pointCloud.drawVertices(); + ofDisableDepthTest(); + ofPopMatrix(); + easyCam.end(); +} + //-------------------------------------------------------------- // MARK: - #EVENTS void ofApp::drawHoop (ofxSocketIOData& data) { diff --git a/src/ofApp.h b/src/ofApp.h index ff1eb20..f421ee7 100644 --- a/src/ofApp.h +++ b/src/ofApp.h @@ -1,6 +1,7 @@ #pragma once #include "ofMain.h" +#include "ofxGui.h" #include "ofxSocketIO.h" #include "ofxSocketIOData.h" #include "ofxKinect.h" @@ -11,29 +12,34 @@ class ofApp : public ofBaseApp{ void update(); void draw(); - /* - Hoop variables - */ + /* - methods - */ + void drawPointCloud(); + + /* - global variables - */ int hoopX, hoopY; float hoopScale; - - /* - ofxSocketIO - */ - ofxSocketIO socketIO; - // socket methods - void onConnection(); - void bindEvents(); - void gotEvent(std::string& name); - - // socket events & responses - ofEvent hoopPlacedEvent; - void drawHoop(ofxSocketIOData& data); - - // socket variables - bool isConnected; - std::string address; - std::string status; - + bool debugMode = false; - /* - ofxKinect, ofEasyCam, ofMesh - */ + /* - instances - */ + ofxSocketIO socketIO; ofxKinect kinect; ofEasyCam easyCam; ofMesh pointCloud; + ofxPanel gui; + ofxFloatSlider slider; + + + // socket methods + void onConnection(); + void bindEvents(); + void gotEvent(std::string& name); + + // socket events & responses + ofEvent hoopPlacedEvent; + void drawHoop(ofxSocketIOData& data); + + // socket variables + bool isConnected; + std::string address; + std::string status; };