-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1c6b49
commit b808dd7
Showing
12 changed files
with
970 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. | ||
//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED | ||
OF_PATH = ../../.. | ||
|
||
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE | ||
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" | ||
|
||
OTHER_LDFLAGS = $(OF_CORE_LIBS) | ||
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<takesfolder>/Users/focus/Desktop/__RGBD_Bins/_manchester_night_out/takes</takesfolder> | ||
<take> | ||
<folder>G_TAKE_04_15_00_41_09_PoleWalk1</folder> | ||
<intime>51797</intime> | ||
<outtime>219600</outtime> | ||
<soundfile /> | ||
</take> | ||
<take> | ||
<folder>G_TAKE_04_15_00_48_14_PeopleWalk</folder> | ||
<intime /> | ||
<outtime /> | ||
<soundfile /> | ||
</take> | ||
<!-- | ||
<take> | ||
<folder>G_TAKE_04_15_00_55_17_Car</take> | ||
<take>G_TAKE_04_15_00_55_53_Cars</take> | ||
<take>G_TAKE_04_15_00_59_24_Printworks</take> | ||
<take>G_TAKE_04_15_01_02_00_TrainFewPeople</take> | ||
<take>G_TAKE_04_15_01_02_33_no_one</take> | ||
<take>G_TAKE_04_15_01_11_14_park</take> | ||
--> | ||
<!-- | ||
<take> | ||
<folder>G_TAKE_04_15_00_48_14_PeopleWalk</folder> | ||
<intime></intime> | ||
<outtime></outtime> | ||
<soundfile></soundfile> | ||
</take> | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.yourcompany.openFrameworks</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "testApp.h" | ||
#include "ofAppGlutWindow.h" | ||
|
||
//-------------------------------------------------------------- | ||
int main(){ | ||
ofAppGlutWindow window; // create a window | ||
// set width, height, mode (OF_WINDOW or OF_FULLSCREEN) | ||
ofSetupOpenGL(&window, 1024, 768, OF_WINDOW); | ||
ofRunApp(new testApp()); // start the app | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
#include "testApp.h" | ||
#include "ofxXmlSettings.h" | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::setup(){ | ||
|
||
ofSetFrameRate(60); | ||
ofBackground(0); | ||
|
||
scrubMode = false; | ||
if(!playlist.loadFile("playlist.xml")){ | ||
ofLogError("Error loading playlist xml"); | ||
} | ||
string takesfolder = playlist.getValue("takesfolder", ""); | ||
cout << "takes folder " << takesfolder << endl; | ||
int numTakes = playlist.getNumTags("take"); | ||
for(int i = 0; i < numTakes; i++){ | ||
StreetTake take; | ||
take.xmlIndex = i; | ||
playlist.pushTag("take", i); | ||
take.path = ofToDataPath(takesfolder + "/" + playlist.getValue("folder", "")); | ||
take.images.loadSequence( take.path ); | ||
take.intime = playlist.getValue("intime", 0); | ||
take.outtime = playlist.getValue("outtime", int(take.images.getDurationInMillis())); | ||
take.soundFile = playlist.getValue("soundFile", ""); | ||
|
||
playlist.popTag(); | ||
sequences.push_back(take); | ||
} | ||
currentTake = 0; | ||
|
||
cam.setup(); | ||
cam.usemouse = true; | ||
cam.autosavePosition; | ||
cam.loadCameraPosition(); | ||
cam.speed = 5; | ||
|
||
startTime = ofGetElapsedTimeMillis(); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::update(){ | ||
if(scrubMode){ | ||
long time = ofMap(mouseX, 0, ofGetWidth(), 0, sequences[currentTake].images.getDurationInMillis(), true); | ||
sequences[currentTake].images.selectTime(time); | ||
} | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::draw(){ | ||
drawPointcloud(); | ||
if(scrubMode){ | ||
ofSetColor(255); | ||
ofDrawBitmapString("Current Path " + sequences[currentTake].path, 50, 50); | ||
} | ||
else{ | ||
long currentMillis = ofGetElapsedTimeMillis() - startTime + sequences[currentTake].intime; | ||
if(currentMillis < sequences[currentTake].outtime){ | ||
sequences[currentTake].images.selectTime(currentMillis); | ||
} | ||
else { | ||
nextTake(); | ||
} | ||
} | ||
} | ||
|
||
void testApp::drawPointcloud(){ | ||
|
||
ofShortPixels& pix = sequences[currentTake].images.getPixels(); | ||
|
||
glEnable(GL_DEPTH_TEST); | ||
ofMesh mesh; | ||
ofRectangle rect = ofRectangle(0,0, ofGetWidth(), ofGetHeight()); | ||
//glEnable(GL_POINT_SMOOTH); | ||
//glEnable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB); // allows per-point size | ||
glPointSize(2); | ||
|
||
for(int y = 0; y < 480; y++){ | ||
for(int x = 0; x < 640; x++){ | ||
//0.104200 ref dist 120.000000 | ||
double ref_pix_size = 0.104200; | ||
double ref_distance = 120.000000; | ||
double wz = pix.getPixels()[y*640+x]; | ||
double factor = 2 * ref_pix_size * wz / ref_distance; | ||
double wx = (double)(x - 640/2) * factor; | ||
double wy = (double)(y - 480/2) * factor; | ||
mesh.addVertex(ofVec3f(wx,-wy,-wz)); | ||
} | ||
} | ||
|
||
cam.begin(rect); | ||
mesh.drawVertices(); | ||
cam.end(); | ||
|
||
glDisable(GL_DEPTH_TEST); | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::keyPressed(int key){ | ||
if(key == ' '){ | ||
scrubMode = !scrubMode; | ||
if(!scrubMode){ | ||
startTime = ofGetElapsedTimeMillis(); | ||
} | ||
} | ||
if(scrubMode && key == '['){ | ||
long time = ofMap(mouseX, 0, ofGetWidth(), 0, sequences[currentTake].images.getDurationInMillis(), true); | ||
playlist.pushTag("take",sequences[currentTake].xmlIndex); | ||
playlist.setValue("intime", int(time)); | ||
playlist.popTag(); | ||
playlist.saveFile(); | ||
cout << "set in to " << time << endl; | ||
} | ||
if(scrubMode && key == ']'){ | ||
long time = ofMap(mouseX, 0, ofGetWidth(), 0, sequences[currentTake].images.getDurationInMillis(), true); | ||
playlist.pushTag("take",sequences[currentTake].xmlIndex); | ||
playlist.setValue("outtime", int(time)); | ||
playlist.popTag(); | ||
playlist.saveFile(); | ||
|
||
cout << "set out to " << time << endl; | ||
} | ||
|
||
if(scrubMode && key == OF_KEY_LEFT){ | ||
nextTake(); | ||
} | ||
if(scrubMode && key == OF_KEY_RIGHT){ | ||
previousTake(); | ||
} | ||
|
||
if(key == 'f'){ | ||
ofToggleFullscreen(); | ||
} | ||
} | ||
|
||
void testApp::nextTake(){ | ||
currentTake = (currentTake + 1) % sequences.size(); | ||
} | ||
|
||
void testApp::previousTake(){ | ||
currentTake--; | ||
if(currentTake < 0){ | ||
currentTake = sequences.size()-1; | ||
} | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::keyReleased(int key){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseMoved(int x, int y){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseDragged(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mousePressed(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseReleased(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::windowResized(int w, int h){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::gotMessage(ofMessage msg){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::dragEvent(ofDragInfo dragInfo){ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
#include "ofMain.h" | ||
#include "ofxDepthImageSequence.h" | ||
#include "ofxGameCamera.h" | ||
|
||
typedef struct { | ||
ofxDepthImageSequence images; | ||
long intime; | ||
long outtime; | ||
string soundFile; | ||
int xmlIndex; | ||
string path; | ||
} StreetTake; | ||
|
||
class testApp : public ofBaseApp{ | ||
public: | ||
void setup(); | ||
void update(); | ||
void draw(); | ||
|
||
void keyPressed(int key); | ||
void keyReleased(int key); | ||
void mouseMoved(int x, int y); | ||
void mouseDragged(int x, int y, int button); | ||
void mousePressed(int x, int y, int button); | ||
void mouseReleased(int x, int y, int button); | ||
void windowResized(int w, int h); | ||
void dragEvent(ofDragInfo dragInfo); | ||
void gotMessage(ofMessage msg); | ||
|
||
void nextTake(); | ||
void previousTake(); | ||
|
||
bool scrubMode; | ||
void drawPointcloud(); | ||
|
||
//vector<ofxDepthImageSequence> sequences; | ||
vector<StreetTake> sequences; | ||
int currentTake; | ||
ofSoundPlayer player; | ||
ofxXmlSettings playlist; | ||
|
||
long startTime; | ||
ofxGameCamera cam; | ||
}; |