diff --git a/.gitignore b/.gitignore
index 3b2a2e2..685cf4d 100755
--- a/.gitignore
+++ b/.gitignore
@@ -90,4 +90,5 @@ Thumbs.db
Desktop.ini
# Android
-.csettings
\ No newline at end of file
+.csettings
+/.vs/Projekt_FORUM/v15
diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json
new file mode 100644
index 0000000..0cf5ea5
--- /dev/null
+++ b/.vs/ProjectSettings.json
@@ -0,0 +1,3 @@
+{
+ "CurrentProjectSetting": "No Configurations"
+}
\ No newline at end of file
diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
new file mode 100644
index 0000000..bb42b5b
--- /dev/null
+++ b/.vs/VSWorkspaceState.json
@@ -0,0 +1,7 @@
+{
+ "ExpandedNodes": [
+ "",
+ "\\src"
+ ],
+ "PreviewInSolutionExplorer": false
+}
\ No newline at end of file
diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite
new file mode 100644
index 0000000..ab06680
Binary files /dev/null and b/.vs/slnx.sqlite differ
diff --git a/Projekt_FORUM.vcxproj.user b/Projekt_FORUM.vcxproj.user
new file mode 100644
index 0000000..09a332b
--- /dev/null
+++ b/Projekt_FORUM.vcxproj.user
@@ -0,0 +1,19 @@
+
+
+
+ $(ProjectDir)/bin
+ WindowsLocalDebugger
+
+
+ $(ProjectDir)/bin
+ WindowsLocalDebugger
+
+
+ $(ProjectDir)/bin
+ WindowsLocalDebugger
+
+
+ $(ProjectDir)/bin
+ WindowsLocalDebugger
+
+
\ No newline at end of file
diff --git a/bin/data/AlltagTechnikUmwelt.png b/bin/data/AlltagTechnikUmwelt.png
new file mode 100644
index 0000000..4dcd19b
Binary files /dev/null and b/bin/data/AlltagTechnikUmwelt.png differ
diff --git a/bin/data/AlltagWissenschaftUmwelt.png b/bin/data/AlltagWissenschaftUmwelt.png
new file mode 100644
index 0000000..5ebe0df
Binary files /dev/null and b/bin/data/AlltagWissenschaftUmwelt.png differ
diff --git a/bin/data/Danke_4070_2.png b/bin/data/Danke_4070_2.png
new file mode 100644
index 0000000..b18bb31
Binary files /dev/null and b/bin/data/Danke_4070_2.png differ
diff --git a/bin/data/FINAL_Logo.png b/bin/data/FINAL_Logo.png
new file mode 100644
index 0000000..3098330
Binary files /dev/null and b/bin/data/FINAL_Logo.png differ
diff --git a/bin/data/HexAlltagTechnikUmwelt.png b/bin/data/HexAlltagTechnikUmwelt.png
new file mode 100644
index 0000000..a1f0640
Binary files /dev/null and b/bin/data/HexAlltagTechnikUmwelt.png differ
diff --git a/bin/data/HexAlltagWissenschaftUmwelt.png b/bin/data/HexAlltagWissenschaftUmwelt.png
new file mode 100644
index 0000000..b2fc6be
Binary files /dev/null and b/bin/data/HexAlltagWissenschaftUmwelt.png differ
diff --git a/bin/data/HexTechnikUmwelt.png b/bin/data/HexTechnikUmwelt.png
new file mode 100644
index 0000000..bd2343c
Binary files /dev/null and b/bin/data/HexTechnikUmwelt.png differ
diff --git a/bin/data/HexUmweltTechnik.png b/bin/data/HexUmweltTechnik.png
new file mode 100644
index 0000000..59140c0
Binary files /dev/null and b/bin/data/HexUmweltTechnik.png differ
diff --git a/bin/data/HexUmweltWissenschaft.png b/bin/data/HexUmweltWissenschaft.png
new file mode 100644
index 0000000..5ce8e93
Binary files /dev/null and b/bin/data/HexUmweltWissenschaft.png differ
diff --git a/bin/data/Hexagon.png b/bin/data/Hexagon.png
new file mode 100644
index 0000000..aa9e616
Binary files /dev/null and b/bin/data/Hexagon.png differ
diff --git a/bin/data/Ohm.png b/bin/data/Ohm.png
new file mode 100644
index 0000000..90cf51c
Binary files /dev/null and b/bin/data/Ohm.png differ
diff --git a/bin/data/PktAlltagTechnikUmwelt.png b/bin/data/PktAlltagTechnikUmwelt.png
new file mode 100644
index 0000000..a2eca23
Binary files /dev/null and b/bin/data/PktAlltagTechnikUmwelt.png differ
diff --git a/bin/data/PktAlltagWissenschaftUmwelt.png b/bin/data/PktAlltagWissenschaftUmwelt.png
new file mode 100644
index 0000000..0895063
Binary files /dev/null and b/bin/data/PktAlltagWissenschaftUmwelt.png differ
diff --git a/bin/data/PktTechnikUmwelt.png b/bin/data/PktTechnikUmwelt.png
new file mode 100644
index 0000000..25d6716
Binary files /dev/null and b/bin/data/PktTechnikUmwelt.png differ
diff --git a/bin/data/PktUmweltTechnik.png b/bin/data/PktUmweltTechnik.png
new file mode 100644
index 0000000..4bb70b9
Binary files /dev/null and b/bin/data/PktUmweltTechnik.png differ
diff --git a/bin/data/PktUmweltWissenschaft.png b/bin/data/PktUmweltWissenschaft.png
new file mode 100644
index 0000000..74c831c
Binary files /dev/null and b/bin/data/PktUmweltWissenschaft.png differ
diff --git a/bin/data/TechnikUmwelt.png b/bin/data/TechnikUmwelt.png
new file mode 100644
index 0000000..d178580
Binary files /dev/null and b/bin/data/TechnikUmwelt.png differ
diff --git a/bin/data/UmweltTechnik.png b/bin/data/UmweltTechnik.png
new file mode 100644
index 0000000..053f379
Binary files /dev/null and b/bin/data/UmweltTechnik.png differ
diff --git a/bin/data/UmweltWissenschaft.png b/bin/data/UmweltWissenschaft.png
new file mode 100644
index 0000000..ecb67e3
Binary files /dev/null and b/bin/data/UmweltWissenschaft.png differ
diff --git a/bin/data/Wolke.png b/bin/data/Wolke.png
new file mode 100644
index 0000000..6241dcf
Binary files /dev/null and b/bin/data/Wolke.png differ
diff --git a/bin/data/img/beer.png b/bin/data/img/beer.png
new file mode 100644
index 0000000..feeaae9
Binary files /dev/null and b/bin/data/img/beer.png differ
diff --git a/bin/data/img/br.png b/bin/data/img/br.png
new file mode 100644
index 0000000..270da3e
Binary files /dev/null and b/bin/data/img/br.png differ
diff --git a/bin/data/img/tex.png b/bin/data/img/tex.png
new file mode 100644
index 0000000..ca8193a
Binary files /dev/null and b/bin/data/img/tex.png differ
diff --git a/bin/data/img/tr.png b/bin/data/img/tr.png
new file mode 100644
index 0000000..2d86770
Binary files /dev/null and b/bin/data/img/tr.png differ
diff --git a/bin/data/settings.json b/bin/data/settings.json
new file mode 100644
index 0000000..b99174e
--- /dev/null
+++ b/bin/data/settings.json
@@ -0,0 +1,24 @@
+{
+ "warps": [
+ {
+ "blend": {
+ "edges": "0, 0, 0.5, 0.5",
+ "exponent": 2.0,
+ "gamma": "1, 1, 1",
+ "luminance": "0.5, 0.5, 0.5"
+ },
+ "brightness": 1.0,
+ "type": 2,
+ "warp": {
+ "columns": 2,
+ "control points": [
+ "0, 0",
+ "1, 0",
+ "1, 1",
+ "0, 1"
+ ],
+ "rows": 2
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/bin/data/shaders/ofxWarp/ControlPoint.frag b/bin/data/shaders/ofxWarp/ControlPoint.frag
new file mode 100644
index 0000000..87ef7a3
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/ControlPoint.frag
@@ -0,0 +1,16 @@
+#version 150
+
+in vec2 vTexCoord;
+in vec4 vColor;
+
+out vec4 fragColor;
+
+void main(void)
+{
+ vec2 uv = vTexCoord * 2.0 - 1.0;
+ float d = dot(uv, uv);
+ float rim = smoothstep(0.7, 0.8, d);
+ rim += smoothstep(0.3, 0.4, d) - smoothstep(0.5, 0.6, d);
+ rim += smoothstep(0.1, 0.0, d);
+ fragColor = mix(vec4( 0.0, 0.0, 0.0, 0.25), vColor, rim);
+}
diff --git a/bin/data/shaders/ofxWarp/ControlPoint.vert b/bin/data/shaders/ofxWarp/ControlPoint.vert
new file mode 100644
index 0000000..8eccc63
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/ControlPoint.vert
@@ -0,0 +1,23 @@
+#version 150
+
+// OF default uniforms and attributes
+uniform mat4 modelViewProjectionMatrix;
+uniform vec4 globalColor;
+
+in vec4 position;
+in vec2 texcoord;
+in vec4 color;
+
+// App uniforms and attributes
+in vec4 iPositionScale;
+in vec4 iColor;
+
+out vec2 vTexCoord;
+out vec4 vColor;
+
+void main(void)
+{
+ vTexCoord = texcoord;
+ vColor = globalColor * iColor;
+ gl_Position = modelViewProjectionMatrix * vec4(position.xy * iPositionScale.z + iPositionScale.xy, position.zw);
+}
diff --git a/bin/data/shaders/ofxWarp/WarpBilinear.frag b/bin/data/shaders/ofxWarp/WarpBilinear.frag
new file mode 100644
index 0000000..14597bb
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/WarpBilinear.frag
@@ -0,0 +1,57 @@
+#version 150
+
+uniform sampler2D uTexture;
+uniform vec4 uExtends;
+uniform vec3 uLuminance;
+uniform vec3 uGamma;
+uniform vec4 uEdges;
+uniform vec4 uCorners;
+uniform float uExponent;
+uniform bool uEditing;
+
+in vec2 vTexCoord;
+in vec4 vColor;
+
+out vec4 fragColor;
+
+float map(in float value, in float inMin, in float inMax, in float outMin, in float outMax)
+{
+ return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);
+}
+
+float grid(in vec2 uv, in vec2 size)
+{
+ vec2 coord = uv / size;
+ vec2 grid = abs(fract(coord - 0.5) - 0.5) / (2.0 * fwidth(coord));
+ float line = min(grid.x, grid.y);
+ return 1.0 - min(line, 1.0);
+}
+
+void main(void)
+{
+ vec4 texColor = texture(uTexture, vTexCoord);
+
+ vec2 mapCoord = vec2(map(vTexCoord.x, uCorners.x, uCorners.z, 0.0, 1.0), map(vTexCoord.y, uCorners.y, uCorners.w, 0.0, 1.0));
+
+ float a = 1.0;
+ if (uEdges.x > 0.0) a *= clamp(mapCoord.x / uEdges.x, 0.0, 1.0);
+ if (uEdges.y > 0.0) a *= clamp(mapCoord.y / uEdges.y, 0.0, 1.0);
+ if (uEdges.z > 0.0) a *= clamp((1.0 - mapCoord.x) / uEdges.z, 0.0, 1.0);
+ if (uEdges.w > 0.0) a *= clamp((1.0 - mapCoord.y) / uEdges.w, 0.0, 1.0);
+
+ const vec3 one = vec3(1.0);
+ vec3 blend = (a < 0.5) ? (uLuminance * pow(2.0 * a, uExponent)) : one - (one - uLuminance) * pow(2.0 * (1.0 - a), uExponent);
+
+ texColor.rgb *= pow(blend, one / uGamma);
+
+ if (uEditing)
+ {
+ float f = grid(mapCoord.xy * uExtends.xy, uExtends.zw);
+ vec4 gridColor = vec4(1.0f);
+ fragColor = mix(texColor * vColor, gridColor, f);
+ }
+ else
+ {
+ fragColor = texColor * vColor;
+ }
+}
diff --git a/bin/data/shaders/ofxWarp/WarpBilinear.vert b/bin/data/shaders/ofxWarp/WarpBilinear.vert
new file mode 100644
index 0000000..81e4fad
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/WarpBilinear.vert
@@ -0,0 +1,21 @@
+#version 150
+
+// OF default uniforms and attributes
+uniform mat4 modelViewProjectionMatrix;
+uniform vec4 globalColor;
+
+in vec4 position;
+in vec2 texcoord;
+in vec4 color;
+
+// App uniforms and attributes
+out vec2 vTexCoord;
+out vec4 vColor;
+
+void main(void)
+{
+ vTexCoord = texcoord;
+ vColor = globalColor;
+
+ gl_Position = modelViewProjectionMatrix * position;
+}
diff --git a/bin/data/shaders/ofxWarp/WarpPerspective.frag b/bin/data/shaders/ofxWarp/WarpPerspective.frag
new file mode 100644
index 0000000..82c1a0b
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/WarpPerspective.frag
@@ -0,0 +1,38 @@
+#version 150
+
+uniform sampler2D uTexture;
+uniform vec3 uLuminance;
+uniform vec3 uGamma;
+uniform vec4 uEdges;
+uniform vec4 uCorners;
+uniform float uExponent;
+
+in vec2 vTexCoord;
+in vec4 vColor;
+
+out vec4 fragColor;
+
+float map(in float value, in float inMin, in float inMax, in float outMin, in float outMax)
+{
+ return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);
+}
+
+void main(void)
+{
+ vec4 texColor = texture(uTexture, vTexCoord);
+
+ vec2 mapCoord = vec2(map(vTexCoord.x, uCorners.x, uCorners.z, 0.0, 1.0), map(vTexCoord.y, uCorners.y, uCorners.w, 0.0, 1.0));
+
+ float a = 1.0;
+ if (uEdges.x > 0.0) a *= clamp(mapCoord.x / uEdges.x, 0.0, 1.0);
+ if (uEdges.y > 0.0) a *= clamp(mapCoord.y / uEdges.y, 0.0, 1.0);
+ if (uEdges.z > 0.0) a *= clamp((1.0 - mapCoord.x) / uEdges.z, 0.0, 1.0);
+ if (uEdges.w > 0.0) a *= clamp((1.0 - mapCoord.y) / uEdges.w, 0.0, 1.0);
+
+ const vec3 one = vec3(1.0);
+ vec3 blend = (a < 0.5) ? (uLuminance * pow(2.0 * a, uExponent)) : one - (one - uLuminance) * pow(2.0 * (1.0 - a), uExponent);
+
+ texColor.rgb *= pow(blend, one / uGamma);
+
+ fragColor = texColor * vColor;
+}
diff --git a/bin/data/shaders/ofxWarp/WarpPerspective.vert b/bin/data/shaders/ofxWarp/WarpPerspective.vert
new file mode 100644
index 0000000..81e4fad
--- /dev/null
+++ b/bin/data/shaders/ofxWarp/WarpPerspective.vert
@@ -0,0 +1,21 @@
+#version 150
+
+// OF default uniforms and attributes
+uniform mat4 modelViewProjectionMatrix;
+uniform vec4 globalColor;
+
+in vec4 position;
+in vec2 texcoord;
+in vec4 color;
+
+// App uniforms and attributes
+out vec2 vTexCoord;
+out vec4 vColor;
+
+void main(void)
+{
+ vTexCoord = texcoord;
+ vColor = globalColor;
+
+ gl_Position = modelViewProjectionMatrix * position;
+}
diff --git a/bin/data/testcard.png b/bin/data/testcard.png
new file mode 100644
index 0000000..d15c568
Binary files /dev/null and b/bin/data/testcard.png differ
diff --git a/bin/data/xml/attractor.xml b/bin/data/xml/attractor.xml
new file mode 100644
index 0000000..ffd382b
--- /dev/null
+++ b/bin/data/xml/attractor.xml
@@ -0,0 +1,10 @@
+
+ 0.05
+ 4
+ 100
+ 0
+ 10
+ -80
+ 80
+
+
\ No newline at end of file
diff --git a/bin/data/xml/default.xml b/bin/data/xml/default.xml
new file mode 100644
index 0000000..588a2b5
--- /dev/null
+++ b/bin/data/xml/default.xml
@@ -0,0 +1,10 @@
+
+ 0.05
+ 4
+ 100
+ 0
+ 10
+ -80
+ 80
+
+
\ No newline at end of file
diff --git a/bin/data/xml/detractor.xml b/bin/data/xml/detractor.xml
new file mode 100644
index 0000000..ffd382b
--- /dev/null
+++ b/bin/data/xml/detractor.xml
@@ -0,0 +1,10 @@
+
+ 0.05
+ 4
+ 100
+ 0
+ 10
+ -80
+ 80
+
+
\ No newline at end of file
diff --git a/bin/data/xml/radial.xml b/bin/data/xml/radial.xml
new file mode 100644
index 0000000..ffd382b
--- /dev/null
+++ b/bin/data/xml/radial.xml
@@ -0,0 +1,10 @@
+
+ 0.05
+ 4
+ 100
+ 0
+ 10
+ -80
+ 80
+
+
\ No newline at end of file
diff --git a/bin/data/xml/rain.xml b/bin/data/xml/rain.xml
new file mode 100644
index 0000000..ffd382b
--- /dev/null
+++ b/bin/data/xml/rain.xml
@@ -0,0 +1,10 @@
+
+ 0.05
+ 4
+ 100
+ 0
+ 10
+ -80
+ 80
+
+
\ No newline at end of file
diff --git a/bin/data/xml/symbol.xml b/bin/data/xml/symbol.xml
new file mode 100644
index 0000000..8223c81
--- /dev/null
+++ b/bin/data/xml/symbol.xml
@@ -0,0 +1,21 @@
+
+ 0.01
+ 4.0
+ 100
+ 250
+ 0
+ ofRandom(maxAge - 5, maxAge)
+ -80
+ 80
+ (5, 241, 219)
+ 0.0
+ 0
+ 0
+ 70
+ false
+
+
+
+ vel.set(ofRandom(-20.0, 20.0), ofRandom(-90, -100));
+
+
diff --git a/src/avatar.cpp b/src/avatar.cpp
index 402824d..724a875 100644
--- a/src/avatar.cpp
+++ b/src/avatar.cpp
@@ -5,7 +5,7 @@
// Created by Sebastian Holzki on 17.04.19.
//
-#include "avatar.hpp"
+#include "avatar.h"
diff --git a/src/avatar.hpp b/src/avatar.h
similarity index 98%
rename from src/avatar.hpp
rename to src/avatar.h
index ad125b0..b627077 100644
--- a/src/avatar.hpp
+++ b/src/avatar.h
@@ -1,5 +1,5 @@
//
-// avatar.hpp
+// avatar.h
// emptyExample
//
// Created by Sebastian Holzki on 17.04.19.
diff --git a/src/drawableImage.cpp b/src/drawableImage.cpp
new file mode 100644
index 0000000..316dbc3
--- /dev/null
+++ b/src/drawableImage.cpp
@@ -0,0 +1,159 @@
+#include "drawableImage.h"
+#include "images.h"
+
+//--------------------------------------------------------------
+DrawableImage::DrawableImage(string imageName, float sceneSizeX, float sceneSizeY) {
+ //Color for symbol
+ redImageColor = 121;
+ greenImageColor = 205;
+ blueImageColor = 205;
+
+ pastMiddle = true;
+ fileImageHex.loadImage("Hexagon.png");
+ imageToDraw.loadImage(imageName);
+ fileImageHex = changeImageColor(fileImageHex, redImageColor, greenImageColor, blueImageColor);
+ imageToDraw = changeImageColor(imageToDraw, redImageColor, greenImageColor, blueImageColor);
+ xToMoveInCloud = ofRandom(1, 4);
+ yToMoveIntoCloud = 0;
+ ticksToMovePictureToRight = 150;
+ counterToMovePictureToRight = 0;
+ newMaxHeight = sceneSizeY - imageToDraw.getHeight() - 3;
+ imageHeight = imageToDraw.getHeight();
+ maxYpositionForPicture = setMaxHeightPosition(sceneSizeY);
+}
+
+//--------------------------------------------------------------
+DrawableImage::~DrawableImage() {
+
+}
+
+
+//--------------------------------------------------------------
+void DrawableImage::updateImage(float sceneSizeX, float sceneSizeY) {
+
+ if (cloudAttractorIsSet) {
+ doMovementOfImageAtCloud(maxYpositionForPicture, sceneSizeX, sceneSizeY);
+ }
+
+ else if (symbolAttractorIsSet) {
+ drawImage(sceneSizeX, sceneSizeY);
+ }
+
+}
+
+//--------------------------------------------------------------
+void DrawableImage::drawImage(float sceneSizeX, float sceneSizeY)
+{
+ yToMoveIntoCloud = 0;
+ xToMoveInCloud = 0;
+ counterToMovePictureToRight = 0;
+
+ imageToDraw.draw((sceneSizeX / 2 - imageToDraw.getWidth() / 2), (sceneSizeY - imageToDraw.getHeight() - 5)); //Symbol at bottom
+ fileImageHex.draw((sceneSizeX / 2 - imageToDraw.getWidth() / 2), (sceneSizeY - imageToDraw.getHeight() - 5)); //Hexagon at bottom
+}
+
+//--------------------------------------------------------------
+void DrawableImage::doMovementOfImageAtCloud(int maxYpositionForPicture, float sceneSizeX, float sceneSizeY)
+{
+ if (yToMoveIntoCloud <= maxYpositionForPicture) { //y-Movement into cloud
+ yToMoveIntoCloud += 3;
+ }
+ else if (counterToMovePictureToRight < ticksToMovePictureToRight) {
+ counterToMovePictureToRight++;
+ }
+ else { //x-Movement in cloud
+ if (pastMiddle) { //from the middle to right: midpoint + x and x gets increased til its Scenesize
+ xToMoveInCloud += 3;
+
+ }
+ else { //From left to the middle: midpoint - x decreased til x is 0 again
+ xToMoveInCloud -= 3;
+ }
+ }
+
+ if (pastMiddle && xToMoveInCloud >= sceneSizeX / 2 + imageToDraw.getWidth()) { //Left from middle
+ pastMiddle = false;
+ }
+
+ if (!pastMiddle && xToMoveInCloud <= 0) { //Rigth from middle
+ pastMiddle = true;
+ }
+
+ imageToDraw.draw(getImagePosX(sceneSizeX), getImagePosY(sceneSizeY));
+ fileImageHex.draw(getImagePosX(sceneSizeX), getImagePosY(sceneSizeY));
+
+}
+
+
+
+int DrawableImage::setMaxHeightPosition(float sceneSizeY) // Array for max y-values (so that height of the hexagons fits together and can hook into one another in honeycomb structure)
+{
+ for (float i = 0; i <= 4; i++) { //alculate the max y-values
+ newMaxHeight -= imageHeight / 2;
+ maxHeightPositions.push_back(newMaxHeight);
+ }
+ int rgen = ofRandom(0, 4);
+ return (int)maxHeightPositions.at(rgen); //random array position to choose random y-position
+}
+
+//--------------------------------------------------------------
+bool DrawableImage::imageIsOnTop(float sceneSizeY) { //see if symbol and particles reached cloud
+
+ return yToMoveIntoCloud >= maxYpositionForPicture;
+}
+
+//--------------------------------------------------------------
+ofImage DrawableImage::changeImageColor(ofImage imageToDraw, int r, int g, int b) { //Processing the color information of the individual image pixels
+ int threshold = 1;
+
+ int picWidth = imageToDraw.getWidth();
+ int picHeight = imageToDraw.getHeight();
+
+
+ for (int x = 0; x < picWidth; x++) { //go through all pixel and set new rgb-values
+ for (int y = 0; y < picHeight; y++)
+ {
+ int index = (x + y * picWidth) * 4;
+
+ if (imageToDraw.getPixelsRef()[index + 3] >= threshold) {
+ imageToDraw.getPixelsRef()[index] = r;
+ imageToDraw.getPixelsRef()[index + 1] = g;
+ imageToDraw.getPixelsRef()[index + 2] = b;
+ }
+ }
+ }
+
+ ofSetColor(255, 255, 255); //set color to white again so the colors don't distort themself
+
+ imageToDraw.update();
+
+ return imageToDraw;
+}
+
+//--------------------------------------------------------------
+int DrawableImage::getHeight() {
+ return imageToDraw.getHeight();
+}
+
+//--------------------------------------------------------------
+int DrawableImage::getWidth() {
+ return imageToDraw.getWidth();
+}
+
+//--------------------------------------------------------------
+int DrawableImage::getMaxHeight() {
+ return maxYpositionForPicture;
+}
+
+//--------------------------------------------------------------
+float DrawableImage::getImagePosX(float sceneSizeX) {
+ if (pastMiddle)
+ return (sceneSizeX / 2 - imageToDraw.getWidth() / 2) + xToMoveInCloud;
+ else
+ return (sceneSizeX / 2 - imageToDraw.getWidth() / 2) - xToMoveInCloud;
+}
+
+//--------------------------------------------------------------
+float DrawableImage::getImagePosY(float sceneSizeY) {
+ return (sceneSizeY - imageToDraw.getHeight() - 5) - yToMoveIntoCloud;
+}
\ No newline at end of file
diff --git a/src/drawableImage.h b/src/drawableImage.h
new file mode 100644
index 0000000..115d3ce
--- /dev/null
+++ b/src/drawableImage.h
@@ -0,0 +1,60 @@
+#ifndef drawableImage_h
+#define drawableImage_h
+#pragma once
+
+#include "ofMain.h"
+#include "ofxCv.h"
+#include "ofxOpenCv.h"
+#include
+
+
+
+class DrawableImage
+{
+
+public:
+
+ DrawableImage(string imageName, float sceneSizeX, float sceneSizeY);
+ ~DrawableImage();
+
+ ofColor color;
+ ofImage fileImageHex;
+ ofImage imageToDraw;
+
+ float maxLife;
+ float age;
+ float size;
+ float mass;
+ int yToMoveIntoCloud;
+ int xToMoveInCloud;
+ int maxYpositionForPicture;
+ int redImageColor;
+ int greenImageColor;
+ int blueImageColor;
+ int ticksToMovePictureToRight;
+ int counterToMovePictureToRight;
+ int imageHeight;
+ int newMaxHeight;
+ int getHeight();
+ int getWidth();
+ int getMaxHeight();
+ bool pL;
+ bool symbolAttractorIsSet;
+ bool cloudAttractorIsSet;
+ bool pastMiddle;
+
+ void updateImage(float sceneSizeX, float sceneSizeY);
+ void drawImage(float sceneSizeX, float sceneSizeY);
+ void doMovementOfImageAtCloud(int maxYpositionForPicture, float sceneSizeX, float sceneSizeY);
+ int setMaxHeightPosition(float sceneSizeY);
+ bool imageIsOnTop(float sceneSizeY);
+ float getImagePosX(float sceneSizeX);
+ float getImagePosY(float sceneSizeY);
+ vectormaxHeightPositions;
+ ofImage changeImageColor(ofImage imageToDraw, int r, int g, int b);
+
+private:
+
+};
+#endif
+#pragma once
diff --git a/src/greatWhole.cpp b/src/greatWhole.cpp
deleted file mode 100644
index e426215..0000000
--- a/src/greatWhole.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// greatWhole.cpp
-// emptyExample
-//
-// Created by Sebastian Holzki on 17.04.19.
-//
-
-#include "greatWhole.hpp"
-#include "avatar.hpp"
-
-
-
-
-GreatWhole::GreatWhole()
-{
-
-
-}
-
-// -----------------------------------
-
-GreatWhole::~GreatWhole()
-{
-
-
-}
-
-// -----------------------------------
-
-
-
-void GreatWhole::setup(){
-
-
-
-}
-
-// -----------------------------------------------
-
-
-void GreatWhole::update(vector avatars){
-
-
-
-
-}
-
-// -----------------------------------------------
-
-
-void GreatWhole::draw(){
-
- /*
-
- draw the whole avatar vector
-
- */
-
-
-}
-
-
-// -----------------------------------------------
-
-
-void GreatWhole::addAvatar(Avatar avatar){
-
-
- // avatars.push_back(avatar);
-
- /*
-
- Set coordinates in abhängigkeit vom letzten also bei avatars at (max-1)
- clip avatar dann an den letzten, y und x angepasst an x und y von avatars.at(max-1)
-
- */
-
-}
-
-
diff --git a/src/greatWhole.hpp b/src/greatWhole.hpp
deleted file mode 100644
index fdcb95a..0000000
--- a/src/greatWhole.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// greatWhole.hpp
-// emptyExample
-//
-// Created by Sebastian Holzki on 17.04.19.
-//
-
-#include
-#include "ofMain.h"
-#include "avatar.hpp"
-
-#pragma once
-
-
-/* Das Große Ganze beinhaltet eine unbestimmte Anzahl an bereits eingecheckten Personen, deren Infos in Avatare gespeichert werden.
- Es bedarf eine setup(), update() und draw()-Methode. Dabei soll Platz für den vector geschaffen werden. In update wird eine
- gewisse Bewegung der Avatar-"Bubbles" definiert. Draw zeichnet die Avatare auf die Stelen, also die entsprechenden Koordinaten. */
-
-
-class GreatWhole {
-
-
-public:
-
- GreatWhole();
- ~GreatWhole();
-
- void setup();
- void update(vector avatars);
- void draw();
-
- void addAvatar(Avatar avatar);
- Avatar getAvatarAt(int i);
-
-
-
-private:
-
- vector avatars;
-
-};
diff --git a/src/imageParticleSystem.cpp b/src/imageParticleSystem.cpp
new file mode 100644
index 0000000..b91cc17
--- /dev/null
+++ b/src/imageParticleSystem.cpp
@@ -0,0 +1,236 @@
+#include "imageParticleSystem.h"
+
+
+ImageParticleSystem::ImageParticleSystem(int sceneSizeX, int sceneSizeY, ofImage fileImageHex, string imageName) {
+ this->imageToDraw = new DrawableImage(imageName, sceneSizeX, sceneSizeY);
+ this->imageHeight = imageToDraw->getHeight();
+ this->imageWidth = imageToDraw->getWidth();
+
+ this->sceneSizeX = sceneSizeX;
+ this->sceneSizeY = sceneSizeY;
+
+ this->fileImageHex = fileImageHex;
+
+ setAttractorsFromHexagonFromPicture();
+ maxParticle = 50;
+
+ setSymbolAttractorIsSet(true);
+ setCloudAttractorIsSet(false);
+ ticksToMoveImageToTop = 200;
+ counterToMoveImageToTop = 0;
+ fileImageCloud.loadImage("Hexagon.png");
+
+ imageReachedTopAndAttractorIsChanged = false;
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::updateParticleSystem() {
+
+ double deltaT = ofGetLastFrameTime();
+ time += deltaT;
+
+ if ((cloudAttractorIsSet == false) && (particles.size() < picPix / 7) && (this->imageToDraw->imageIsOnTop(sceneSizeY) == false)) { //Creating particles for symbol on bottom
+ createParticlesForHexagonInSymbol();
+ }
+ else if ((cloudAttractorIsSet == false) && (particles.size() < picPix / 7) && (this->imageToDraw->imageIsOnTop(sceneSizeY))) { //Creating particles for symbol in cloud
+ createParticlesForHexagonInCloud();
+ }
+ else if ((cloudAttractorIsSet == false) && (particles.size() > picPix / 7)) { //Deleting unused particles for hexagon on bottom
+
+ deleteParticlesForHexagon();
+ }
+ else if ((cloudAttractorIsSet == true) && (particles.size() > picPix / 7)) { //Deleting unused particles for rocketeffect
+
+ //deleteParticlesForRocketEffect();
+ }
+
+ //Movement
+ for (int p = 0; p < particles.size(); p++) {
+ if (p * 7 < attractors.size()) {
+ if (cloudAttractorIsSet == true) { //Movement at rocketeffect
+ particles.at(p)->updateParticle(deltaT, attractors[p * 7],
+ cloudAttractorIsSet, this->imageToDraw->imageIsOnTop(sceneSizeY), true, imageHeight, imageWidth, sceneSizeX, sceneSizeY);
+ }
+ else if (symbolAttractorIsSet == true) //Movement at Symbol at the bottom
+ {
+ particles.at(p)->updateParticle(deltaT, attractors[p * 7],
+ cloudAttractorIsSet, this->imageToDraw->imageIsOnTop(sceneSizeY), true, imageHeight, imageWidth, sceneSizeX, sceneSizeY);
+
+ if (this->imageToDraw->imageIsOnTop(sceneSizeY)) //Deleting the particle after they left scene at right
+ {
+ deleteParticleAfterLeavingOntheRightAndCreateThemOnTheLeft(p);
+ }
+ }
+ }
+ }
+
+ if (counterToMoveImageToTop < ticksToMoveImageToTop) { //Delay (every Frame) before the symbol and particle pass to the rocket effect
+ counterToMoveImageToTop++;
+
+ }
+ else if (counterToMoveImageToTop == ticksToMoveImageToTop) { //Symbol and particles do over in rocketeffect
+ changeAttractorImage(fileImageCloud);
+ setCloudAttractorIsSet(true);
+ }
+
+ if (this->imageToDraw->imageIsOnTop(sceneSizeY)) { //Symbol and particles reached max. y-position and attractor gets changed from rocketeffect to hexagon
+ setAttractorsFromHexagonFromPicture();
+ cloudAttractorIsSet = false;
+ }
+
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::createParticlesForHexagonInSymbol()
+{
+ int newPix = (picPix / 7) - particles.size();
+ for (int i = 1; i <= newPix; i++) { //Go through pixel i = 1 (there is no pixel 0)
+ particles.push_back(new Particle);
+
+ int x = sceneSizeX / 2;
+ int y = sceneSizeY;
+
+ particles.back()->setup(ofVec2f(x, y), 20);
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::createParticlesForHexagonInCloud()
+{
+ int newPix = (picPix / 7) - particles.size();
+ for (int i = 1; i <= newPix; i++) { //Go through pixel i = 1 (there is no pixel 0)
+ particles.push_back(new Particle);
+
+ int x = sceneSizeX / 2;
+ int y = imageToDraw->getImagePosY(sceneSizeY) + imageHeight;
+
+ particles.back()->setup(ofVec2f(x, y), 20);
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::deleteParticlesForRocketEffect()
+{
+ int newPix = (particles.size() - (picPix / 7));
+ for (int i = 0; i < newPix; i++) {
+ delete particles.at(0); //Deleting particle object
+ particles.erase(particles.begin()); //Deleting pointer to particle
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::deleteParticlesForHexagon()
+{
+ int newPix = (particles.size() - (picPix / 7));
+
+ for (int i = 0; i < newPix; i++) {
+ delete particles.at(0); //Deleting particle object
+ particles.erase(particles.begin()); //Deleting pointer to particle
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::deleteParticleAfterLeavingOntheRightAndCreateThemOnTheLeft(int p)
+{
+ bool particleToDelete = particles.at(p)->deleteAfterLeavingSceneX();
+
+ if (particleToDelete) {
+
+ delete particles.at(0); //Deleting particle object
+ particles.erase(particles.begin()); //Deleting pointer to particle
+
+ //Durchgehen ab Partikel i = 1 da es kein Pixel 0 gibt
+ particles.push_back(new Particle);
+
+ int x = -50;
+ int y = imageToDraw->getHeight();
+
+ particles.back()->setup(ofVec2f(x, y), 20);
+
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::changeAttractorImage(ofImage newAttractorImage) { //Attractor is changed between hexagon and cloud
+ attractors = pixelInVector(newAttractorImage);
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::setAttractorsFromHexagonFromPicture() { //Hexagon is attracot (pixel from hexagon get converted in attractors)
+ int picWidth = fileImageHex.getWidth();
+ int picHeight = fileImageHex.getHeight();
+ ofPixels pix;
+ pix = fileImageHex.getPixels();
+ vector pxPos;
+ picPix = 0;
+ for (int i = 3; i <= pix.size(); i += 4) { //i specifys that every fourth color information of the pixel is handled (rgba)
+ if (pix[i] > 0) {
+ int width = pix.getWidth();
+
+ int y = i / 4 / width;
+
+ int x = i / 4 % width;
+
+ ofVec2f vec;
+
+ vec.set(x + imageToDraw->getImagePosX(sceneSizeX), y + imageToDraw->getImagePosY(sceneSizeY)); //Gets position of image and so that the attractor follows movement
+ pxPos.push_back(vec);
+
+ picPix++;
+ }
+ }
+ attractors = pxPos;
+}
+
+//----------------------------------------------------------
+vector ImageParticleSystem::pixelInVector(ofImage a) { //Read in all the coloured pixels of image and vonvert them in vectors
+ int picWidth = a.getWidth();
+ int picHeight = a.getHeight();
+ ofPixels pix;
+ pix = a.getPixels();
+ vector pxPos;
+ picPix = 0;
+ for (int i = 3; i <= pix.size(); i += 4) { //i specifys that every fourth color information of the pixel is handled (rgba)
+ if (pix[i] > 0) {
+ int width = pix.getWidth();
+
+ int y = i / 4 / width;
+
+ int x = i / 4 % width;
+
+ ofVec2f vec;
+
+ vec.set(x + ((sceneSizeX / 2) - picWidth / 2), y - ((sceneSizeY)-picHeight - 7));
+ pxPos.push_back(vec);
+
+ picPix++;
+ }
+ }
+ return pxPos;
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::drawImageParticleSystem() { //Drawing of symbols and particles
+
+ imageToDraw->updateImage(sceneSizeX, sceneSizeY);
+
+ for (int i = 0; i < particles.size(); i++) {
+ particles.at(i)->draw();
+ }
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::setSymbolAttractorIsSet(bool value) {
+
+ imageToDraw->symbolAttractorIsSet = value;
+ symbolAttractorIsSet = value;
+}
+
+//----------------------------------------------------------
+void ImageParticleSystem::setCloudAttractorIsSet(bool value) {
+
+ imageToDraw->cloudAttractorIsSet = value;
+ cloudAttractorIsSet = value;
+}
+
+
diff --git a/src/imageParticleSystem.h b/src/imageParticleSystem.h
new file mode 100644
index 0000000..e25f471
--- /dev/null
+++ b/src/imageParticleSystem.h
@@ -0,0 +1,64 @@
+#ifndef imageParticleSystem_h
+#define imageParticleSystem_h
+#pragma once
+
+#include "ofMain.h"
+#include "ofxCv.h"
+#include "ofxOpenCv.h"
+#include "particle.h"
+#include "drawableImage.h"
+#include
+
+class ImageParticleSystem
+{
+
+public:
+
+ ImageParticleSystem(int sceneSizeX, int sceneSizeY, ofImage fileImageHex, string imageName);
+ ~ImageParticleSystem();
+
+ vectorattractors;
+ vector particles;
+ ofImage fileImageHex;
+ ofImage fileImageCloud;
+
+ int sceneSizeX;
+ int sceneSizeY;
+ int imageHeight;
+ int imageWidth;
+ int maxParticle;
+ int picPix;
+ int k;
+ int ticksToMoveImageToTop;
+ int counterToMoveImageToTop;
+ int status;
+ bool tornadoStarted;
+ bool editingWarp;
+ bool imageReachedTopAndAttractorIsChanged;
+ float birthCnt;
+ float maxLife;
+ float parAmount;
+ float height;
+ double time;
+ double tornadoStartTime;
+
+ void updateParticleSystem();
+ void deleteParticlesForRocketEffect();
+ void deleteParticlesForHexagon();
+ void createParticlesForHexagonInSymbol();
+ void createParticlesForHexagonInCloud();
+ void deleteParticleAfterLeavingOntheRightAndCreateThemOnTheLeft(int p);
+ void drawImageParticleSystem();
+ void setSymbolAttractorIsSet(bool value);
+ void setCloudAttractorIsSet(bool value);
+ void changeAttractorImage(ofImage newAttractorImage);
+
+private:
+ DrawableImage* imageToDraw;
+ vector pixelInVector(ofImage a);
+ void setAttractorsFromHexagonFromPicture();
+ bool symbolAttractorIsSet;
+ bool cloudAttractorIsSet;
+};
+#endif
+#pragma once
diff --git a/src/main.cpp b/src/main.cpp
index f73817a..affb9c1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,11 +5,13 @@
//========================================================================
int main( ){
- ofSetupOpenGL(1000,1000, OF_WINDOW); // <-------- setup the GL context
+ ofGLFWWindowSettings settings;
+ settings.setGLVersion(3, 2);
+ settings.setSize(1280, 800);
+ ofCreateWindow(settings);
+ ofSetupOpenGL(1000, 1000, OF_WINDOW); // <-------- setup the GL context
+ ofRunApp(new ofApp());
+
- // this kicks off the running of my app
- // can be OF_WINDOW or OF_FULLSCREEN
- // pass in width and height too:
- ofRunApp( new ofApp());
}
diff --git a/src/objectPhysics.cpp b/src/objectPhysics.cpp
index 089b6d3..ed5fdce 100644
--- a/src/objectPhysics.cpp
+++ b/src/objectPhysics.cpp
@@ -5,7 +5,7 @@
// Created by Sebastian Holzki on 11.06.19.
//
-#include "objectPhysics.hpp"
+#include "objectPhysics.h"
@@ -34,17 +34,6 @@ Attraktor::Attraktor(){
};
-// -----------------------------------
-
-
-
-
-
-
-
-
-
-
// -----------------------------------
diff --git a/src/objectPhysics.hpp b/src/objectPhysics.h
similarity index 92%
rename from src/objectPhysics.hpp
rename to src/objectPhysics.h
index 1e3cfe2..130c343 100644
--- a/src/objectPhysics.hpp
+++ b/src/objectPhysics.h
@@ -1,16 +1,16 @@
//
-// objectPhysics.hpp
+// objectPhysics.h
// emptyExample
//
// Created by Sebastian Holzki on 01.05.19.
//
-#ifndef objectPhysics_hpp
-#define objectPhysics_hpp
+#ifndef objectPhysics_h
+#define objectPhysics_h
#include
#include "ofMain.h"
-#endif /* objectPhysics_hpp */
+#endif /* objectPhysics_h */
class ObjectPhysics {
diff --git a/src/ofApp.cpp b/src/ofApp.cpp
index dd63115..2f7d223 100644
--- a/src/ofApp.cpp
+++ b/src/ofApp.cpp
@@ -6,220 +6,342 @@
//--------------------------------------------------------------
-void ofApp::setup(){
-
- VISITOR_COUNT = 0;
- VISITOR_COUNT_LASTFRAME = 0;
- PARTICLE_COUNT = 0;
-
-
- for (int i = 0; i < particleSystems.size(); i++){
+void ofApp::setup() {
+
+ currentImage = -1;
+ ofDisableArbTex();
+ ofBackground(0);
+
+ //test image
+ img.setUseTexture(false);
+ if (!img.load("testcard.png"))
+ {
+ ofLogError("ofApp::setup") << "Could not load image!";
+ return;
+ }
+
+ this->tex.enableMipmap();
+ this->tex.loadData(img.getPixels());
+
+ //scene properties
+ sceneSize.set(1280, 800);
+ area.set(0, 0, sceneSize.x, sceneSize.y);
+ fbo.allocate(sceneSize.x, sceneSize.y, GL_RGBA);
+
+ //clear fbo to make sure there's no scrap
+ fbo.begin();
+ ofClear(0);
+ fbo.end();
+
+ //load warp settings from file if present
+ //this->warpController.loadSettings("settings.json");
+
+ //if there is no file, generate warp
+ if (this->warpController.getWarps().empty())
+ {
+ std::shared_ptr warp;
+
+ warp = this->warpController.buildWarp();
+ warp->setSize(sceneSize.x, sceneSize.y);
+ warp->setEdges(glm::vec4(0.0f, 0.0f, 1.0f, 1.0f));
+ }
+
+ editingWarp = false;
+
+ //testing stuff
+ ofSetCircleResolution(60);
+ ofSetBackgroundColor(0, 0, 0);
+ //ofSetFrameRate(60);
+
+ fileImageHex.loadImage("Hexagon.png");
+
+ //rainIsActive = true;
+ //int particleSystemsForStele = 7; //number of rainparticlesystems (one for single stele)
+ //float sceneSizeForSingleParticleSystem = sceneSize.x / particleSystemsForStele; //calculate the widht for every single rainparticlesystem
+ //for (int i = 0; i <= particleSystemsForStele - 1; i++) { //create all rainparticlesystem
+ // rainParticleSyst.push_back(new RainParticleSystem(i * sceneSizeForSingleParticleSystem, sceneSizeForSingleParticleSystem, sceneSize.y));
+ //}
+ VISITOR_COUNT = 0;
+ VISITOR_COUNT_LASTFRAME = 0;
+ PARTICLE_COUNT = 0;
- }
-
-
- // *** OSC Setup *** OSC Setup *** OSC Setup ***
-
- receiver.setup(PORT);
+
+ // *** OSC Setup *** OSC Setup *** OSC Setup ***
+
+ receiver.setup(PORT);
}
//--------------------------------------------------------------
-void ofApp::update(){
-
-
- // *** OSC RECEIVER *** OSC RECEIVER *** OSC RECEIVER ***
-
-
- /*
-
- Here the program will read and convert the information from the tracking, count them & put coordinates of people entering the ground.
- We have to define, how this information will affect the particleSystems!
-
- -Create message, put the stuff from the received OSC in it
- -duplicate the msg as string to enable onscreen supervision
- -There will be a global visitor count called VISITOR_COUNT
- -Use VISITOR_COUNT to correctly update the size of the visitors vector
- -Iterate trough Message-values and put information in the visitors vector
-
- */
-
-
-
- while(receiver.hasWaitingMessages()){
-
- ofxOscMessage visitorInformations;
- receiver.getNextMessage(&visitorInformations);
-
- oscMsg = ofToString(visitorInformations);
-
- if(visitorInformations.getAddress() == "/centroidsOfBlob") {
-
- VISITOR_COUNT_LASTFRAME = VISITOR_COUNT;
- VISITOR_COUNT = visitorInformations.getArgAsInt(0); //update the number of Visitors from OSCs first Argument, which is the number of blobs (detected Contours)
-
-
-
+void ofApp::update() {
+
+
+
+ // *** OSC RECEIVER *** OSC RECEIVER *** OSC RECEIVER ***
+
+
+ /*
+
+ Here the program will read and convert the information from the tracking, count them & put coordinates of people entering the ground.
+ We have to define, how this information will affect the particleSystems!
+
+ -Create message, put the stuff from the received OSC in it
+ -duplicate the msg as string to enable onscreen supervision
+ -There will be a global visitor count called VISITOR_COUNT
+ -Use VISITOR_COUNT to correctly update the size of the visitors vector
+ -Iterate trough Message-values and put information in the visitors vector
+
+ */
+
+
+
+ while (receiver.hasWaitingMessages()) {
+
+ ofxOscMessage visitorInformations;
+ receiver.getNextMessage(&visitorInformations);
+
+ oscMsg = ofToString(visitorInformations);
+
+ if (visitorInformations.getAddress() == "/centroidsOfBlob") {
+
+ VISITOR_COUNT_LASTFRAME = VISITOR_COUNT;
+ VISITOR_COUNT = visitorInformations.getArgAsInt(0); //update the number of Visitors from OSCs first Argument, which is the number of blobs (detected Contours)
+
+
+
// *** CHECK FOR CHANGES IN THE NUMBER OF VISITORS *** CHECK FOR CHANGES IN THE NUMBER OF VISITORS *** CHECK FOR CHANGES IN THE NUMBER OF VISITORS ***
-
-
+
+
// If there are MORE visitors now, add the difference to the visitors vector
-
-
- if(VISITOR_COUNT > VISITOR_COUNT_LASTFRAME){
-
- for(int i = 0; i < (VISITOR_COUNT - VISITOR_COUNT_LASTFRAME); i++){
-
- visitors.push_back(new Visitor);
-
- }
- }
-
-
-// If there are LESS visitors now, delete the difference from the visitors vector
-
-
- if(VISITOR_COUNT < VISITOR_COUNT_LASTFRAME){
-
- for(int i = 0; i < (VISITOR_COUNT_LASTFRAME - VISITOR_COUNT); i++){
-
- delete visitors.at(visitors.size()); //maybe nicht zulässig, weil fehleranfällig???
- //erase ergänzen!
- }
-
- }
-
-
-// *** TRANSFER TRACKING-INFORMATION INTO VISITOR-CLASS *** TRANSFER TRACKING-INFORMATION INTO VISITOR-CLASS ***
-
-
- for(int i = 1; i <= VISITOR_COUNT; i++){
-
- //put Information into visitors
-
- float xOfVisitor = visitorInformations.getArgAsFloat(i * 2 - 1) * ofGetWindowWidth();
- float yOfVisitor = visitorInformations.getArgAsFloat(i * 2) * ofGetWindowHeight();
-
- visitors.at( i - 1 )->setPosition(xOfVisitor, yOfVisitor);
-
- }
-
- } //end of .getAddress() == "/centroidsOfBlob")
-
- } //end of receiver.hasWaitingMessages
-
-
-
-
-
-
- // *** RFID Input *** RFID Input *** RFID Input *** RFID Input *** RFID Input ***
-
- /*
-
-
-
- Here we have to define, how the particleSystems react to RFID input.
- Read ID of a visitor and let the particlesystems react to it.
-
- !!! Here in ofApp.cpp there will only be the transfer of incoming information about IDs, playertypes, etc. into the update-methods of the particleSystems. !!!
-
- For example:
-
- - Tell all particleSystems about a new checkedIn-Visitor
- - Set the playerType of one particular particleSystem to the checked in.
-
- */
-
-
-
- // *** MAIN UPDATE PARTICLE SYSTEMS *** MAIN UPDATE PARTICLE SYSTEMS *** MAIN UPDATE PARTICLE SYSTEMS ***
-
-
- for (int p = 0; p < particleSystems.size();)
- {
- // Update particle systems
-
-// particleSystems.at(p)->update("xxx , xxx , xxx , .... ");
-
-
- }
-
-
-
-} //end of update()
+ if (VISITOR_COUNT > VISITOR_COUNT_LASTFRAME) {
+
+ for (int i = 0; i < (VISITOR_COUNT - VISITOR_COUNT_LASTFRAME); i++) {
+
+ visitors.push_back(new Visitor);
+
+ }
+ }
+
+
+ // If there are LESS visitors now, delete the difference from the visitors vector
+
+
+ if (VISITOR_COUNT < VISITOR_COUNT_LASTFRAME) {
+
+ for (int i = 0; i < (VISITOR_COUNT_LASTFRAME - VISITOR_COUNT); i++) {
+
+ delete visitors.at(visitors.size()); //maybe nicht zulässig, weil fehleranfällig???
+ //erase ergänzen!
+ }
+
+ }
+
+
+ // *** TRANSFER TRACKING-INFORMATION INTO VISITOR-CLASS *** TRANSFER TRACKING-INFORMATION INTO VISITOR-CLASS ***
+
+
+ for (int i = 1; i <= VISITOR_COUNT; i++) {
+
+ //put Information into visitors
+
+ float xOfVisitor = visitorInformations.getArgAsFloat(i * 2 - 1) * ofGetWindowWidth();
+ float yOfVisitor = visitorInformations.getArgAsFloat(i * 2) * ofGetWindowHeight();
+
+ visitors.at(i - 1)->setPosition(xOfVisitor, yOfVisitor);
+
+ }
+
+ } //end of .getAddress() == "/centroidsOfBlob")
+
+ } //end of receiver.hasWaitingMessages
+
+
+
+
+
+
+ // *** RFID Input *** RFID Input *** RFID Input *** RFID Input *** RFID Input ***
+
+ /*
+
+
+
+ Here we have to define, how the particleSystems react to RFID input.
+ Read ID of a visitor and let the particlesystems react to it.
+
+ !!! Here in ofApp.cpp there will only be the transfer of incoming information about IDs, playertypes, etc. into the update-methods of the particleSystems. !!!
+
+ For example:
+
+ - Tell all particleSystems about a new checkedIn-Visitor
+ - Set the playerType of one particular particleSystem to the checked in.
+
+ */
+
+
+
+ // *** MAIN UPDATE PARTICLE SYSTEMS *** MAIN UPDATE PARTICLE SYSTEMS *** MAIN UPDATE PARTICLE SYSTEMS ***
+
+
+ for (int p = 0; p < particleSystems.size();)
+ {
+ // Update particle systems
+
+ // particleSystems.at(p)->update("xxx , xxx , xxx , .... ");
+
+
+ }
+
+ if (rainIsActive) { //Movement of the particles of the rainparticlesystems
+ for (int i = 0; i < rainParticleSyst.size(); i++) {
+ rainParticleSyst.at(i)->updateParticleSystem();
+ }
+ }
+ else if (!rainIsActive){ //Movement of Imageparticlesystems and symbols when rain is false
+ for (int i = 0; i < imageParticleSystems.size(); i++) {
+ imageParticleSystems.at(i)->updateParticleSystem();
+ }
+ }
+
+
+
+
+}
//--------------------------------------------------------------
-void ofApp::draw(){
-
-
- //draw all ParticleSystems that are in the particleSystems vector
-
- for(int p = 0; p < particleSystems.size(); p++)
- {
- particleSystems.at(p)->draw();
- }
-
+void ofApp::exit() {
+ //save warp settings on exit
+ this->warpController.saveSettings("settings.json");
+}
+
+//--------------------------------------------------------------
+void ofApp::draw() {
+
+
+ fbo.begin();
+ ofClear(0, 0, 0);
+ //draw stuff here
+
+ //ofDrawRectangle(0, 0, 800, 800);
+ //ofDrawCircle(sceneSize.x *.5, sceneSize.y * .5, 300);
+
+ for (int p = 0; p < particleSystems.size(); p++)
+ {
+ particleSystems.at(p)->draw();
+ }
+
+
+ if (rainIsActive) { //drawing the rainparticlesystems
+ for (int i = 0; i < rainParticleSyst.size(); i++) {
+ rainParticleSyst.at(i)->drawRainParticleSystem();
+ }
+ }
+ else if (!rainIsActive) { //drawing the imageparticlesystems
+ for (int i = 0; i < imageParticleSystems.size(); i++) {
+ imageParticleSystems.at(i)->drawImageParticleSystem();
+ }
+ }
+
+ //draw all ParticleSystems that are in the particleSystems vector
+
+
+ fbo.end();
+
+ //do not draw past this point
+ //draw warp
+ warpController.getWarp(0)->begin();
+ fbo.draw(0, 0);
+
+ warpController.getWarp(0)->end();
}
//--------------------------------------------------------------
-void ofApp::keyPressed(int key){
+void ofApp::keyPressed(int key) {
}
//--------------------------------------------------------------
-void ofApp::keyReleased(int key){
+void ofApp::keyReleased(int key) {
+ if (key == 'f') //fullscreen
+ {
+ ofToggleFullscreen();
+ }
+
+ if (key == 'e') { //Mapping
+ editingWarp = !editingWarp;
+ warpController.getWarp(0)->setEditing(editingWarp);
+ }
+
+ //read in the single images and hand over all initial values
+ switch (key) {
+ case '1':
+ imageParticleSystems.push_back(new ImageParticleSystem(sceneSize.x, sceneSize.y, fileImageHex, "PktUmweltTechnik.png"));
+ rainIsActive = false;
+ currentImage++;
+ break;
+
+ case '2':
+ imageParticleSystems.push_back(new ImageParticleSystem(sceneSize.x, sceneSize.y, fileImageHex, "PktAlltagTechnikUmwelt.png"));
+ rainIsActive = false;
+ currentImage++;
+ break;
+
+ case '3':
+ imageParticleSystems.push_back(new ImageParticleSystem(sceneSize.x, sceneSize.y, fileImageHex, "PktAlltagWissenschaftUmwelt.png"));
+ rainIsActive = false;
+ currentImage++;
+ break;
+ }
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseMoved(int x, int y) {
}
//--------------------------------------------------------------
-void ofApp::mouseMoved(int x, int y){
+void ofApp::mouseDragged(int x, int y, int button) {
}
//--------------------------------------------------------------
-void ofApp::mouseDragged(int x, int y, int button){
+void ofApp::mousePressed(int x, int y, int button) {
}
//--------------------------------------------------------------
-void ofApp::mousePressed(int x, int y, int button){
+void ofApp::mouseReleased(int x, int y, int button) {
}
//--------------------------------------------------------------
-void ofApp::mouseReleased(int x, int y, int button){
+void ofApp::mouseEntered(int x, int y) {
}
//--------------------------------------------------------------
-void ofApp::mouseEntered(int x, int y){
+void ofApp::mouseExited(int x, int y) {
}
//--------------------------------------------------------------
-void ofApp::mouseExited(int x, int y){
+void ofApp::windowResized(int w, int h) {
}
//--------------------------------------------------------------
-void ofApp::windowResized(int w, int h){
+void ofApp::gotMessage(ofMessage msg) {
}
//--------------------------------------------------------------
-void ofApp::gotMessage(ofMessage msg){
-
-}
-
-//--------------------------------------------------------------
-void ofApp::dragEvent(ofDragInfo dragInfo){
+void ofApp::dragEvent(ofDragInfo dragInfo) {
}
diff --git a/src/ofApp.h b/src/ofApp.h
index 1259f1c..a3cb108 100644
--- a/src/ofApp.h
+++ b/src/ofApp.h
@@ -1,17 +1,25 @@
#pragma once
-#include "ofMain.h"
-#include "particleSystem.hpp"
-#include "greatWhole.hpp"
-#include "avatar.hpp"
-#include "ofxOsc.h"
-#include "visitor.hpp"
-#include "objectPhysics.hpp"
-#include "particle.hpp"
+#include "ofxWarp.h"
-
- int WINDOWSIZE_WIDTH = 1000;
- int WINDOWSIZE_HEIGHT = 1000;
+#include "particle.h"
+#include "drawableImage.h"
+#include "imageParticleSystem.h"
+#include "rainParticleSystem.h"
+#include "ofMain.h"
+#include "particleSystem.h"
+#include "avatar.h"
+#include "ofxOsc.h"
+#include "visitor.h"
+#include "objectPhysics.h"
+#include "particle.h"
+#include "ofxOpenCv.h"
+#include "ofTrueTypeFont.h"
+#include "ofxCv.h"
+
+
+//int WINDOWSIZE_WIDTH = 1000;
+//int WINDOWSIZE_HEIGHT = 1000;
@@ -21,62 +29,93 @@
#define PORT 12345
#define HOST "xxx.xxx.xxx.xxx"
-
-class ofApp : 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 mouseEntered(int x, int y);
- void mouseExited(int x, int y);
- void windowResized(int w, int h);
- void dragEvent(ofDragInfo dragInfo);
- void gotMessage(ofMessage msg);
-
-
- int PARTICLE_COUNT;
- //+1 for every new Particle, -1 for every Particle that gets older than the defined maxLife
- int VISITOR_COUNT;
- //the visitor count will be fed with the nBlobs-value from incoming OSC messages
- int VISITOR_COUNT_LASTFRAME;
+
+class ofApp : public ofBaseApp {
+
+public:
+
+ void setup();
+ void update();
+ void draw();
+ void exit();
+ 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 mouseEntered(int x, int y);
+ void mouseExited(int x, int y);
+ void windowResized(int w, int h);
+ void dragEvent(ofDragInfo dragInfo);
+ void gotMessage(ofMessage msg);
+
+
+ int PARTICLE_COUNT;
+ //+1 for every new Particle, -1 for every Particle that gets older than the defined maxLife
+ int VISITOR_COUNT;
+ //the visitor count will be fed with the nBlobs-value from incoming OSC messages
+ int VISITOR_COUNT_LASTFRAME;
+
-
private:
-
- // *** OSC *** OSC *** OSC ***
-
- string oscMsg;
- ofxOscReceiver receiver;
- float timeSent, timeReceived;
-
-
- //Information about what is going on in the scene
-
- int nBlobs; //count of the tracked visitors
-
-
-
-
-
- vector visitors;
-
- vector particleSystems;
-
- GreatWhole dasGrosseGanze;
-
-
+
+ // *** OSC *** OSC *** OSC ***
+
+ string oscMsg;
+ ofxOscReceiver receiver;
+ float timeSent, timeReceived;
+
+
+ //Information about what is going on in the scene
+
+ int nBlobs; //count of the tracked visitors
+
+ // *** warp *** warp
+ ofxWarpController warpController;
+ ofTexture tex;
+ ofRectangle area;
+ ofVec2f sceneSize;
+ ofVec2f force;
+
+ ofImage img;
+ ofImage fileImageHex;
+ ofImage imageToDraw;
+
+ ofImage drawImage;
+
+ ofColor color;
+
+ ofFbo fbo;
+
+ vectorattractors;
+ vector system;
+
+ vector imageParticleSystems;
+ vector rainParticleSyst;
+
+ int currentImage;
+ int maxParticle;
+ int picPix;
+ int k;
+ int ticksToMoveParticlesToRight;
+ int counterToMoveParticlesToRight;
+ bool rainIsActive;
+ bool editingWarp;
+
+
+
+
+
+ vector visitors;
+
+ vector particleSystems;
+
+
+
};
diff --git a/src/particle.cpp b/src/particle.cpp
index 1c51d0c..0b7e980 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -5,101 +5,278 @@
// Created by Sebastian Holzki on 16.04.19.
//
-#include "particle.hpp"
+#include "particle.h"
Particle::Particle()
{
-
-
+
+
}
// -----------------------------------
Particle::~Particle()
{
-
-
-}
-
-// -----------------------------------
-
-void Particle::setup(ofVec2f _position){
-
- this->position = _position;
-
- velocity.set(0,0);
- age = 0.0;
- maxLife = 12.0;
-
- color.set(250,250,250);
- size = 2.0;
- mass = 100;
-
-}
-
-// -----------------------------------
-
-void Particle::update(float deltaT){
-
-
-
-
-
}
// -----------------------------------
-void Particle::draw(){
+void Particle::setup(ofVec2f pos, float maxAge) {
- ofDrawCircle(position,size);
-
+ this->position = pos; //Pointer to Position ofVec2f position
+
+ velocity.set(0, 0);
+ //vel.set(ofRandom(-20.0, 20.0), ofRandom(-90, -100)); //Movement direction
+ age = 0.0;
+ maxLife = 12.0;
+ //maxLife = ofRandom(maxAge - 5, maxAge); //Max life of a particle
+ color.set(5, 241, 219);
+ //size = 2.0;
+ //mass = 100;
+ size = ofRandom(4.0, 0.01);
+ mass = ofRandom(100, 250); //Changes the particle velocity
+ valueToMoveToTop = 0; //Counter which causes the particle and the attractor to move to top
+ valueToMoveToRight = 0; //Counter which causes the particle and the attractor to move to right
+ ticksToMoveParticlesToRight = 70; //Framerate for movement velocity
+ counterToMoveParticlesToRight = 0; //Counter for delay on top
+ particleLeftScene = false; //Particle are out of ScenesizeX on the right side
+
+}
+
+
+// -----------------------------------
+
+void Particle::update(float deltaT) {
+
+}
+
+// --------------------------------------------------------------------------------
+
+void Particle::updateParticle(double deltaT, ofVec2f attractor, bool cloudAttractorIsSet, bool imageIsOnTop, bool tornadoIsFinished, int imageHeight, int imageWidth, float sceneSizeX, float sceneSizeY) {
+
+ //Movement of particle in the different settings
+
+ //doMovementOfParticlesAtRain(tornadoIsFinished, deltaT, sceneSizeX);
+
+ if (cloudAttractorIsSet == true) {
+ doMovementOfParticlesAtRocketEffect(sceneSizeY, imageHeight, imageWidth, sceneSizeX, attractor, deltaT);
+ }
+
+ if (tornadoIsFinished == true && cloudAttractorIsSet == false) {
+ doMovementOfParticlesAtSymbols(deltaT, attractor);
+ }
+
+ if (imageIsOnTop == true) {
+ doMovementOfHexagonOnTheTop(attractor, sceneSizeX, deltaT);
+ }
+
+}
+
+//--------------------------------------------------------------
+void Particle::doMovementOfParticlesAtRain(bool tornadoIsFinished, double deltaT, float sceneSizeX)
+{
+ if (tornadoIsFinished == false) { //Movement of partile from bottom to top
+ position += vel * deltaT;
+ age += deltaT;
+
+ if (position.x >= sceneSizeX) {
+ position.x = ofRandom(-1, -5);
+ }
+ }
+}
+
+//--------------------------------------------------------------
+void Particle::doMovementOfParticlesAtSymbols(double deltaT, ofVec2f &attractor)
+{
+ valueToMoveToTop = 0;
+ valueToMoveToRight = 0;
+ counterToMoveParticlesToRight = 0;
+
+ age += deltaT;
+ vel *= 0.1;
+ ofVec2f force = attractor - position; //Attraction
+
+ if (50 < force.length() < 150) { //Movement of the particle which is located at a radius of 50 to 150 around the attractor
+ force = 10 * force.getNormalized();
+
+ vel += force; //Movement to attractor
+ vel = mass * vel.getNormalized();
+ }
+ else if (150 < force.length() < 500) { //Movement of the particle which is located at a radius of 150 to 500 around the attractor
+ force = 8 * force.getNormalized();
+
+ vel += force;
+ vel = mass * vel.getNormalized();
+ }
+ else { //Movement of the particle which is located at a radius more than 500 around the attractor
+ force = 2 * force.getNormalized();
+ vel += force;
+ vel = mass / 1.2* vel.getNormalized();
+ }
+ position += (vel / 1.5 * deltaT); //Position = m/s * s [particle placed static]
+}
+
+//--------------------------------------------------------------
+void Particle::doMovementOfParticlesAtRocketEffect(float sceneSizeY, int imageHeight, int imageWidth, float sceneSizeX, ofVec2f &attractor, double deltaT)
+{
+ int y = ((sceneSizeY / 2) + imageHeight); //Beginning height for attractor
+ int x = ofRandom(sceneSizeX / 2 - imageWidth / 2, sceneSizeX / 2 + imageWidth / 2); //Width for attractor
+
+ if (y - valueToMoveToTop - imageHeight > 200) { //Increase counter depending on velocity for movement to top
+ valueToMoveToTop += 3; //Movement by 3 to top (pro Frame)
+ }
+ else if (y - valueToMoveToTop - imageHeight > 10) { //Increase counter depending on velocity for movement to top
+ valueToMoveToTop += 2; //Movement by 3 to top (pro Frame)
+
+ }
+
+ else if (counterToMoveParticlesToRight < ticksToMoveParticlesToRight) { //Delay on top
+ counterToMoveParticlesToRight++;
+ }
+ else if (y - valueToMoveToTop - imageHeight <= 10) { //Increase counter depending on velocity for movement to right( Movement by 3 to right (pro Frame))
+ valueToMoveToRight += 3;
+ }
+
+ attractor.set(x + valueToMoveToRight, y - valueToMoveToTop);
+
+
+ age += deltaT;
+ vel *= 0.1;
+ ofVec2f force = (attractor - position); //Attraction
+
+ if (30 < force.length() < 150) { //Movement of the particle which is located at a radius of 30 to 150 around the attractor
+ force = 17 * force.getNormalized();
+
+ vel += force; //Movement to attractor
+ vel = (mass / 1.2) * vel.getNormalized(); //Particle don't pass the symbol
+ }
+ else if (150 < force.length() < 250) { //Movement of the particle which is located at a radius of 150 to 250 around the attractor
+ force = 14 * force.getNormalized();
+
+ vel += force;
+ vel = mass * 10 * vel.getNormalized();
+ }
+ else if (250 < force.length() < 500) { //Movement of the particle which is located at a radius of 250 to 500 around the attractor
+ force = 14 * force.getNormalized();
+
+ vel += force;
+ vel = mass * 4 * vel.getNormalized();
+ }
+ else { //Movement of the particle which is located at a radius more than 500 around the attractor
+ force = 20 * force.getNormalized();
+ vel += force;
+ vel = mass * vel.getNormalized();
+ }
+ position += (vel / 1.7 * deltaT); //Position = m/s * s [particle placed static]
+}
+
+//--------------------------------------------------------------
+void Particle::doMovementOfHexagonOnTheTop(ofVec2f &attractor, float sceneSizeX, double deltaT)
+{
+ if (attractor.x + valueToMoveToRight >= sceneSizeX + 120) {
+ particleLeftScene = true;
+ }
+ else {
+ particleLeftScene = false;
+ }
+ age += deltaT;
+ vel *= 0.1;
+ ofVec2f force = attractor - position; //Attraction
+
+ if (50 < force.length() < 150) { //Movement of the particle which is located at a radius of 50 to 150 around the attractor
+ force = 60 * force.getNormalized(); //Anziehungskraft des Attraktors auf die Partikel
+
+ vel += force; //Bewegung zum Attraktor
+ vel = mass * vel.getNormalized();
+ }
+ else { //Movement of the particle which is located at a radius of more than 150 around the attractor
+ force = 100 * force.getNormalized();
+
+ vel += force;
+ vel = mass / 2 * vel.getNormalized();
+ }
+ position += (vel * deltaT); //Position = m/s * s [particle placed static]
+}
+
+// -----------------------------------
+
+void Particle::draw() {
+ if (position.x > 0 || position.x < 300) {
+ ofSetColor(this->color); //To make particle turquoise
+ color.set(getAgeNorm() * 241, 241 / getAgeNorm(), 219); //Color (Disco)
+ }
+ else {
+ ofSetColor(255, 255, 255);
+
+ }
+ ofDrawCircle(position, size);
+
+}
+
+
+//--------------------------------------------------------------
+float Particle::getAgeNorm() {
+ return age / maxLife;
+}
+
+//--------------------------------------------------------------
+float Particle::deleteAfterLeavingSceneY() {
+ return position.y < 0 || position.y > ofGetHeight();
+}
+
+//--------------------------------------------------------------
+bool Particle::deleteAfterLeavingSceneX() {
+ return particleLeftScene;
+}
+
+//------------------------------------------------------------------
+void Particle::setMode(particleMode newMode) {
+ mode = newMode;
}
//-----------------------------------
-float Particle::getMaxLife(){
-
- return maxLife;
-
+float Particle::getMaxLife() {
+
+ return maxLife;
}
//-----------------------------------
-float Particle::getAge(){
-
- return age;
-
+float Particle::getAge() {
+
+ return age;
}
//-----------------------------------
-void Particle::mapParticle(){
-
- /*
- Put an if Statement before it:
-
- if(borderCollission == true){mapParticle()}
-
-
- The particle will be mapped to a new position, using information about:
-
- - old position
- - velocity (direction)
- - defined borders in the projection --> globals like window size, angle between "stelen", width of stelen, etc.
-
- if the particle hits a border
-
-
- */
-
-
+void Particle::mapParticle() {
+
+ /*
+ Put an if Statement before it:
+
+ if(borderCollission == true){mapParticle()}
+
+
+ The particle will be mapped to a new position, using information about:
+
+ - old position
+ - velocity (direction)
+ - defined borders in the projection --> globals like window size, angle between "stelen", width of stelen, etc.
+
+ if the particle hits a border
+
+
+ */
+
+
}
diff --git a/src/particle.h b/src/particle.h
new file mode 100644
index 0000000..bcd5399
--- /dev/null
+++ b/src/particle.h
@@ -0,0 +1,78 @@
+#ifndef particle_h
+#define particle_h
+#pragma once
+
+#include "ofMain.h"
+#include "ofxCv.h"
+#include "ofxXmlSettings.h"
+#include "ofxOpenCv.h"
+#include
+
+
+enum particleMode {
+
+};
+
+class Particle {
+
+public:
+
+ Particle();
+ ~Particle();
+
+ void update(float deltaT);
+ void draw();
+ void mapParticle();
+ void setup(ofVec2f pos, float maxAge);
+ void updateParticle(double deltaT, ofVec2f attractor, bool cloudAttractorIsSet, bool imageIsOnTop, bool tornadoIsFinished, int imageHeight, int imageWidth, float sceneSizeX, float sceneSizeY);
+ void doMovementOfParticlesAtRain(bool tornadoIsFinished, double deltaT, float sceneSizeX);
+ void doMovementOfParticlesAtSymbols(double deltaT, ofVec2f &attractor);
+ void doMovementOfParticlesAtRocketEffect(float sceneSizeY, int imageHeight, int imageWidth, float sceneSizeX, ofVec2f &attractor, double deltaT);
+ void doMovementOfHexagonOnTheTop(ofVec2f &attractor, float sceneSizeX, double deltaT);
+ void setMode(particleMode newMode);
+
+ float getMaxLife();
+ float getAge();
+ float getAgeNorm();
+ bool borderCollission();
+
+ ofVec2f vel;
+ ofVec2f velocity2;
+ ofVec2f force;
+
+ particleMode mode;
+
+ float deleteAfterLeavingSceneY();
+ bool deleteAfterLeavingSceneX();
+ bool pL;
+ bool particleLeftScene;
+
+ int valueToMoveToTop;
+ int valueToMoveToRight;
+ int ticksToMoveParticlesToRight;
+ int counterToMoveParticlesToRight;
+
+
+
+
+
+
+private:
+
+ ofVec2f velocity;
+ ofVec2f position;
+
+ float maxLife;
+ float age;
+ float size;
+ float mass;
+
+ ofColor color;
+
+
+ int stele;
+ //on which "stele" is the particle? --> will affect the movement (mapping), when it reaches borders of its "stele" !
+ //if border 1/2/3/4 (<,>,v,^), then map particle
+
+};
+#endif
diff --git a/src/particle.hpp b/src/particle.hpp
deleted file mode 100644
index 9f9ecf2..0000000
--- a/src/particle.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// particle.hpp
-//
-// Created by Sebastian Holzki on 16.04.19.
-//
-
-#pragma once
-#include
-#include "ofMain.h"
-
-
-
-
-
-class Particle {
-
-public:
-
- Particle();
- ~Particle();
-
- void setup(ofVec2f position);
- void update(float deltaT);
- void draw();
-
- float getMaxLife();
- float getAge();
- float getAgeNorm();
-
-
- void mapParticle();
- bool borderCollission();
-
-
-
-
-private:
-
- ofVec2f velocity;
- ofVec2f position;
-
- float maxLife;
- float age;
- float size;
- float mass;
-
- ofColor color;
-
-
- int stele;
- //on which "stele" is the particle? --> will affect the movement (mapping), when it reaches borders of its "stele" !
- //if border 1/2/3/4 (<,>,v,^), then map particle
-
-};
diff --git a/src/particleSystem.cpp b/src/particleSystem.cpp
index 33110dc..617be0e 100644
--- a/src/particleSystem.cpp
+++ b/src/particleSystem.cpp
@@ -5,7 +5,7 @@
// Created by Sebastian Holzki on 16.04.19.
//
-#include "particleSystem.hpp"
+#include "particleSystem.h"
diff --git a/src/particleSystem.hpp b/src/particleSystem.h
similarity index 85%
rename from src/particleSystem.hpp
rename to src/particleSystem.h
index 326fb5b..323f4e9 100644
--- a/src/particleSystem.hpp
+++ b/src/particleSystem.h
@@ -1,5 +1,5 @@
//
-// particleSystem.hpp
+// particleSystem.h
// emptyExample
//
// Created by Sebastian Holzki on 16.04.19.
@@ -10,7 +10,7 @@
#include
-#include "particle.hpp"
+#include "particle.h"
@@ -41,9 +41,9 @@ private:
vector particles;
- //adresses of the active emitters and attractors
-// vector attractors;
-// vector emitters;
+// adresses of the active emitters and attractors
+// vector attractors;
+// vector emitters;
//Maybe the emitter does not have to be an own class, but is more like a Vector of Positions, so in the system.back it will setup particles for every position that is saved in this Vector
//like following:
diff --git a/src/rainParticleSystem.cpp b/src/rainParticleSystem.cpp
new file mode 100644
index 0000000..ca93e28
--- /dev/null
+++ b/src/rainParticleSystem.cpp
@@ -0,0 +1,61 @@
+#include "rainParticleSystem.h"
+
+
+RainParticleSystem::RainParticleSystem(float startSceneX, float sceneSizeX, float sceneSizeY) {
+
+ this->startSceneX = startSceneX;
+ this->sceneSizeX = sceneSizeX;
+ this->sceneSizeY = sceneSizeY;
+
+ maxParticle = 40;
+ birthCnt = 0;
+ parAmount = 2;
+ tornadoStartTime = -1000;
+ time = 0;
+ status = -1;
+
+}
+
+//--------------------------------------------------------------
+void RainParticleSystem::updateParticleSystem() {
+
+ double deltaT = ofGetLastFrameTime();
+ time += deltaT;
+
+ //----------------------------------------------------------
+ if ((birthCnt >= 0) && (status == -1)) { //Create the particle for the rainparticlesystems
+ createParticlesForRain();
+ }
+ //----------------------------------------------------------//Update particle (Movement)
+
+
+ for (int p = 0; p < particles.size(); p++) { //Movement of particles from bottom to top
+ particles.at(p)->updateParticle(deltaT, ofVec2f(ofRandom(startSceneX, startSceneX + sceneSizeX), 0),
+ false, false, false, 0, 0, startSceneX + sceneSizeX, sceneSizeY);
+ }
+
+}
+
+//--------------------------------------------------------------
+void RainParticleSystem::createParticlesForRain()
+{
+ for (int i = 0; i < parAmount; i++) {
+
+ particles.push_back(new Particle);
+ int rgen = ofRandom(startSceneX, startSceneX + sceneSizeX);
+
+ particles.back()->setup(ofVec2f(rgen, sceneSizeY), 20);
+ }
+ birthCnt = 0;
+}
+
+//--------------------------------------------------------------
+void RainParticleSystem::drawRainParticleSystem() {
+
+ for (int i = 0; i < particles.size(); i++) {
+ particles.at(i)->draw();
+ }
+}
+
+
+
diff --git a/src/rainParticleSystem.h b/src/rainParticleSystem.h
new file mode 100644
index 0000000..51f0a4d
--- /dev/null
+++ b/src/rainParticleSystem.h
@@ -0,0 +1,48 @@
+#ifndef rainParticleSystem_h
+#define rainParticleSystem_h
+#pragma once
+
+#include "ofMain.h"
+#include "ofxCv.h"
+#include "ofxOpenCv.h"
+#include "particle.h"
+#include "drawableImage.h"
+#include
+
+class RainParticleSystem
+{
+
+public:
+
+ RainParticleSystem(float startSceneX, float sceneSizeX, float sceneSizeY);
+ ~RainParticleSystem();
+
+ vectorattractors;
+ vector particles;
+
+ int startSceneX;
+ int sceneSizeX;
+ int sceneSizeY;
+ int maxParticle;
+ int picPix;
+ int k;
+ int status;
+ bool tornadoStarted;
+ bool editingWarp;
+ float birthCnt;
+ float maxLife;
+ float parAmount;
+ float height;
+ double time;
+ double tornadoStartTime;
+
+ void updateParticleSystem();
+ void createParticlesForRain();
+ void drawRainParticleSystem();
+
+
+private:
+
+};
+#endif
+
diff --git a/src/visitor.cpp b/src/visitor.cpp
index ef72087..73b56aa 100644
--- a/src/visitor.cpp
+++ b/src/visitor.cpp
@@ -5,7 +5,7 @@
// Created by Sebastian Holzki on 11.06.19.
//
-#include "visitor.hpp"
+#include "visitor.h"
@@ -133,33 +133,3 @@ void Visitor::setY(float _y){
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/visitor.hpp b/src/visitor.h
similarity index 97%
rename from src/visitor.hpp
rename to src/visitor.h
index af8c3fe..5974da6 100644
--- a/src/visitor.hpp
+++ b/src/visitor.h
@@ -1,5 +1,5 @@
//
-// visitor.hpp
+// visitor.h
// particle_combined
//
// Created by Sebastian Holzki on 11.06.19.