sync on
randomize timer()
make object cube 1,10
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
sync
loop
And the cube moves around randomily.
EDIT
A few cubes:
sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop
/EDIT
EDIT2
And so you can see them better:
sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
move camera -25
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop
/EDIT2
EDIT3
Now you always see them and they're colored randomily!
sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
color object 1,rgb(rnd(255),rnd(255),rnd(255))
color object 2,rgb(rnd(255),rnd(255),rnd(255))
color object 3,rgb(rnd(255),rnd(255),rnd(255))
color object 4,rgb(rnd(255),rnd(255),rnd(255))
move camera -25
do
point camera object position x(1),object position y(1),object position z(1)
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop
/EDIT3
EDIT4
I'm using DBPro but these should work on DBC.
/EDIT4
Now to explain the commands I used:
`Make sure the screen only refreshes when the sync command is read to make the app go faster
sync on
`Make the app produce diffrent resaults every run
randomize timer()
`Make the cube
make object cube 1,10
`Start a loop
do
`Position the cubes randomily(i'll explain how this works)
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
`Update the screen
sync
`End the loop
loop
-----------------------------------------------------------------------
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
Can be broken up into parts.
position object 1, - position the cube
(object position x(1)-0.1) - the cubes x position minus 0.1
+(rnd(10)/10), - plus a random number up to ten and divided by ten
(object position y(1)-0.1)+(rnd(10)/10), - same except with the y position
(object position z(1)-0.1)+(rnd(10)/10) - the z position
-----------------------------------------------------------------------
More commands I used:
move camera -25 - move the camera back 25 units
color object 2,rgb(rnd(255),rnd(255),rnd(255))
can also be broken into parts:
color object 2, - color the second cube
rgb( - convert rgb to db color code
rnd(255), - random number from 0 to 255
rnd(255),rnd(255) - same and same
) - tell db to close the command
-Ilya