Cameras switch only after a set amount of seconds

This commit is contained in:
James Alliban 2014-01-16 21:04:00 +00:00
parent e51abf7a53
commit 6c6cc02dea
22 changed files with 70 additions and 32 deletions

Binary file not shown.

Binary file not shown.

View File

@ -31,7 +31,12 @@
<Widget>
<Kind>4</Kind>
<Name>Cam0 Swap Probablity (per frame)</Name>
<Value>0.005233553</Value>
<Value>0.008815790</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Cam0 Min Seconds Before Swapping</Name>
<Value>2.812500000</Value>
</Widget>
<Widget>
<Kind>4</Kind>
@ -56,7 +61,12 @@
<Widget>
<Kind>4</Kind>
<Name>Cam1 Swap Probablity (per frame)</Name>
<Value>0.011421053</Value>
<Value>0.019236842</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Cam1 Min Seconds Before Swapping</Name>
<Value>1.500000000</Value>
</Widget>
<Widget>
<Kind>4</Kind>
@ -81,5 +91,10 @@
<Widget>
<Kind>4</Kind>
<Name>Cam2 Swap Probablity (per frame)</Name>
<Value>0.012723684</Value>
<Value>0.037799340</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Cam2 Min Seconds Before Swapping</Name>
<Value>1.125000000</Value>
</Widget>

View File

