|
Post by nathanmyersc on May 3, 2024 7:04:08 GMT
I Created a program using c++ and opencv that asks the user their intention. translates that into a sigil. charges the sigil and then "burns it" on repeat. You can press control + P to toggle seeing the sigil for 5 seconds before its burnt. UPDATED : uploadnow.io/f/QPSwfcg
|
|
|
Post by AnthroHeart on May 3, 2024 10:02:50 GMT
I Created a program using c++ and opencv that asks the user their intention. translates that into a sigil. charges the sigil and then "burns it" on repeat. You can press control + P to toggle seeing the sigil for 5 seconds before its burnt. uploadnow.io/f/VBl7yjbCool.
I put the same intention in twice and got different sigils.
Is the output file number the number of seconds it's been charging?
And does it charge the sigil with the sentence on repeat (like millions of times per second) like the Intention Repeater?
The energy felt similar to when I charged an output_2.bmp with my intention for a minute to the output_125.bmp
|
|
|
Post by nathanmyersc on May 3, 2024 10:15:33 GMT
I Created a program using c++ and opencv that asks the user their intention. translates that into a sigil. charges the sigil and then "burns it" on repeat. You can press control + P to toggle seeing the sigil for 5 seconds before its burnt. uploadnow.io/f/VBl7yjbCool.
I put the same intention in twice and got different sigils.
Is the output file number the number of seconds it's been charging?
And does it charge the sigil with the sentence on repeat (like millions of times per second) like the Intention Repeater?
The energy felt similar to when I charged an output_2.bmp with my intention for a minute to the output_125.bmp
Yeah its currently randomly generating the positions for each letter. Their is a 1 second of charging per sigil so its at least 1 second. Yeah it does charge the sigil with the intention or its intended too with the sentence on repeat. Its something to try. im reading more into chaos magic and witchcraft. Seeing different mindsets. // Function to continuously copy canvas contents to itself for one second
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
std::string action = "CHARGING SIGIL";
std::string sigilIntent = intent;
}
}
|
|
|
Post by AnthroHeart on May 3, 2024 10:35:19 GMT
On the part that goes:
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
std::string action = "CHARGING SIGIL";
std::string sigilIntent = intent;
}
}
Is redefining std::string sigilIntent and std::string action each time less efficient?
Would this be better?
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
std::string action, sigilIntent;
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
action = "CHARGING SIGIL";
sigilIntent = intent;
}
} I know it's better like you have it to declare the scope as less as possible for variables, but recreating the variable inside the loop, does that slow it down a bit?
|
|
|
Post by nathanmyersc on May 3, 2024 10:37:30 GMT
On the part that goes:
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
std::string action = "CHARGING SIGIL";
std::string sigilIntent = intent;
}
}
Is redefining std::string sigilIntent and std::string action each time less efficient?
Would this be better?
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
std::string action, sigilIntent;
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
action = "CHARGING SIGIL";
sigilIntent = intent;
}
} I know it's better like you have it to declare the scope as less as possible for variables, but recreating the variable inside the loop, does that slow it down a bit?
Could be it depends if allocating new memory for it each time is more effective or not. if we just reiterate the same memory location it would iterate more loops but perhaps writing to new memory is helpful.
|
|
|
Post by AnthroHeart on May 3, 2024 10:49:28 GMT
Will you release the full source code when it's polished?
|
|
|
Post by nathanmyersc on May 3, 2024 10:51:40 GMT
Will you release the full source code when it's polished? You can have it. But its some work to compile opencv. #include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
#include <unordered_set>
#include <random>
#include <cmath>
#include <chrono>
#include <thread>
#include <windows.h>
#include <cstdio> // For removing file
using namespace cv;
using namespace std;
using namespace chrono;
using namespace this_thread;
// Function to generate a random point within a circle of given radius
Point generateRandomPointWithinCircle(int radius) {
random_device rd;
mt19937 gen(rd());
uniform_real_distribution<float> angle_dist(0, 2 * CV_PI); // Random angle between 0 and 2 * PI
uniform_real_distribution<float> radius_dist(0, radius); // Random radius between 0 and given radius
float angle = angle_dist(gen);
float r = radius_dist(gen);
int x = static_cast<int>(r * cos(angle));
int y = static_cast<int>(r * sin(angle));
return Point(x, y);
}
// Function to draw a black filled circle centered at a given position with radius 5
void drawFilledCircle(Mat& canvas, Point center) {
int radius = 5;
circle(canvas, center, radius, Scalar(0, 0, 0), FILLED);
}
// Function to draw an empty circle centered at a given position with radius 10
void drawEmptyCircle(Mat& canvas, Point center) {
int radius = 10;
circle(canvas, center, radius, Scalar(0, 0, 0), 2);
}
// Atomic flag to control the display of the charged sigil
std::atomic<bool> showSigil(false);
void keyboardThread() {
while (true) {
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && (GetAsyncKeyState('P') & 0x8000)) { // Check if Control + P is pressed
showSigil = !showSigil;
std::cout << "Sigil display toggled: " << (showSigil ? "ON" : "OFF") << std::endl;
// Delay to prevent rapid toggling
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
// Function to continuously copy canvas contents to itself for one second
void chargeSigil(Mat& canvas,const std::string intent) {
auto start_time = steady_clock::now();
const Mat tempCanvas = canvas;
while (duration_cast<milliseconds>(steady_clock::now() - start_time).count() < 1000) {
canvas = tempCanvas;
std::string action = "CHARGING SIGIL";
std::string sigilIntent = intent;
}
}
int main() {
// Ask user for the sentence
string sentence;
cout << "Enter the sentence: ";
getline(cin, sentence);
// Remove duplicates and process only unique letters
unordered_set<char> unique_letters;
for (char c : sentence) {
if (isalpha(c)) {
unique_letters.insert(tolower(c)); // Convert to lowercase to ignore case sensitivity
}
}
std::thread keyboard_thread(keyboardThread);
int iterations = 0;
while (true) {
// Calculate random positions for each unique letter within the circle
unordered_map<char, Point> letter_positions;
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<int> min_dist(40, 250); // Minimum distance between points
for (char c : unique_letters) {
Point random_point;
bool valid_position = false;
while (!valid_position) {
random_point = generateRandomPointWithinCircle(250); // Generate random point within circle of radius 250
valid_position = true;
for (const auto& [letter, position] : letter_positions) {
if (norm(random_point - position) < min_dist(gen)) {
valid_position = false;
break;
}
}
}
letter_positions[c] = Point(250 + random_point.x, 250 + random_point.y); // Offset point to center of the canvas
}
// Create a blank canvas
Mat canvas(500, 500, CV_8UC3, Scalar(255, 255, 255)); // White background
// Draw lines between each letter's position and the next letter's position
auto prev_position = letter_positions.begin()->second;
Point second_last_position;
Point last_position;
bool first_iteration = true;
for (auto it = next(letter_positions.begin()); it != letter_positions.end(); ++it) {
Point current_position = it->second;
if (first_iteration) {
// Draw arrow at the beginning of the sigil
double angle = atan2(current_position.y - prev_position.y, current_position.x - prev_position.x);
Point arrow_end;
arrow_end.x = prev_position.x + 20 * cos(angle);
arrow_end.y = prev_position.y + 20 * sin(angle);
arrowedLine(canvas, prev_position, arrow_end, Scalar(0, 0, 0), 2);
first_iteration = false;
}
// Draw line between previous and current position
line(canvas, prev_position, current_position, Scalar(0, 0, 0), 2);
// Draw a circle, empty circle, or random letter with a 10% chance
uniform_int_distribution<int> chance_dist(1, 10); // 10% chance
if (chance_dist(gen) == 1) {
// Draw either a filled circle, empty circle, or random letter with equal probability
uniform_int_distribution<int> element_type(0, 1);
int choice = element_type(gen);
if (choice == 0) {
drawFilledCircle(canvas, current_position);
} else if (choice == 1) {
drawEmptyCircle(canvas, current_position);
}
}
// Store second last and last positions
second_last_position = prev_position;
last_position = current_position;
prev_position = current_position;
}
// Draw perpendicular line at the end of the sigil
double angle_last = atan2(last_position.y - second_last_position.y, last_position.x - second_last_position.x);
double angle_perpendicular = angle_last + CV_PI / 2;
Point perpendicular_end1, perpendicular_end2;
perpendicular_end1.x = last_position.x + 10 * cos(angle_perpendicular);
perpendicular_end1.y = last_position.y + 10 * sin(angle_perpendicular);
perpendicular_end2.x = last_position.x - 10 * cos(angle_perpendicular);
perpendicular_end2.y = last_position.y - 10 * sin(angle_perpendicular);
line(canvas, perpendicular_end1, perpendicular_end2, Scalar(0, 0, 0), 2);
// Draw a circle surrounding the sigil
circle(canvas, Point(250, 250), 250, Scalar(0, 0, 0), 2);
// Save the final canvas as "output_[iterations].bmp"
std::stringstream ss;
ss << "output_" << iterations << ".bmp";
std::string output_filename = ss.str();
imwrite(output_filename, canvas);
// Copy canvas contents to itself for one second
chargeSigil(canvas, sentence);
// Display the charged sigil if the showSigil flag is set
if (showSigil) {
imshow("Charged Sigil", canvas);
waitKey(5000); // Wait for the user to press a key
destroyWindow("Charged Sigil");
}
// Delete the output file
remove(output_filename.c_str());
iterations += 1;
std::cout << "\rSIGILS BURNED: " << iterations << std::flush;
}
keyboard_thread.join(); // Wait for the keyboard thread to finish
return 0;
}
|
|
|
Post by AnthroHeart on May 3, 2024 11:00:34 GMT
I wanted to use WxWidgets for a GUI on Repeater before, but it was tricky to compile it using Visual Studio, which I don't know if it would have been available for Linux or macOS.
|
|
|
Post by nathanmyersc on May 3, 2024 11:07:45 GMT
I wanted to use WxWidgets for a GUI on Repeater before, but it was tricky to compile it using Visual Studio, which I don't know if it would have been available for Linux or macOS.
Yeah would need to use something like SDL or SFML.
|
|
|
Post by AnthroHeart on May 3, 2024 11:56:35 GMT
Is each step the sigil creates a different sigil?
Or does it create one sigil and charge that?
|
|
|
Post by nathanmyersc on May 3, 2024 12:20:11 GMT
Is each step the sigil creates a different sigil? Or does it create one sigil and charge that? It creates a sigil then charges it for one second then destroys it and repeats the process. each time the points a letter represents changes.
|
|
|
Post by AnthroHeart on May 3, 2024 12:26:50 GMT
If I wanted a sigil unique to my intention, and charge that one sigil up, could that be done easily? What if the person wants to keep the sigil at the end?
If the sentence was charging the sigil image directly, it might be even more powerful.
|
|
|
Post by nathanmyersc on May 3, 2024 13:41:40 GMT
If I wanted a sigil unique to my intention, and charge that one sigil up, could that be done easily? What if the person wants to keep the sigil at the end?
If the sentence was charging the sigil image directly, it might be even more powerful.
Ok i added those features choose witch wheel and each letter has a predetermined position so you will get unique sigil specific to your affirmation. updated the link
|
|
|
Post by AnthroHeart on May 3, 2024 14:34:50 GMT
If I wanted a sigil unique to my intention, and charge that one sigil up, could that be done easily? What if the person wants to keep the sigil at the end?
If the sentence was charging the sigil image directly, it might be even more powerful.
Ok i added those features choose witch wheel and each letter has a predetermined position so you will get unique sigil specific to your affirmation. updated the link I ran it twice with the same intention, and it gave me the same sigil, but on 2nd time it put circles around points in it. I chose option 2 for both.
Could you have it so we could create a sigil from an INTENTIONS.TXT or other input file? Like if they have .txt in the sentence, or like .docx it will read from a file and use that to create the sigil?
I usually go by if the 4th or 5th from the end is a period, then read the contents of that file into the variable.
It would allow for unicode characters as well since string does.
And exclude null characters "\0" because strings in C++ are null terminated. And if I want to turn an mp3 into a sigil, it might terminate at null characters. String type works for unicode, but it's just null terminated.
|
|
|
Post by nathanmyersc on May 3, 2024 14:51:01 GMT
Ok i added those features choose witch wheel and each letter has a predetermined position so you will get unique sigil specific to your affirmation. updated the link I ran it twice with the same intention, and it gave me the same sigil, but on 2nd time it put circles around points in it. I chose option 2 for both.
Could you have it so we could create a sigil from an INTENTIONS.TXT or other input file? Like if they have .txt in the sentence, or like .docx it will read from a file and use that to create the sigil?
I usually go by if the 4th or 5th from the end is a period, then read the contents of that file into the variable.
It would allow for unicode characters as well since string does.
And exclude null characters "\0" because strings in C++ are null terminated. And if I want to turn an mp3 into a sigil, it might terminate at null characters. String type works for unicode, but it's just null terminated.
That would get pretty wacky i bet . atm im using unique letters. so it only does the first of every letter. if i turned that offf and did every letter it would look very interesting once you hit like 100 characters
|
|