Начинающий
- Статус
- Оффлайн
- Регистрация
- 14 Май 2023
- Сообщения
- 339
- Реакции
- 9
Нашел на пк govno effects by chatgpt
код ниже вставьте в любое место(желательно в код меню)
а этот код вставляете где у вас идет имгуй
SS:
код ниже вставьте в любое место(желательно в код меню)
struct Point {
float x, y;
float vx, vy;
};
std::vector<Point> points;
void InitializePoints(int count, float width, float height) {
points.clear();
for (int i = 0; i < count; ++i) {
Point p = {
rand() % (int)width,
rand() % (int)height,
(rand() % 100 - 50) / 100.0f,
(rand() % 100 - 50) / 100.0f
};
points.push_back(p);
}
}
void UpdatePoints(float width, float height) {
for (auto& point : points) {
point.x += point.vx;
point.y += point.vy;
if (point.x < 0 || point.x > width) point.vx = -point.vx;
if (point.y < 0 || point.y > height) point.vy = -point.vy;
}
}
void RenderPoints(ImDrawList* drawList, const ImVec2& canvasPos, const ImVec2& canvasSize) {
for (size_t i = 0; i < points.size(); ++i) {
// Отрисовка точки
ImVec2 pointPos = ImVec2(canvasPos.x + points.x, canvasPos.y + points.y);
drawList->AddCircleFilled(pointPos, 2.0f, IM_COL32(255, 255, 255, 255));
for (size_t j = i + 1; j < points.size(); ++j) {
float dx = points.x - points[j].x;
float dy = points.y - points[j].y;
float distance = std::sqrt(dx * dx + dy * dy);
if (distance < 100.0f) {
float alpha = 1.0f - (distance / 100.0f);
ImVec2 otherPointPos = ImVec2(canvasPos.x + points[j].x, canvasPos.y + points[j].y);
drawList->AddLine(pointPos, otherPointPos, IM_COL32(255, 255, 255, (int)(alpha * 255)));
}
}
}
}
float x, y;
float vx, vy;
};
std::vector<Point> points;
void InitializePoints(int count, float width, float height) {
points.clear();
for (int i = 0; i < count; ++i) {
Point p = {
rand() % (int)width,
rand() % (int)height,
(rand() % 100 - 50) / 100.0f,
(rand() % 100 - 50) / 100.0f
};
points.push_back(p);
}
}
void UpdatePoints(float width, float height) {
for (auto& point : points) {
point.x += point.vx;
point.y += point.vy;
if (point.x < 0 || point.x > width) point.vx = -point.vx;
if (point.y < 0 || point.y > height) point.vy = -point.vy;
}
}
void RenderPoints(ImDrawList* drawList, const ImVec2& canvasPos, const ImVec2& canvasSize) {
for (size_t i = 0; i < points.size(); ++i) {
// Отрисовка точки
ImVec2 pointPos = ImVec2(canvasPos.x + points.x, canvasPos.y + points.y);
drawList->AddCircleFilled(pointPos, 2.0f, IM_COL32(255, 255, 255, 255));
for (size_t j = i + 1; j < points.size(); ++j) {
float dx = points.x - points[j].x;
float dy = points.y - points[j].y;
float distance = std::sqrt(dx * dx + dy * dy);
if (distance < 100.0f) {
float alpha = 1.0f - (distance / 100.0f);
ImVec2 otherPointPos = ImVec2(canvasPos.x + points[j].x, canvasPos.y + points[j].y);
drawList->AddLine(pointPos, otherPointPos, IM_COL32(255, 255, 255, (int)(alpha * 255)));
}
}
}
}
ImDrawList* drawList = ImGui::GetWindowDrawList();
ImVec2 canvasPos = ImGui::GetCursorScreenPos();
ImVec2 canvasSize = vWindowSize;
if (points.empty()) {
InitializePoints(15, canvasSize.x, canvasSize.y);
}
UpdatePoints(canvasSize.x, canvasSize.y);
drawList->AddRectFilled(canvasPos, ImVec2(canvasPos.x + canvasSize.x, canvasPos.y + canvasSize.y), IM_COL32(0, 0, 0, 255));
RenderPoints(drawList, canvasPos, canvasSize);
ImVec2 canvasPos = ImGui::GetCursorScreenPos();
ImVec2 canvasSize = vWindowSize;
if (points.empty()) {
InitializePoints(15, canvasSize.x, canvasSize.y);
}
UpdatePoints(canvasSize.x, canvasSize.y);
drawList->AddRectFilled(canvasPos, ImVec2(canvasPos.x + canvasSize.x, canvasPos.y + canvasSize.y), IM_COL32(0, 0, 0, 255));
RenderPoints(drawList, canvasPos, canvasSize);