@ -1,37 +1,45 @@
00 = Haus der Kulturen South-facing - Light Level (Lumen)
00 =
1 = Gangnamstyle YouTube Video
(The Most Popular Video On YouTube)
2 = Haus der Kulturen West-facing - Light Level (Lumen)
2 =
3 = Bitcoin EUR Price
Cryptocurrency exchange rate on mtgox.com
4 = Haus der Kulturen North - Interior Temperature (Celsius)
4 =
5 = Number of times transmediale.de has been shared on Facebook
6 = Haus der Kulturen South - Interior Temperature (Celsius)
6 =
7 = Number of likes of the transmediale fan page on Facebook
8 = Haus der Kulturen Main Foyer - Noise Level
9 =
10 = Haus der Kulturen Bar Area - Noise Level
11 =
12 = Haus der Kulturen Beneath Main Foyer - Power Consumption (Amperes)
13 =
14 = Haus der Kulturen Main Foyer - Power Consumption (Amperes)
8 =
9 = Total twitter updates
10 =
11 = HUAWEI Guangdong Stock Price on the Shenzen Exchange
12 =
13 = Google Inc. Stock Price on the NASDAQ Exchange
14 =
15 =
16 = Haus der Kulturen Back Smoking Area - Air Quality
16 =
17 =
18 = Haus der Kulturen Mezanine Smoking Area - Air Quality
19 =
20 = Haus der Kulturen Mezanine Smoking Area - Air Quality
21 =
18 =
19 = Percentage of books about media art out of all books on sale on ebay
20 =
21 = Number of photos tagged with berlin on Flickr
22 =
23 =
23 = Number of photos tagged with berlin on Instagram
24 =
25 =
25 = Number of photos tagged with transmediale on Instagram
26 =
27 =
27 = Number of downvotes on reddit.com/r/funny
28 =
29 =

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +1,8 @@
Build started 16/1/2014 2:57:32 PM.
Build started 16/1/2014 8:59:58 PM.
1>Project "C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj" on node 2 (Build target(s)).
1>ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I..\..\..\libs\openFrameworks /I..\..\..\libs\openFrameworks\graphics /I..\..\..\libs\openFrameworks\app /I..\..\..\libs\openFrameworks\sound /I..\..\..\libs\openFrameworks\utils /I..\..\..\libs\openFrameworks\communication /I..\..\..\libs\openFrameworks\video /I..\..\..\libs\openFrameworks\types /I..\..\..\libs\openFrameworks\math /I..\..\..\libs\openFrameworks\3d /I..\..\..\libs\openFrameworks\gl /I..\..\..\libs\openFrameworks\events /I..\..\..\libs\glut\include /I..\..\..\libs\rtAudio\include /I..\..\..\libs\quicktime\include /I..\..\..\libs\freetype\include /I..\..\..\libs\freetype\include\freetype2 /I..\..\..\libs\freeImage\include /I..\..\..\libs\fmodex\include /I..\..\..\libs\videoInput\include /I..\..\..\libs\glew\include\ /I..\..\..\libs\glu\include /I..\..\..\libs\tess2\include /I..\..\..\libs\cairo\include\cairo /I..\..\..\libs\poco\include /I..\..\..\libs\glfw\include /I..\..\..\..\libs\openssl\include /I..\..\..\addons /Isrc /Isrc\data /Isrc\gui /Isrc\visual /Isrc\visual\graph /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp\json /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\ /I..\..\..\addons\ofxLibwebsockets\libs\openssl\openssl /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include\ofxLibwebsockets /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers /I..\..\..\addons\ofxSpacebrew\src /I..\..\..\addons\ofxUI\src /I..\..\..\addons\ofxXmlSettings\libs /I..\..\..\addons\ofxXmlSettings\src /I..\..\..\addons\ofxFTGL\src /I..\..\..\addons\ofxFTGL\libs\FTGL\include\FTGL /I..\..\..\addons\ofxFTGL\libs\FTGL\include /I..\..\..\addons\ofxFTGL\libs\FTGL /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D NDEBUG /D _CONSOLE /D POCO_STATIC /D CAIRO_WIN32_STATIC_BUILD /D DISABLE_SOME_FLOATING_POINT /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"obj\Release\\" /Fd"obj\Release\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt src\testApp.cpp src\visual\Scene.cpp
testApp.cpp
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I..\..\..\libs\openFrameworks /I..\..\..\libs\openFrameworks\graphics /I..\..\..\libs\openFrameworks\app /I..\..\..\libs\openFrameworks\sound /I..\..\..\libs\openFrameworks\utils /I..\..\..\libs\openFrameworks\communication /I..\..\..\libs\openFrameworks\video /I..\..\..\libs\openFrameworks\types /I..\..\..\libs\openFrameworks\math /I..\..\..\libs\openFrameworks\3d /I..\..\..\libs\openFrameworks\gl /I..\..\..\libs\openFrameworks\events /I..\..\..\libs\glut\include /I..\..\..\libs\rtAudio\include /I..\..\..\libs\quicktime\include /I..\..\..\libs\freetype\include /I..\..\..\libs\freetype\include\freetype2 /I..\..\..\libs\freeImage\include /I..\..\..\libs\fmodex\include /I..\..\..\libs\videoInput\include /I..\..\..\libs\glew\include\ /I..\..\..\libs\glu\include /I..\..\..\libs\tess2\include /I..\..\..\libs\cairo\include\cairo /I..\..\..\libs\poco\include /I..\..\..\libs\glfw\include /I..\..\..\..\libs\openssl\include /I..\..\..\addons /Isrc /Isrc\data /Isrc\gui /Isrc\visual /Isrc\visual\graph /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp /I..\..\..\addons\ofxLibwebsockets\libs\jsoncpp\json /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\ /I..\..\..\addons\ofxLibwebsockets\libs\openssl\openssl /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include\ofxLibwebsockets /I..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\src /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port /I..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers /I..\..\..\addons\ofxSpacebrew\src /I..\..\..\addons\ofxUI\src /I..\..\..\addons\ofxXmlSettings\libs /I..\..\..\addons\ofxXmlSettings\src /I..\..\..\addons\ofxFTGL\src /I..\..\..\addons\ofxFTGL\libs\FTGL\include\FTGL /I..\..\..\addons\ofxFTGL\libs\FTGL\include /I..\..\..\addons\ofxFTGL\libs\FTGL /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D NDEBUG /D _CONSOLE /D POCO_STATIC /D CAIRO_WIN32_STATIC_BUILD /D DISABLE_SOME_FLOATING_POINT /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"obj\Release\\" /Fd"obj\Release\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt src\data\DataManager.cpp src\visual\Scene.cpp
DataManager.cpp
1>C:\Users\James Alliban\Work\of_v0.8.0_vs_release\libs\poco\include\Poco/StreamConverter.h(126): warning C4250: 'Poco::InputStreamConverter' : inherits 'std::basic_istream<_Elem,_Traits>::std::basic_istream<_Elem,_Traits>::_Add_vtordisp1' via dominance
with
[
@ -118,4 +118,4 @@
Build succeeded.
Time Elapsed 00:00:11.17
Time Elapsed 00:00:11.71

View File

@ -1238,3 +1238,13 @@ C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Util
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
^C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
^C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\Utility_Box.vcxproj
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.lib
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp
C:\Users\James Alliban\Work\of_v0.8.0_vs_release\CRITICAL-INFRASTRUCTURE\of\Utility_Box\bin\Utility_Box.exp

Binary file not shown.

Binary file not shown.

View File

@ -17,8 +17,6 @@ void DataManager::setup()
}
setupSpacebrew();
nextDataSendTime = 0.1;
}

