ive been playing with your code Dr DooMer, but there are some probs with the formulas... i dunno... maybe someone else will have better luck lookin at this code... i took out some non-essential things...
rem ======================================
rem === CODE SNIPPET: PARTICLE REACTOR ===
rem === Cross-Bones Software ===
rem ======================================
rem Initialise Scene
set display mode 800,600,16
sync on
position camera 0,0,-16
autocam off
hide mouse
backdrop on
color backdrop 0
rem Create Atoms
dim atom#(20,6)
for i = 1 to 3
make object sphere i,0.5
color object i,rgb(192,128,255)
ghost object on i
ax#=rnd(360) : ay#=rnd(360)
x#=0 : y#=0 : z#=0 : dist#=(rnd(350)+30)*0.01
gosub CALC_Move
atom#(i,1)=x# : atom#(i,4)=x#*0.02
atom#(i,2)=y# : atom#(i,5)=y#*0.02
atom#(i,3)=z# : atom#(i,6)=z#*0.02
next i
rem Start Loop
do
rem Control Atoms
for i = 1 to 3
rem Apply Gravitational Effect
scale object i,100,100,100
for j = 1 to 3
if j<>i
point object i,atom#(j,1),atom#(j,2),atom#(j,3)
ax#=object angle x(i) : ay#=object angle y(i)
x#=0 : y#=0 : z#=0
dist#=(CALC_Distance(atom#(i,1),atom#(i,2),atom#(i,3),atom#(i2,1),atom#(i2,2),atom#(i2,3)))*0.002
`dist#=(1/CALC_Distance(atom#(i,1),atom#(i,2),atom#(i,3),atom#(i2,1),atom#(i2,2),atom#(i2,3)))*0.002
gosub CALC_Move
atom#(i,4)=atom#(i,4)+x#
atom#(i,5)=atom#(i,5)+y#
atom#(i,6)=atom#(i,6)+z#
endif
next j
rem Final Atom Update
for j = 1 to 3
atom#(i,j)=atom#(i,j)+atom#(i,j+3)
next j
position object i,atom#(i,1),atom#(i,2),atom#(i,3)
rotate object i,0,0,0
next i
rem End Loop
sync
loop
rem 3D Movement Calculation
CALC_Move:
Y#=Y#-(Dist#*sin(AX#))
Temp#=Dist#*cos(AX#)
X#=X#+(Temp#*sin(AY#))
Z#=Z#+(Temp#*cos(AY#))
return
rem 3D Distance Calculation
function CALC_Distance(x1#,y1#,z1#,x2#,y2#,z2#)
dist#=sqrt(((x1#-x2#)^2)+((y1#-y2#)^2)+((z1#-z2#)^2))
endfunction dist#