stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Atomic World

  • 8 Devlogs
  • 17 Total hours

Trying to simulate Atoms and/or quarks

Open comments for this post

1h 31m 24s logged

Devlog 8: Control your speed!

I noticed how it’s really annoying when you try to view the particles while they aren’t scaled up by getting closer to them, it is really easy to just overshot, making it really hard to get a close look at them because your steps are just way to big.
So I decided to allow you to control how fast the camera moves by scrolling with your mouse wheel, which changes the Movement scale, I even made it so that scale doesn’t change linearly, but (exponential?), like this:

if(decrease_movement_scale){
    movementScale /= 2;
} else if(increase_movement_scale){
    movementScale *= 2;
}

Additionally I wanted you to be able to see what the current scale is, so I added a new section to the UI, where you can see the current movement scale and also a little guide on what the controls are.

And one last thing I added, is that I made it so when your cursor is on the UI you can’t accidentaly change the movement scale or turn the camera.

0
0
25
Open comments for this post

5h 8m 26s logged

Devlog 7: Adding UI and Camera Movement

It’s been a while since I last worked on this project, but now I’m aiming to complete it.
So today I made an UI where you can change most of the values the simulation uses, and then wrote a Script so those changes in the UI can be communicated to the simulation itself. And when you start the program, you even get to chose whether you want the 2D or 3D simulation.
After that, I added the ability to move the camera around using WASD and QE, and found out that instead of making a complicated code to zoom in in the 2D mode, I can just have the camera be in perspectiv instead of orthografic and then move the camera closer to the particles, and after that I finally added the ability to turn the camera in the 3D mode.

0
0
16
Open comments for this post

2h 31m 50s logged

Devlog 6: Compute shaders

So now I’ve turned my c# scripts I used for computing the particles into an compute shaders, so that you can simulate way more particles now, for me personally with an integrated graphics card, I can manage about 16000 particles pretty well.
I made the compute shaders by pretty much just copying the c# script into an compute shader, where I only had to change a few things, like changing Vector3’s to float3’s, and then wrote a little handler that does the communication with said compute shaders.

0
0
19
Open comments for this post

1h 46m 5s logged

Devlog 5: Adding ranges

So I decided to add both a minimum and maximum range, the minimum range is to prevent division by zero errors, because I’m dividing by the distance, and the maximum range is to prevent the particles from always collecting in the middle.

I’ve also realized how difficult it is to simulate quarks, so I’ll be making this project shorter than originally planned, because I just simply don’t enjoy researching the entire day and yet not finding anything new or useful.
I also can’t just improvise stuff I can’t recreate realistically, because I know I just won’t be satisfied with that. Because of that, I’ll cut this project short, and will start working on getting it into a state that can be shipped.

0
0
6
Open comments for this post

2h 4m 9s logged

Devlog 4: Changing to Quarks and adding 3D

So I looked into it a bit, and now I know that the Cornell Potential didn’t work correctly for the nuclei, because well, the Cornell potential is meant for quarks, which is also why I have no decided to already switch over to working with quarks, because I get more enoyment out of that now, and it is something I planned on doing anyway.
I have also added 3D simulation, so I can see how stuff acts there.
And also, I’ve added a minimal distance, because stuff always got too close, and the force got close to infinity because of 1/x, so now everything that is too close, just doesn’t interact.

0
0
5
Open comments for this post

1h 14m 27s logged

Devlog 3: Strong force

I have now implemented a strong force, I did that by using the Cornell potential and it’s derivative:

V(r) = -(a/r) + ro
F(r) = -(a/r^2) - o        (Derivative!)

It took me a bit to both find that formula, and to try understand it, but now I think I understand it good enough.
But I do think I have to change some stuff, because the neutrons and protons like do not stop at all, and I think the electrons shouldn’t be affected the way they are, but I think the reason for both might be that the derivative is bad? I don’t really know, I don’t know how derivatives work.

0
0
7
Open comments for this post

1h 49m 9s logged

Devlog 2: Adding Physics

It took me a little, but now I’ve added interaction between the different particles, to reflect their charges, based on Coulomb’s Law:
F = k * q_1 * q_2 / d^2
Where k is the coulomb constant, q the charges of the particles in coulombs (a unit) and d the distance between the particles.

Whether a particle is a proton, neutron or electron, is based on their index in the positions array, modulo 3:

colors[index % 3];
charge[index % 3];

But the reason it took me a bit is, because I tried to change the coulomb constant in a way so that when q is of the unit e (elemental charge) instead of in coulombs and the distance d in fm instead of in m (1fm = 10^-15), it still is correct. But I struggled a bit, until eventually I found the problem, I forgot to account for the fact that d is squared, meaning the 10^15 I was working with, where supposed to be 10^30, so as soon as I fixed that, it finally worked like it should.

Next thing to do, is to imitate the strong force, so the protons can stay together.

0
0
3
Open comments for this post

48m 18s logged

Devlog 1: Starting the project

So in this project I’m going to simulate atoms, while probably trying to stay somewhat physically accurate.
I’m going to start of by simply simulating particles that are either Protons, Neutrons or Electrons, that have a certain charge. Later I’m planning on making it so each of them is made out of three quarks, with their corresponding charges, which hopefully adds more realism.
Right now, I already have made it so I can see the different particles, and only have to add the logic behind it.

0
0
20

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…