🙄Разминка для ума!
Треугольник Серпинского, интересная фигура которую построить достаточно просто.
Алгоритм такой:
1. создаём любые 3 точки на плоскости
2. из этих точек случайно выбираем любую, как начальную
3. случайно выбираем любую точку из этих же трёх точек как цель
4. перемещаемся в сторону цели на половину расстояния
5. повторяем бесконечно с пункта 3
Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал!
Я собрал пример построения такой фигуры на базе Qt.
🌎 Код можно посмотреть здесь.
С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник.
Особенности примера:
🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку.
🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал.
🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат.
🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов
painter.fillRect(rec, QColor(0, 0, 0, 100))
То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней.
Если сделать виджет фулскрин, то у нас получится некий ScreenSaver)))
🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами.
#qt#source#tricks
🚀Mozo hits 450K followers! 🎉
A massive thank you to our amazing community for your support! We’re just getting started—stay tuned for more exciting updates, events, and rewards.
Let’s keep growing together! #Mozo
Website|Twitter|Community|Telegram Mini App|News Channel
Have you noticed that #Mozo is trending? 😜
We’re thrilled to see our community growing and embracing the future of decentralized AI!
Website|Twitter|Community|Telegram Mini App|News Channel
Data is more than just numbers—it's a reflection of who we are. The idea that corporations and governments can own or control our data threatens our personal freedom.
It’s time to reclaim your data and take back control. #Mozo
Website|Twitter|Community|Telegram Mini App|News Channel
GM #Mozo Builders🌞
Something exciting is just around the corner. Stay tuned for what’s coming next! 👀
Website|Twitter|Community|Telegram Mini App|News Channel
🚀 Exciting news!
#Mozo is partnering with CocosStudio, the premier platform powered by the world’s No.1 mini-game engine, Cocos Engine!
With a global community of over 1.6 million developers across 203 regions, Cocos Studio leads in mini-game development, incubation, and acceleration.
Together, we’re bridging the gap between Web2 and Web3, empowering developers to seamlessly transition to the decentralized world.
Website|Twitter|Community|Telegram Mini App|News Channel
We’re excited to announce our partnership with koi_protocol, a groundbreaking platform backed by Binance Labs
K.O.I combines the joy of virtual pet care with sophisticated AI competitive elements, all anchored on the Ethereum blockchain. This immersive environment caters to both casual and competitive gamers, enabling them to nurture, train, and trade their virtual companions.
Together, #Mozo and K.O.I will leverage advanced AI to enhance user experiences and drive innovation in the virtual pet gaming space.
Website|Twitter|Community|Telegram Mini App|News Channel
How to drive mass adoption of Web3? Lower the entry barriers for users! It's that simple.
👑 Pepe King is coming! Join #Mozo now and use your Telegram to earn free points. Don’t miss out!
🎮Play Now: https://t.me/mozoai_bot/hub
Website|Twitter|Community|Telegram Mini App|News Channel
1/6 The limitations of centralized control highlight the critical need for decentralized data in LLM development and RAG services. Let's explore why decentralized data is the future.
2/6 Enhanced Data Quality: Decentralization fosters a more inclusive environment where diverse user communities contribute data and perspectives. This enriches the knowledge base for LLMs, improving their performance and accuracy.
3/6 Reduced Biases: By removing centralized control of data sources, we significantly reduce potential biases. This promotes the development of fairer and more ethical AI models that benefit all users.
4/6 Increased Innovation: Decentralization fosters an environment where new ideas and contributions from the broader community can flourish, accelerating innovation in AI and leading to more advanced and powerful LLM models.
5/6 By harnessing the power of decentralized data, #Mozo proposes a novel solution that empowers regular users to actively contribute to the future of AI. This not only unlocks the full potential of LLMs but also fosters a more inclusive and ethically responsible AI development landscape.
6/6 Join us in revolutionizing AI development. Embrace decentralization and help create a more accurate, fair, and innovative future.
Website|Twitter|Community|Telegram Mini App|News Channel
🔥 Exciting news! #Mozo
🌟 New features are now live on the Mozo platform! 🌟
✅Our team is committed to continuous innovation to bring you a better experience.
❤️Explore these new features today and enjoy more efficient and smarter services!
Why #Mozo Matters:
✅Decentralized intelligence, empowering everyone.
✅Collaboration that enhances collective strength.
✅Innovation that revolutionizes industries and lives.
Be a part of Mozo’s journey!
Website|Twitter|Community|Telegram Mini App|News Channel