Open DJV512 opened 10 months ago
First of all, I'm always surprised how people are still finding their way to this project (which I take as a compliment, so a big thank you for your interest in this little project of mine :))! As you might have noticed, I haven't been actively programming over the past couple of years, so issues like this are (even for me) quite tough to figure out sometimes. I first thought that I simply never tested the simulator on newer versions of Python and OpenCV, but I double-checked and my current version of Python also seems to be 3.11 (with OpenCV being at version 4.9.0.80). However, I can't seem to replicate the error. Maybe you could temporarily install the .exe version of the code (https://github.com/PyExplained/Particle-Simulator-.exe-) which may allow you to test out the simulator, however, you won't be able to edit the code.
Btw, I tried out your project and it looks awesome! Saw you had some more ideas listed in README. I'm sure you'll be able to make something cool with it.
If you still have difficulties running the simulator or have an idea on how to fix it, you can let me know. I can't promise if I'll have time to look for a solution, but I'll let you know if I find one.
You're welcome! I've been watching a lot of Particle Life videos on Youtube, and eventually the algorithm served me up your video, which I was impressed with. I will try again and see if I can get yours to work, but in the meantime I will check out the .exe file. If I manage to get your code running, I will report back what I did to fix it.
Thanks for checking mine out! Glad you liked it! I just finished implementing saving and loading, which was more for my own learning and practice than anything else because I don't expect anyone to ever use it! :)
Hi! I have recently been making my own Particle Life program in Python when I stumbled across your video on YouTube. Your implementation is miles better than mine (which you can view in my public repo if you care), and I wanted to look at your code to see what I could learn. I downloaded the zip file, set up a Virtual Environment with Python 3.11, and tried to run ParticleSimulator.py. I got the following error:
Traceback (most recent call last): File "/Users/davidvance/Library/Mobile Documents/com~apple~CloudDocs/Coding/Other-Particle-Life/ParticleSimulator.py", line 113, in
sim.simulate()
File "/Users/davidvance/Library/Mobile Documents/com~apple~CloudDocs/Coding/Other-Particle-Life/particle_simulator/simulation.py", line 502, in simulate
cv2.circle(image, (int(particle.x), int(particle.y)), particle.r, particle.color, -1)
cv2.error: OpenCV(4.9.0) :-1: error: (-5:Bad argument) in function 'circle'
I also tried setting up environments with Python 3.9, 3.10 and 3.12, all of which led to the same error. I couldn't figure out how to resolve it with some google searching, so I was hoping you could help. Can you please advise how to fix it? I'd love to play around with the program.
Thanks! Dave