Dev #2
Binary file not shown.
Binary file not shown.
@@ -1033,14 +1033,18 @@ polypartiCL
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libirng.so
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libsvml.so
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libur_loader.so.0
|
||||
/tmp/icpx-6e0c7c75f4/main-0db82a.o
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-d70aea.o
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-wrapper-7bf44e.o
|
||||
/tmp/icpx-05e8062085/main-bfadf2.o
|
||||
/tmp/icpx-05e8062085/polypartiCL-30ca20.o
|
||||
/tmp/icpx-05e8062085/polypartiCL-wrapper-6fca8e.o
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/crtbeginS.o
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/crtendS.o
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libgcc.a
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libgcc_s.so
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libstdc++.so
|
||||
/usr/lib/i386-linux-gnu/libdl.so.2
|
||||
/usr/lib/i386-linux-gnu/libpthread.so.0
|
||||
/usr/lib/i386-linux-gnu/librt.so.1
|
||||
/usr/lib/i386-linux-gnu/libz.so.1
|
||||
/usr/lib/x86_64-linux-gnu/libX11.so.6
|
||||
/usr/lib/x86_64-linux-gnu/libXau.so.6
|
||||
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6
|
||||
|
||||
@@ -1030,14 +1030,18 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libirng.so \
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libsvml.so \
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libur_loader.so.0 \
|
||||
/tmp/icpx-6e0c7c75f4/main-0db82a.o \
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-d70aea.o \
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-wrapper-7bf44e.o \
|
||||
/tmp/icpx-05e8062085/main-bfadf2.o \
|
||||
/tmp/icpx-05e8062085/polypartiCL-30ca20.o \
|
||||
/tmp/icpx-05e8062085/polypartiCL-wrapper-6fca8e.o \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/crtbeginS.o \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/crtendS.o \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libgcc.a \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libgcc_s.so \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libstdc++.so \
|
||||
/usr/lib/i386-linux-gnu/libdl.so.2 \
|
||||
/usr/lib/i386-linux-gnu/libpthread.so.0 \
|
||||
/usr/lib/i386-linux-gnu/librt.so.1 \
|
||||
/usr/lib/i386-linux-gnu/libz.so.1 \
|
||||
/usr/lib/x86_64-linux-gnu/libX11.so.6 \
|
||||
/usr/lib/x86_64-linux-gnu/libXau.so.6 \
|
||||
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6 \
|
||||
@@ -1066,6 +1070,12 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6:
|
||||
|
||||
/usr/lib/i386-linux-gnu/librt.so.1:
|
||||
|
||||
/usr/lib/i386-linux-gnu/libpthread.so.0:
|
||||
|
||||
/usr/lib/i386-linux-gnu/libdl.so.2:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libstdc++.so:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/libgcc.a:
|
||||
@@ -1074,7 +1084,7 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/15/crtbeginS.o:
|
||||
|
||||
/tmp/icpx-6e0c7c75f4/main-0db82a.o:
|
||||
/tmp/icpx-05e8062085/polypartiCL-wrapper-6fca8e.o:
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/lib/libsvml.so:
|
||||
|
||||
@@ -1096,6 +1106,8 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/lib/x86_64-linux-gnu/crtn.o:
|
||||
|
||||
/tmp/icpx-05e8062085/main-bfadf2.o:
|
||||
|
||||
/lib/x86_64-linux-gnu/crti.o:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/c++/15/bits/time_members.h:
|
||||
@@ -1280,8 +1292,6 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/include/sycl/item.hpp:
|
||||
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-d70aea.o:
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/include/sycl/info/platform_traits.def:
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/include/sycl/info/kernel_traits.def:
|
||||
@@ -1332,8 +1342,6 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/include/sycl/detail/tuple.hpp:
|
||||
|
||||
/tmp/icpx-6e0c7c75f4/polypartiCL-wrapper-7bf44e.o:
|
||||
|
||||
/usr/include/c++/15/bits/shared_ptr_base.h:
|
||||
|
||||
/usr/include/c++/15/bits/hashtable.h:
|
||||
@@ -1600,6 +1608,8 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h:
|
||||
|
||||
/tmp/icpx-05e8062085/polypartiCL-30ca20.o:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:
|
||||
|
||||
/home/alardner/projects/polypartiCL/src/polypartiCL.hpp:
|
||||
@@ -1918,6 +1928,8 @@ polypartiCL: /lib/x86_64-linux-gnu/Scrt1.o \
|
||||
|
||||
/usr/include/stdc-predef.h:
|
||||
|
||||
/usr/lib/i386-linux-gnu/libz.so.1:
|
||||
|
||||
/usr/include/pthread.h:
|
||||
|
||||
/opt/intel/oneapi/compiler/2026.0/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp:
|
||||
|
||||
+6
-3
@@ -1,4 +1,7 @@
|
||||
Tricorners
|
||||
count velocity x y theta_i theta_f color start end decayrate
|
||||
===================================================
|
||||
s
|
||||
20000 0.5 0.33333333333 0 360 cyan 0 2
|
||||
20000 0.3555 0.783 0 360 magenta 0 2
|
||||
20000 0.6445 0.783 0 360 yellow 0 2
|
||||
20000 90 0.5 0.33333333333 0 360 cyan 0 0 2
|
||||
20000 90 0.3555 0.783 0 360 magenta 0 0 2
|
||||
20000 90 0.6445 0.783 0 360 yellow 0 0 2
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
s
|
||||
20000 0.5 0.33333333333 0 360 cyan 0 0 2
|
||||
20000 0.3555 0.783 0 360 magenta 0 0 2
|
||||
20000 0.6445 0.783 0 360 yellow 0 0 2
|
||||
+33
-35
@@ -15,6 +15,7 @@ int main(int argc, char* argv[]) {
|
||||
const int fps = 60;
|
||||
const int screenWidth = 1920;
|
||||
const int screenHeight = 1080;
|
||||
int rotFrame = 0;
|
||||
float angle = 0.05;
|
||||
float d_interval_pct = 0.00001;
|
||||
bool rotate = false;
|
||||
@@ -56,12 +57,18 @@ int main(int argc, char* argv[]) {
|
||||
raylib::Vector2 mouse_i, mouse_f, mouse_d;
|
||||
raylib::Vector2 midpoint(screenWidth * 0.5, screenHeight * 0.5);
|
||||
|
||||
|
||||
float dirH[2] = {1.0f, 0.0f};
|
||||
float dirV[2] = {0.0f, 1.0f};
|
||||
|
||||
int resXY = blurShader.GetLocation("resolution");
|
||||
int dirXY = blurShader.GetLocation("direction");
|
||||
float resolution[2] = { float(screenWidth), float(screenHeight)};
|
||||
blurShader.SetValue(resXY, resolution, RL_SHADER_UNIFORM_VEC2);
|
||||
noBlur.SetValue(resXY, resolution, RL_SHADER_UNIFORM_VEC2);
|
||||
|
||||
for(const auto& item : sim.getCorners()) { lines.push_back({item[0], item[1]});}
|
||||
|
||||
while(!window.ShouldClose()) {
|
||||
if (IsKeyPressed(KEY_R)) rotate = !rotate;
|
||||
if (IsKeyPressed(KEY_L)) drawLines = !drawLines;
|
||||
@@ -72,36 +79,33 @@ int main(int argc, char* argv[]) {
|
||||
if (IsKeyPressed(KEY_T)) sim.reverseInterval();
|
||||
if (!paused) {
|
||||
sim.updateFields(window.GetTime());
|
||||
if (rotate) sim.rotateRoom(angle);
|
||||
lines.clear();
|
||||
if (rotate) {
|
||||
rotFrame++;
|
||||
}
|
||||
}
|
||||
for(const auto& item : sim.getCorners()) lines.push_back({item[0], item[1]});
|
||||
//for(const auto& item : sim.getCorners()) lines.push_back({item[0], item[1]});
|
||||
|
||||
//if (useShader) {
|
||||
renderTarget.BeginMode();
|
||||
ClearBackground(BLACK);
|
||||
renderTarget.BeginMode();
|
||||
ClearBackground(BLACK);
|
||||
|
||||
if(drawLines) {
|
||||
for(int i = 0; i < (lines.size() - 1); i++) { lines[i].DrawLine(lines[i+1], WHITE); }
|
||||
if(drawLines) {
|
||||
for(int i = 0; i < (lines.size() - 1); i++) { lines[i].DrawLine(lines[i+1], WHITE); }
|
||||
}
|
||||
|
||||
for (int i = 0; i < sim.getFieldCount(); i++) {
|
||||
auto& field = sim.getField(i);
|
||||
int *color = field.getColor();
|
||||
rlBegin(RL_LINES);
|
||||
rlColor4ub(color[0], color[1], color[2], color[3]);
|
||||
for (const auto& p : field.getPositions()) {
|
||||
rlVertex2f(p[0],p[1]);
|
||||
rlVertex2f(p[0]+1.0f,p[1]+1.0f);
|
||||
}
|
||||
rlEnd();
|
||||
}
|
||||
renderTarget.EndMode();
|
||||
|
||||
for (int i = 0; i < sim.getFieldCount(); i++) {
|
||||
auto& field = sim.getField(i);
|
||||
int *color = field.getColor();
|
||||
rlBegin(RL_LINES);
|
||||
rlColor4ub(color[0], color[1], color[2], color[3]);
|
||||
for (const auto& p : field.getPositions()) {
|
||||
rlVertex2f(p[0],p[1]);
|
||||
rlVertex2f(p[0]+1.0f,p[1]+1.0f);
|
||||
}
|
||||
rlEnd();
|
||||
}
|
||||
renderTarget.EndMode();
|
||||
|
||||
float dirH[2] = {1.0f, 0.0f};
|
||||
float dirV[2] = {0.0f, 1.0f};
|
||||
|
||||
if (useShader) {
|
||||
if (useShader) {
|
||||
blurShader.SetValue(dirXY, dirH, SHADER_UNIFORM_VEC2);
|
||||
|
||||
blur.BeginMode();
|
||||
@@ -113,17 +117,8 @@ int main(int argc, char* argv[]) {
|
||||
blur.EndMode();
|
||||
|
||||
blurShader.SetValue(dirXY, dirV, SHADER_UNIFORM_VEC2);
|
||||
} /*else {
|
||||
noBlur.SetValue(dirXY, dirH, SHADER_UNIFORM_VEC2);
|
||||
}
|
||||
|
||||
blur.BeginMode();
|
||||
ClearBackground(BLACK);
|
||||
noBlur.BeginMode();
|
||||
DrawTextureRec(renderTarget.texture, {0, 0, resolution[0], -resolution[1]}, {0,0}, WHITE);
|
||||
noBlur.EndMode();
|
||||
blur.EndMode();
|
||||
|
||||
}*/
|
||||
while(window.Drawing()) {
|
||||
window.ClearBackground(BLACK);
|
||||
|
||||
@@ -135,6 +130,9 @@ int main(int argc, char* argv[]) {
|
||||
noBlur.BeginMode();
|
||||
DrawTextureRec(renderTarget.texture, {0, 0, resolution[0], -resolution[1]}, {0,0}, WHITE);
|
||||
noBlur.EndMode();
|
||||
}
|
||||
if (rotate) {
|
||||
|
||||
}
|
||||
if(drawFPS) window.DrawFPS(10,10);
|
||||
}
|
||||
|
||||
+9
-13
@@ -420,15 +420,19 @@ void Polyparti::Room::loadParticles(std::string name) {
|
||||
bool relativeScreen = false;
|
||||
bool relativeRoom = false;
|
||||
int count;
|
||||
float x, y, deg_start, deg_end, start, life, decay;
|
||||
std::string color;
|
||||
float velocity, x, y, deg_start, deg_end, start, life, decay;
|
||||
std::string color, partName, temp;
|
||||
|
||||
getline(partfile, partName);
|
||||
getline(partfile, temp);
|
||||
getline(partfile, temp);
|
||||
|
||||
char check = partfile.get();
|
||||
if (check =='s') { relativeScreen = true;}
|
||||
else if (check == 'r') { relativeRoom = true; }
|
||||
|
||||
if (partfile.is_open()) {
|
||||
while (partfile >> count >> x >> y >> deg_start >> deg_end >> color >> start
|
||||
while (partfile >> count >> velocity >> x >> y >> deg_start >> deg_end >> color >> start
|
||||
>> life >> decay) {
|
||||
if (relativeScreen) {
|
||||
x *= screenWidth;
|
||||
@@ -438,6 +442,7 @@ void Polyparti::Room::loadParticles(std::string name) {
|
||||
y = implRoom->midpoint[1] + (y * (y_max - y_min) / 2);
|
||||
}
|
||||
newEntry.count = count;
|
||||
newEntry.velocity = velocity;
|
||||
newEntry.x = x;
|
||||
newEntry.y = y;
|
||||
newEntry.deg_start = deg_start;
|
||||
@@ -462,7 +467,7 @@ void Polyparti::Room::initField(Polyparti::Room::fieldInfo info) {
|
||||
info.deg_end = (info.deg_end/360) * rad;
|
||||
for (int i = 0; i < info.count; i++) {
|
||||
double angle = (float(i) / info.count) * (info.deg_end - info.deg_start);
|
||||
newField.addParticle(info.x, info.y, velocity * (std::cos(angle + info.deg_start)), velocity * (std::sin(angle + info.deg_start)));
|
||||
newField.addParticle(info.x, info.y, info.velocity * (std::cos(angle + info.deg_start)), info.velocity * (std::sin(angle + info.deg_start)));
|
||||
}
|
||||
newField.setColor(info.color);
|
||||
newField.setInterval(interval);
|
||||
@@ -473,15 +478,6 @@ void Polyparti::Room::initField(Polyparti::Room::fieldInfo info) {
|
||||
void Polyparti::Room::rotateRoom(float degrees) {
|
||||
float rad = (degrees / 360) * 4 * std::acos(0.0);
|
||||
|
||||
/*float tot_x = 0, tot_y = 0;
|
||||
int n = implRoom->corners.size();
|
||||
for (auto& point : implRoom->corners) {
|
||||
tot_x += point[0];
|
||||
tot_y += point[1];
|
||||
}
|
||||
implRoom->midpoint[0] = tot_x / n;
|
||||
implRoom->midpoint[1] = tot_y / n;*/
|
||||
|
||||
for (auto& point : implRoom->corners) {
|
||||
float temp = point[0];
|
||||
point[0] = ((temp - implRoom->midpoint[0]) * std::cos(rad) - (point[1] - (implRoom->midpoint[1])) * std::sin(rad));
|
||||
|
||||
+2
-7
@@ -6,12 +6,7 @@
|
||||
|
||||
typedef std::array<float, 2> XYVector;
|
||||
|
||||
//enum Colors {pRED, pORANGE, pYELLOW, pGREEN, pBLUE, pINDIGO, pVIOLET};
|
||||
namespace Polyparti {
|
||||
/*inline static float interval = 1.0f / 60;
|
||||
inline static float velocity = 100;
|
||||
static int screenWidth, screenHeight;*/
|
||||
|
||||
class ParticleField {
|
||||
public:
|
||||
ParticleField();
|
||||
@@ -46,7 +41,7 @@ namespace Polyparti {
|
||||
std::unique_ptr<ImplRoom> implRoom;
|
||||
struct fieldInfo {
|
||||
int count;
|
||||
float x, y, deg_start, deg_end, start, life, decayRate;
|
||||
float velocity, x, y, deg_start, deg_end, start, life, decayRate;
|
||||
int screenWidth, screenHeight;
|
||||
std::string color;
|
||||
};
|
||||
@@ -54,7 +49,7 @@ namespace Polyparti {
|
||||
std::vector<ParticleField> field;
|
||||
float x_min = 0, x_max = 0, y_min = 0, y_max = 0;
|
||||
inline static float interval = 1.0f / 60;
|
||||
inline static float velocity = 90;
|
||||
//inline static float velocity = 90;
|
||||
inline static float screenWidth = 1920;
|
||||
inline static float screenHeight = 1080;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user