The reason your rendering is going mental is because the camera range you have set from 0 to some number. How well the z-buffer works (thing that decides which things are in front of other things) basically depends on the ratio of the maximum distance to minimum, so with the minimum set to 0, it works infinitely badly, or something!
put
set camera range 1, 1, 10000
and it should work better. There are some other things you'll want to change too. For instance, why don't you use camera 0, and you should also position the skybox at the camera position prior to each sync. Anyway, keep it up, and have fun!
Here's your code. I changed the cam range, set the skysphere position before syncing, and made the skysphere a little bigger. I didn't know about setting the sphere size negative before! Thanks.
rem my first attempt at a world
color backdrop 0
make camera 1
position camera 1,5000,20,5000
`autocam on
set camera range 1, 1, 10000
sync on
sync rate 60
makeworld(100,200,100)
makesky(100,100,200)
set ambient light 60
housetex()
make object box 2, 250,50,200
position object 2, 5500,10,5510
texture object 2, 10
do
control camera using arrowkeys 1, 5, 1
if camera position X (1) > 7300 then position camera 1, 3500,20,5000
if camera position X (1) < 2700 then position camera 1, 6500,20,5000
if camera position z (1) > 7300 then position camera 1, 5000,20,3500
if camera position z (1) < 2700 then position camera 1, 5000,20,6500
position object 1, camera position x(1),20.0,camera position z(1)
sync
loop
function housetex()
create bitmap 10, 1000,1000
ink rgb(200,200,200), rgb(200,200,200)
box 0,0,1000,500
ink rgb(200,100,100), rgb(200,100,100)
box 200,100,500,300
box 600,100,800,500
ink rgb(255,255,255), rgb(255,255,255)
box 210,110,490,290
copy bitmap 10, 0
get image 10, 0,0,1000,500
delete bitmap 10
endfunction
function makeworld(r,g,b)
create bitmap 1, 500, 500
ink rgb(r,g,b), rgb(r,g,b)
box 0,0,200,200
copy bitmap 1, 0
get image 1, 0,0,200,200
make matrix 1, 10000,10000,100,100
position matrix 1, 0,-10,0
prepare matrix texture 1, 1, 10,10
`randomize matrix 1, 2000
delete bitmap 1
endfunction
function makesky(r,g,b)
create bitmap 2, 500, 500
ink rgb(r,g,b), rgb(r,g,b)
box 0,0,200,200
copy bitmap 2,0
get image 2, 0,0,200,200
make object sphere 1, -10000
position object 1, 5000,-10,5000
texture object 1, 2
delete bitmap 2
endfunction
