|
||
|
||
So, I came across to this subject of Magnetic Field Force while I was searching if there are different forces other than gravitional force that shiffman taught us. It turns out there was. I said, why not, I can do that! I researched days and night, spoke with very important scientists about this and they all got agreed about this one thing, "ilteris you can do it!" Well.er..Of course I was not that smart...Oh and on my way I have found this gorgeous website and this guy already did that and what not! Here is the link. Ok that put me a little bit low in motivation at first. Then... I still remember that moment, I was feeding the penguins in NY zoo and that thought just popped in."I can implement this in processing and maybe I can become famous too." I ran to the house and started working on it again with hopes. Only If I was that smart... |
||
So here is my implementation of magnetic field forces in processing for this week. Actually if I try to tell you what's going on aside from what I couldn't figure out, there is a vector field consisting of rectangles,there is a magnet on the center which is looking at us in the Z-axis(as there is no +/- polarities) and there are particles on the stage flying. I tried to define the whole canvas consisting of rectangles so that they can simulate vector fields in this scenario. Since all of them are Vector3D types I could easily calculate the distance between each of those vector fields and the magnet thus naming it the magnitude/or force/ of that area. So my ideas was if some particle were on that area on an exact moment just apply the force that is related to that area. Simple as that. | ||
There is so much problem going on in this applet. First of all, those for loops are insane, there should be a better way of doing this, plus they are causing particles to flicker which I suspect they are creating more than they are supposed to do. theta_vel += theta_acc + 0.000005; this line in particle class is a total hack that shouldn't be there never and ever. I have found out that I am not getting any value other than 0 for my theta and hacked it in this way. I guess what I am missing is some kind of velocity(angular?) for the particles. I tried to applying some but it turned out I did in wrong.
|
||
So this is my implementation for the Magnetic Field force for this week and I am kind of sick of it because there is a whole other stuff there waiting to be explored and I am stuck. So I am waving bye to you, you magnetic field force. it was good knowing you... | ||
References: |