param, colors; no trasfer when far - wip
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.7 MiB |
BIN
zoneb/bin/data/cold3.png
Normal file
After Width: | Height: | Size: 2.4 MiB |
BIN
zoneb/bin/data/cold4.png
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
zoneb/bin/data/cold5.png
Normal file
After Width: | Height: | Size: 2.4 MiB |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ZONE_B>
|
||||
<XY>61.2245, -16.3265</XY>
|
||||
<XY>61.2245, -12.2449</XY>
|
||||
<scale>1.7965</scale>
|
||||
<device>video3</device>
|
||||
<thermo_delay>4</thermo_delay>
|
||||
|
|
|
@ -7,8 +7,13 @@ uniform sampler2DRect u_world;
|
|||
uniform sampler2DRect u_v4l2cam;
|
||||
uniform sampler2DRect warm1;
|
||||
uniform sampler2DRect warm2;
|
||||
uniform sampler2DRect warm3;
|
||||
// uniform sampler2DRect warm4;
|
||||
uniform sampler2DRect cold1;
|
||||
uniform sampler2DRect cold2;
|
||||
uniform sampler2DRect cold3;
|
||||
uniform sampler2DRect cold4;
|
||||
uniform sampler2DRect cold5;
|
||||
|
||||
uniform float uAreThereTwoPeopleTween;
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ void main()
|
|||
posWorld.z = -depth * 65535.0; // Remap to float range.
|
||||
posWorld.x = ray.x * posWorld.z;
|
||||
posWorld.y = ray.y * posWorld.z;
|
||||
posWorld.xyz += random3(posWorld.xyz) * 0.3;
|
||||
posWorld.xyz += random3(posWorld.xyz) * 0.15;
|
||||
|
||||
float age = misc.y;
|
||||
if(age > 1) { // reached target
|
||||
|
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 2.3 MiB |
BIN
zoneb/bin/data/warm3.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
|
@ -142,7 +142,7 @@ void ofApp::setupGui()
|
|||
|
||||
debugGui.setup("DEBUG");
|
||||
debugGui.add(calibMode.setup("calib", false));
|
||||
debugGui.add(dummyMode.setup("dummy", true)); // should be false
|
||||
debugGui.add(dummyMode.setup("dummy", false)); // should be false
|
||||
debugGui.add(dummyXY.setup("XY", {0, 0}, {-500, -500}, {500, 500})); // should be false
|
||||
debugGui.add(debugFps.setup("FPS", "0"));
|
||||
debugGui.setPosition(230, 10);
|
||||
|
@ -247,6 +247,24 @@ void ofApp::updateThermal()
|
|||
}
|
||||
|
||||
if (dummyMode == false)
|
||||
{
|
||||
if (uBetweenDistance > 500 || hotspots.size() < 2)
|
||||
{
|
||||
hotspot0 = ofVec3f(100000, 100000, 0);
|
||||
hotspot1 = ofVec3f(100000, 100000, 0);
|
||||
|
||||
if (hotspots.size() < 2)
|
||||
{
|
||||
areThereTwoPeople = false;
|
||||
areThereTwoPeopleTween = ofClamp(areThereTwoPeopleTween - 0.02, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
areThereTwoPeople = true;
|
||||
areThereTwoPeopleTween = ofClamp(areThereTwoPeopleTween + 0.02, 0, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotspots.size() > 0 && hotspots.at(0).size() > 0)
|
||||
{
|
||||
|
@ -264,6 +282,7 @@ void ofApp::updateThermal()
|
|||
areThereTwoPeopleTween = ofClamp(areThereTwoPeopleTween - 0.02, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotspots.size() > 0 && hotspots.at(0).size() > 0)
|
||||
|
@ -296,6 +315,7 @@ void ofApp::update()
|
|||
bodies.push_back(toGlm(joint.position));
|
||||
}
|
||||
uBetween = uBetween.getInterpolated(bodies.at(0).getInterpolated(bodies.at(1), 0.5f), 0.1f);
|
||||
uBetweenDistance = bodies.at(0).distance(bodies.at(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -434,7 +454,10 @@ void ofApp::draw()
|
|||
drawMain();
|
||||
boundShader.draw(0, 0);
|
||||
}
|
||||
if (showGui)
|
||||
{
|
||||
drawDebug();
|
||||
}
|
||||
}
|
||||
|
||||
void ofApp::keyPressed(int key)
|
||||
|
@ -447,6 +470,10 @@ void ofApp::keyPressed(int key)
|
|||
{
|
||||
ofSetFullscreen(false);
|
||||
}
|
||||
if (key == 's')
|
||||
{
|
||||
showGui = !showGui;
|
||||
}
|
||||
}
|
||||
|
||||
void ofApp::keyReleased(int key)
|
||||
|
|
|
@ -53,7 +53,7 @@ private:
|
|||
std::vector<ofFbo> traces;
|
||||
int curTrace;
|
||||
std::map<string, ofFloatImage> gradients;
|
||||
std::vector<std::string> gradientNames {"warm1", "warm2", "cold1", "cold2"};
|
||||
std::vector<std::string> gradientNames {"warm1", "warm2", "warm3", "cold1", "cold2", "cold3", "cold4", "cold5"};
|
||||
|
||||
ofxV4L2 v4l2Cam;
|
||||
ofTexture v4l2Tex;
|
||||
|
@ -68,6 +68,7 @@ private:
|
|||
ofVec3f hotspot0, hotspot1;
|
||||
ofVec3f hotspot3d0, hotspot3d1;
|
||||
ofVec3f uBetween;
|
||||
float uBetweenDistance;
|
||||
bool areThereTwoPeople;
|
||||
float areThereTwoPeopleTween;
|
||||
|
||||
|
@ -85,4 +86,6 @@ private:
|
|||
ofxVec2Slider dummyXY;
|
||||
ofxLabel debugFps;
|
||||
ofxPanel debugGui;
|
||||
|
||||
bool showGui = false;
|
||||
};
|
||||
|
|