In my programme there are 12 spheres than move randomly in a 100,100,100 tranparent box, and I wanted to make these objects not overlap but turn and move when they are close more than x. I tryed using a math calculation, but it doesn't work (the objects still overlap) so if anybody modifies my programme
rem general settings
sync on
rem make matrix
make matrix 1,100,100,25,25
set matrix wireframe off 1
position matrix 1,0,-5,0
rem making and positioning the objects
make object sphere 1,10
make object sphere 2,10
make object sphere 3,10
make object sphere 4,10
make object sphere 5,10
make object sphere 6,10
make object sphere 7,10
make object sphere 8,10
make object sphere 9,10
make object sphere 10,10
make object sphere 11,10
make object sphere 12,10
position object 1,0,0,0
position object 2,5,0,0
position object 3,10,0,0
position object 4,15,0,0
position object 5,20,0,0
position object 6,25,0,0
position object 7,0,0,0
position object 8,5,0,0
position object 9,10,0,0
position object 10,15,0,0
position object 11,20,0,0
position object 12,25,0,0
rem coloring the objects
for c=1 to 12
color object 1,0
color object 2,50
color object 3,100
color object 4,150
color object 5,200
color object 6,250
color object 7,-50
color object 8,-100
color object 9,-150
color object 10,-200
color object 11,-250
color object 12,-1
set global collision on
next c
rem loop
do
rem randmly move the objects
for c=1 to 12
move object c,0.2
turn object left c,rnd(5)
turn object right c,rnd(5)
pitch object up c,rnd(5)
pitch object down c,rnd(5)
next c
rem objects stay in a 100,100,100 box
for c=1 to 12
if object position x(c)<0 then position object c,0,object position y(c),object position z(c)
if object position y(c)<0 then position object c,object position x(c),0,object position z(c)
if object position z(c)<0 then position object c,object position x(c),object position y(c),0
if object position x(c)>100 then position object c,100,object position y(c),object position z(c)
if object position y(c)>100 then position object c,object position x(c),100,object position z(c)
if object position z(c)>100 then position object c,object position x(c),object position y(c),100
next c
rem move camera
if upkey()=1 then pitch camera up 1
if downkey()=1 then pitch camera down 1
if leftkey()=1 then turn camera left 1
if rightkey()=1 then turn camera right 1
rem sync
sync
loop
to make it work, I would be vary happy if you sent it to me (nerofrancesco@hotmail.com) or post it in a reply.
Sorry for my English and for the mess in my programme(I didn't even put one comment)!
Bye
Non si inalberi mica con me, sa!
Lei è venuto qui, lei ha il tombino intasato!
Siamo uno spurgo serio, noi!