View File

@ -176,6 +176,7 @@ void GUI::addCameraGUI()
gui->addSlider("Cam" + ofToString(i) + " Direction Point Y", 0, 150, &app->scene.cameras[i].lookAtVec.y, length, dim);
gui->addSlider("Cam" + ofToString(i) + " Rotation Speed", -2, 2, &app->scene.cameras[i].rotSpeed, length, dim);
gui->addSlider("Cam" + ofToString(i) + " Swap Probablity (per frame)", 0.001, 0.1, &app->scene.cameras[i].swapProbability, length, dim);
gui->addSlider("Cam" + ofToString(i) + " Min Seconds Before Swapping", 0.5, 10, &app->scene.cameras[i].minSecondsBeforeSwapping, length, dim);
}
finaliseCanvas(gui, true);

View File

@ -7,11 +7,14 @@ void Camera::setup(int _camID)
lookAtNode.setPosition(0, 0, 0);
setDistance(100);
minSecondsBeforeSwapping = 2;
isReadyForSwap = false;
}
void Camera::update()
{
if (ofGetElapsedTimef() - timeBecameActive > minSecondsBeforeSwapping)
isReadyForSwap = true;
positionVec.x = sin(ofGetElapsedTimef() * rotSpeed) * distance;
//positionVec.y = 40;
@ -25,10 +28,12 @@ void Camera::update()
void Camera::activate()
{
isReadyForSwap = false;
timeBecameActive = ofGetElapsedTimef();
}
void Camera::deactivate()
{
isReadyForSwap = false;
}

View File

@ -30,4 +30,6 @@ public:
float swapProbability;
float minSecondsBeforeSwapping;
float timeBecameActive;
bool isReadyForSwap;
};

View File

@ -37,17 +37,17 @@ void Scene::update()
{
if (activeCamera->camID == 0)
{
if (ofRandom(1) < activeCamera->swapProbability)
if (ofRandom(1) < activeCamera->swapProbability && activeCamera->isReadyForSwap)
switchCamera();
}
else if (activeCamera->camID == 1)
{
if (ofRandom(1) < activeCamera->swapProbability)
if (ofRandom(1) < activeCamera->swapProbability && activeCamera->isReadyForSwap)
switchCamera();
}
else if (activeCamera->camID == 2)
{
if (ofRandom(1) < activeCamera->swapProbability)
if (ofRandom(1) < activeCamera->swapProbability && activeCamera->isReadyForSwap)
switchCamera();
}
}
@ -143,7 +143,6 @@ void Scene::switchCamera()
if (activeCamera->camID == 2)
newCamID = (ofRandom(2) < 0.5) ? 0 : 1;
printf("************ changing cameras to %i ************** \n", newCamID);
activeCamera->deactivate();
activeCamera = &cameras[newCamID];
activeCamera->activate();