Large numbers now being handled correctly...
- long long ints being used where necessary - Commas being added to numbers larger than 999 - No more values being rendered as 1.5332e+012
This commit is contained in:
parent
b3e6565bde
commit
e51abf7a53
Binary file not shown.
0
of/Active Tripod/bin/Active_Tripod_debug.ilk
Normal file
0
of/Active Tripod/bin/Active_Tripod_debug.ilk
Normal file
BIN
of/Active Tripod/bin/Active_Tripod_debug.lib
Normal file
BIN
of/Active Tripod/bin/Active_Tripod_debug.lib
Normal file
Binary file not shown.
@ -1,12 +1,12 @@
|
|||||||
<Widget>
|
<Widget>
|
||||||
<Kind>2</Kind>
|
<Kind>2</Kind>
|
||||||
<Name>Bar graph</Name>
|
<Name>Bar graph</Name>
|
||||||
<Value>0</Value>
|
<Value>1</Value>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget>
|
<Widget>
|
||||||
<Kind>2</Kind>
|
<Kind>2</Kind>
|
||||||
<Name>Solid Body graph</Name>
|
<Name>Solid Body graph</Name>
|
||||||
<Value>1</Value>
|
<Value>0</Value>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget>
|
<Widget>
|
||||||
<Kind>2</Kind>
|
<Kind>2</Kind>
|
||||||
|
|||||||
@ -116,7 +116,25 @@ void DataManager::onMessage( Spacebrew::Message & m )
|
|||||||
}
|
}
|
||||||
if (data[i].substr(0, 6) == "value:")
|
if (data[i].substr(0, 6) == "value:")
|
||||||
{
|
{
|
||||||
dataObject.value = ofToFloat(data[i].substr(6, -1).c_str());
|
string valString = data[i].substr(6, -1).c_str();
|
||||||
|
dataObject.value = ofToFloat(valString);
|
||||||
|
|
||||||
|
if (dataObject.value > 1000000000)
|
||||||
|
{
|
||||||
|
// create long long int
|
||||||
|
stringstream sstr(valString);
|
||||||
|
__int64 val;
|
||||||
|
sstr >> val;
|
||||||
|
dataObject.longlongIntValue = val;
|
||||||
|
dataObject.stringValue = addCommasToNumberString(valString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataObject.longlongIntValue = 0;
|
||||||
|
dataObject.stringValue = (dataObject.value > 999) ? addCommasToNumberString(valString) : valString;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\ndataObject.longlongValue = %llli \n\n",dataObject.longlongIntValue);
|
||||||
}
|
}
|
||||||
if (data[i].substr(0, 4) == "min:")
|
if (data[i].substr(0, 4) == "min:")
|
||||||
{
|
{
|
||||||
@ -129,7 +147,6 @@ void DataManager::onMessage( Spacebrew::Message & m )
|
|||||||
if (data[i].substr(0, 5) == "unit:")
|
if (data[i].substr(0, 5) == "unit:")
|
||||||
{
|
{
|
||||||
dataObject.unitMeasure = data[i].substr(5, -1).c_str();
|
dataObject.unitMeasure = data[i].substr(5, -1).c_str();
|
||||||
printf("------------ dataObject.unitMeasure = %s", data[i].substr(5, -1).c_str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,4 +197,40 @@ vector<string> DataManager::explode(const string &delimiter, const string &str)
|
|||||||
}
|
}
|
||||||
arr.push_back( str.substr(k, i-k) );
|
arr.push_back( str.substr(k, i-k) );
|
||||||
return arr;
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string DataManager::addCommasToNumberString(string num)
|
||||||
|
{
|
||||||
|
printf("adding commas \n");
|
||||||
|
string temp;
|
||||||
|
string integral = num;
|
||||||
|
string fractional;
|
||||||
|
int decimalLocation = integral.find('.');
|
||||||
|
|
||||||
|
if (decimalLocation != -1)
|
||||||
|
{
|
||||||
|
integral = integral.substr(0 , decimalLocation);
|
||||||
|
fractional = integral.substr(decimalLocation);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
integral = num;
|
||||||
|
fractional = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int endstring = integral.length();
|
||||||
|
int i;
|
||||||
|
for(i = endstring - 3; i >= 0; i -= 3) {
|
||||||
|
if (i > 0) {
|
||||||
|
temp = ","+ integral.substr(i, 3) + temp;
|
||||||
|
} else {
|
||||||
|
temp = integral.substr(i, 3) + temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i < 0) {
|
||||||
|
temp = integral.substr(0, 3+i) + temp;
|
||||||
|
}
|
||||||
|
printf("adding commas - temp = %s\n", temp.c_str());
|
||||||
|
return temp + fractional;
|
||||||
}
|
}
|
||||||
@ -13,6 +13,8 @@ struct DataObject
|
|||||||
{
|
{
|
||||||
string info;
|
string info;
|
||||||
float value;
|
float value;
|
||||||
|
string stringValue;
|
||||||
|
long long int longlongIntValue;
|
||||||
float min;
|
float min;
|
||||||
float max;
|
float max;
|
||||||
string unitMeasure;
|
string unitMeasure;
|
||||||
@ -27,6 +29,7 @@ class DataManager
|
|||||||
void update();
|
void update();
|
||||||
void draw();
|
void draw();
|
||||||
vector<string> explode( const string &delimiter, const string &str);
|
vector<string> explode( const string &delimiter, const string &str);
|
||||||
|
string addCommasToNumberString(string num);
|
||||||
|
|
||||||
// listen to spacebrew Messages
|
// listen to spacebrew Messages
|
||||||
void onMessage( Spacebrew::Message & m );
|
void onMessage( Spacebrew::Message & m );
|
||||||
|
|||||||
@ -82,11 +82,11 @@ void Scene::drawGraphValues()
|
|||||||
ofSetColor(graphTextColour[0], graphTextColour[1], graphTextColour[2], graphTextColour[3]);
|
ofSetColor(graphTextColour[0], graphTextColour[1], graphTextColour[2], graphTextColour[3]);
|
||||||
text.setSize(graphTextSize);
|
text.setSize(graphTextSize);
|
||||||
text.drawString(
|
text.drawString(
|
||||||
ofToString(activeGraph->publisher0Data.back().value) + " " + activeGraph->publisher0Data[activeGraph->publisher0Data.size() - 1].unitMeasure,
|
activeGraph->publisher0Data.back().stringValue + " " + activeGraph->publisher0Data.back().unitMeasure,
|
||||||
val0.x + 10,
|
val0.x + 10,
|
||||||
val0.y);
|
val0.y);
|
||||||
text.drawString(
|
text.drawString(
|
||||||
ofToString(activeGraph->publisher1Data.back().value) + " " + activeGraph->publisher1Data[activeGraph->publisher1Data.size() - 1].unitMeasure,
|
activeGraph->publisher1Data.back().stringValue + " " + activeGraph->publisher1Data.back().unitMeasure,
|
||||||
val1.x + 10,
|
val1.x + 10,
|
||||||
val1.y);
|
val1.y);
|
||||||
ofPopStyle();
|
ofPopStyle();
|
||||||
@ -156,30 +156,70 @@ void Scene::drawHUDCopy()
|
|||||||
vector<DataObject> *p0Data = &activeGraph->publisher0Data;
|
vector<DataObject> *p0Data = &activeGraph->publisher0Data;
|
||||||
vector<DataObject> *p1Data = &activeGraph->publisher1Data;
|
vector<DataObject> *p1Data = &activeGraph->publisher1Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int amountToAverage = MIN(p0Data->size(), averageAmount);
|
int amountToAverage = MIN(p0Data->size(), averageAmount);
|
||||||
if (p0Data->size() > 2)
|
if (p0Data->size() > 2)
|
||||||
{
|
{
|
||||||
float average0 = 0;
|
if (p0Data->back().longlongIntValue > 0)
|
||||||
for (int i = 0; i < (int)amountToAverage; i++)
|
{
|
||||||
average0 += p0Data->at(p0Data->size() - i - 1).value;
|
long long int average0 = 0;
|
||||||
average0 /= (int)amountToAverage;
|
for (int i = 0; i < (int)amountToAverage; i++)
|
||||||
|
average0 += p0Data->at(p0Data->size() - i - 1).value;
|
||||||
|
average0 /= (int)amountToAverage;
|
||||||
|
|
||||||
// (p0Data->back() + p0Data->at(p0Data->size() - 2) + p0Data->at(p0Data->size() - 2))
|
string valueWithCommas = addCommasToNumberString(ofToString(average0));
|
||||||
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
|
||||||
"Current Value: " + ofToString(p0Data->back().value) + "\n" +
|
|
||||||
"Running average: " + ofToString(average0);
|
|
||||||
drawTextBox(blStr, "BOTTOM LEFT");
|
|
||||||
|
|
||||||
|
|
||||||
float average1 = 0;
|
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||||
for (int i = 0; i < (int)amountToAverage; i++)
|
"Current Value: " + p0Data->back().stringValue + "\n" +
|
||||||
average1 += p1Data->at(p1Data->size() - i - 1).value;
|
"Running average: " + valueWithCommas;
|
||||||
average1 /= (int)amountToAverage;
|
drawTextBox(blStr, "BOTTOM LEFT");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float average0 = 0;
|
||||||
|
for (int i = 0; i < (int)amountToAverage; i++)
|
||||||
|
average0 += p0Data->at(p0Data->size() - i - 1).value;
|
||||||
|
average0 /= (int)amountToAverage;
|
||||||
|
|
||||||
|
string valueWithCommas = (average0 > 999) ? addCommasToNumberString(ofToString(average0)) : ofToString(average0);
|
||||||
|
|
||||||
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||||
"Current Value: " + ofToString(p1Data->back().value) + "\n" +
|
"Current Value: " + p0Data->back().stringValue + "\n" +
|
||||||
"Running average: " + ofToString(average1);
|
"Running average: " + valueWithCommas;
|
||||||
drawTextBox(brStr, "BOTTOM RIGHT");
|
drawTextBox(blStr, "BOTTOM LEFT");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (p1Data->back().longlongIntValue > 0)
|
||||||
|
{
|
||||||
|
float average1 = 0;
|
||||||
|
for (int i = 0; i < (int)amountToAverage; i++)
|
||||||
|
average1 += p1Data->at(p1Data->size() - i - 1).value;
|
||||||
|
average1 /= (int)amountToAverage;
|
||||||
|
|
||||||
|
string valueWithCommas = addCommasToNumberString(ofToString(average1));
|
||||||
|
|
||||||
|
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||||
|
"Current Value: " + p1Data->back().stringValue + "\n" +
|
||||||
|
"Running average: " + valueWithCommas;
|
||||||
|
drawTextBox(brStr, "BOTTOM RIGHT");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
long long int average1 = 0;
|
||||||
|
for (int i = 0; i < (int)amountToAverage; i++)
|
||||||
|
average1 += p1Data->at(p1Data->size() - i - 1).value;
|
||||||
|
average1 /= (int)amountToAverage;
|
||||||
|
|
||||||
|
string valueWithCommas = (average1 > 999) ? addCommasToNumberString(ofToString(average1)) : ofToString(average1);
|
||||||
|
|
||||||
|
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||||
|
"Current Value: " + p1Data->back().stringValue + "\n" +
|
||||||
|
"Running average: " + valueWithCommas;
|
||||||
|
drawTextBox(brStr, "BOTTOM RIGHT");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,14 +287,13 @@ void Scene::addNewData(vector<DataObject> newData)
|
|||||||
bodyGraph.addNewData(newData);
|
bodyGraph.addNewData(newData);
|
||||||
separateBodyGraph.addNewData(newData);
|
separateBodyGraph.addNewData(newData);
|
||||||
|
|
||||||
tlStr = newData[0].info + newData[0].unitMeasure + "\n" + ofToString(newData[0].value);
|
tlStr = newData[0].info + newData[0].unitMeasure + "\n" + ofToString(newData[0].stringValue);
|
||||||
trStr = newData[1].info + newData[1].unitMeasure + "\n" + ofToString(newData[1].value);
|
trStr = newData[1].info + newData[1].unitMeasure + "\n" + ofToString(newData[1].stringValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Scene::keyPressed(int key)
|
void Scene::keyPressed(int key)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -263,4 +302,44 @@ void Scene::clearGraphData()
|
|||||||
barGraph.clear();
|
barGraph.clear();
|
||||||
bodyGraph.clear();
|
bodyGraph.clear();
|
||||||
separateBodyGraph.clear();
|
separateBodyGraph.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string Scene::addCommasToNumberString(string num)
|
||||||
|
{
|
||||||
|
string temp;
|
||||||
|
string integral = num;
|
||||||
|
string fractional;
|
||||||
|
int decimalLocation = integral.find('.');
|
||||||
|
|
||||||
|
if (decimalLocation != -1)
|
||||||
|
{
|
||||||
|
integral = integral.substr(0 , decimalLocation);
|
||||||
|
fractional = integral.substr(decimalLocation);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
integral = num;
|
||||||
|
fractional = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int endstring = integral.length();
|
||||||
|
int i;
|
||||||
|
for(i = endstring - 3; i >= 0; i -= 3) {
|
||||||
|
if (i > 0) {
|
||||||
|
temp = ","+ integral.substr(i, 3) + temp;
|
||||||
|
} else {
|
||||||
|
temp = integral.substr(i, 3) + temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i < 0) {
|
||||||
|
temp = integral.substr(0, 3+i) + temp;
|
||||||
|
}
|
||||||
|
return temp + fractional;
|
||||||
}
|
}
|
||||||
@ -1,10 +1,4 @@
|
|||||||
//
|
|
||||||
// GUI.h
|
|
||||||
// emptyExample
|
|
||||||
//
|
|
||||||
// Created by James Alliban on 25/06/2013.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
@ -33,7 +27,7 @@ public:
|
|||||||
void addNewData(vector<DataObject> newData);
|
void addNewData(vector<DataObject> newData);
|
||||||
void clearGraphData();
|
void clearGraphData();
|
||||||
void keyPressed(int key);
|
void keyPressed(int key);
|
||||||
|
string addCommasToNumberString(string num);
|
||||||
|
|
||||||
BarGraph barGraph;
|
BarGraph barGraph;
|
||||||
BodyGraph bodyGraph;
|
BodyGraph bodyGraph;
|
||||||
|
|||||||
Binary file not shown.
@ -13,33 +13,25 @@ Cryptocurrency exchange rate on mtgox.com
|
|||||||
7 = Number of likes of the transmediale fan page on Facebook
|
7 = Number of likes of the transmediale fan page on Facebook
|
||||||
|
|
||||||
8 = Haus der Kulturen Main Foyer - Noise Level
|
8 = Haus der Kulturen Main Foyer - Noise Level
|
||||||
9 = Total twitter updates
|
9 =
|
||||||
|
|
||||||
10 = Haus der Kulturen Bar Area - Noise Level
|
10 = Haus der Kulturen Bar Area - Noise Level
|
||||||
11 = HUAWEI Guangdong Stock Price on the Shenzen Exchange
|
11 =
|
||||||
|
|
||||||
12 = Haus der Kulturen Beneath Main Foyer - Power Consumption (Amperes)
|
12 = Haus der Kulturen Beneath Main Foyer - Power Consumption (Amperes)
|
||||||
13 = Google Inc. Stock Price on the NASDAQ Exchange
|
13 =
|
||||||
|
|
||||||
14 = Haus der Kulturen Main Foyer - Power Consumption (Amperes)
|
14 = Haus der Kulturen Main Foyer - Power Consumption (Amperes)
|
||||||
15 =
|
15 =
|
||||||
16 = Haus der Kulturen Back Smoking Area - Air Quality
|
16 = Haus der Kulturen Back Smoking Area - Air Quality
|
||||||
17 =
|
17 =
|
||||||
18 = Haus der Kulturen Mezanine Smoking Area - Air Quality
|
18 = Haus der Kulturen Mezanine Smoking Area - Air Quality
|
||||||
19 = Percentage of books about media art out of all books on sale on ebay
|
19 =
|
||||||
|
|
||||||
20 = Haus der Kulturen Mezanine Smoking Area - Air Quality
|
20 = Haus der Kulturen Mezanine Smoking Area - Air Quality
|
||||||
21 = Number of photos tagged with berlin on Flickr
|
21 =
|
||||||
|
|
||||||
22 =
|
22 =
|
||||||
23 = Number of photos tagged with berlin on Instagram
|
23 =
|
||||||
|
|
||||||
24 =
|
24 =
|
||||||
25 = Number of photos tagged with transmediale on Instagram
|
25 =
|
||||||
|
|
||||||
26 =
|
26 =
|
||||||
27 = Number of downvotes on reddit.com/r/funny
|
27 =
|
||||||
|
|
||||||
28 =
|
28 =
|
||||||
29 =
|
29 =
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
Build started 16/1/2014 4:59:12 AM.
|
Build started 16/1/2014 2:57:32 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>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:
|
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
|
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
|
||||||
@ -118,4 +118,4 @@
|
|||||||
|
|
||||||
Build succeeded.
|
Build succeeded.
|
||||||
|
|
||||||
Time Elapsed 00:00:10.33
|
Time Elapsed 00:00:11.17
|
||||||
|
|||||||
@ -1233,3 +1233,8 @@ 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.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\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.
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// ====
|
// ====
|
||||||
// - Add a minimum time for each angle
|
// - Add a minimum time for each angle to avoif unslightly quick switching
|
||||||
// - optimise - don't calculate graph point values evey frame
|
// - optimise - don't calculate graph point values evey frame
|
||||||
// - investigate backward graph animation (use alternating colours)
|
// - investigate backward graph animation (use alternating colours)
|
||||||
// - Colour range - tween between 2-3 points
|
// - Colour range - tween between 2-3 points
|
||||||
|
|||||||
@ -6,11 +6,13 @@ void Camera::setup(int _camID)
|
|||||||
camID = _camID;
|
camID = _camID;
|
||||||
lookAtNode.setPosition(0, 0, 0);
|
lookAtNode.setPosition(0, 0, 0);
|
||||||
setDistance(100);
|
setDistance(100);
|
||||||
|
minSecondsBeforeSwapping = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Camera::update()
|
void Camera::update()
|
||||||
{
|
{
|
||||||
|
|
||||||
positionVec.x = sin(ofGetElapsedTimef() * rotSpeed) * distance;
|
positionVec.x = sin(ofGetElapsedTimef() * rotSpeed) * distance;
|
||||||
//positionVec.y = 40;
|
//positionVec.y = 40;
|
||||||
positionVec.z = cos(ofGetElapsedTimef() * rotSpeed) * distance;
|
positionVec.z = cos(ofGetElapsedTimef() * rotSpeed) * distance;
|
||||||
@ -18,4 +20,15 @@ void Camera::update()
|
|||||||
lookAtNode.setPosition(lookAtVec);
|
lookAtNode.setPosition(lookAtVec);
|
||||||
setPosition(positionVec);
|
setPosition(positionVec);
|
||||||
lookAt(lookAtNode);
|
lookAt(lookAtNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Camera::activate()
|
||||||
|
{
|
||||||
|
timeBecameActive = ofGetElapsedTimef();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Camera::deactivate()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
@ -15,6 +15,8 @@ class Camera : public ofEasyCam
|
|||||||
public:
|
public:
|
||||||
void setup(int _camID);
|
void setup(int _camID);
|
||||||
void update();
|
void update();
|
||||||
|
void activate();
|
||||||
|
void deactivate();
|
||||||
|
|
||||||
int camID;
|
int camID;
|
||||||
|
|
||||||
@ -26,4 +28,6 @@ public:
|
|||||||
float distance;
|
float distance;
|
||||||
float rotSpeed;
|
float rotSpeed;
|
||||||
float swapProbability;
|
float swapProbability;
|
||||||
|
float minSecondsBeforeSwapping;
|
||||||
|
float timeBecameActive;
|
||||||
};
|
};
|
||||||
@ -144,6 +144,7 @@ void Scene::switchCamera()
|
|||||||
newCamID = (ofRandom(2) < 0.5) ? 0 : 1;
|
newCamID = (ofRandom(2) < 0.5) ? 0 : 1;
|
||||||
|
|
||||||
printf("************ changing cameras to %i ************** \n", newCamID);
|
printf("************ changing cameras to %i ************** \n", newCamID);
|
||||||
|
activeCamera->deactivate();
|
||||||
activeCamera = &cameras[newCamID];
|
activeCamera = &cameras[newCamID];
|
||||||
|
activeCamera->activate();
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user