Discuss Scratch

maths_genius1234
Scratcher
82 posts

3D Atom Models

Does any one know how to get a 3D model of an atom (similar to the one shown below) in Scratch? I need it so that it can calculate how many electrons are in each ring depending on the atomic number given. Does anyone have a custom block that could help? Pls, thanks!



defineCreate3DAtomicnumberringscomplicatedstuffhere
-TUB-
Scratcher
100+ posts

3D Atom Models

You could try this:

defineCreateAtomelectronsdeleteallofringssetelectrons lefttoelectronsrepeatuntilnotelectronsleft>0changeelectrons leftby0-itemlengthofrings+1ofring electronsadditemlengthofrings+1ofring electronstoringsreplaceitemlengthofringsofringswithitemlengthofringsofrings+electronsleft

The list “ring electrons” should have the maximum number of electrons in each ring. This code will repeatedly add another ring until there aren't enough electrons, then it will remove the extra electrons from the last ring.

To render the 3d model, you can loop through the rings, rendering them one at a time. For each ring, you will need to render the electrons equally spaced out on the circle. I won't go into detail on the 3d code here, but there is a great 3d tutorial by @MathMathMath which might be helpful.
maths_genius1234
Scratcher
82 posts

3D Atom Models

thanks, but the problem is the number of electrons in each ring varies.
-Plaffy-
Scratcher
7 posts

3D Atom Models

You could use clones and the z positioning script from griffpatch to render it
minhhoangharry
Scratcher
1 post

3D Atom Models

histeps

Powered by DjangoBB