Miraclecode:
Though you can make a wall with a matrix, I would not recommend that you use walls made like this for collision purposes. It could be done, of course, but you would spend a lot more effort and time than what you would to simply create walls with boxes (or in a 3D modeling program) and place them on the matrix. I've edited the example I gave to include a wall object. The code provides proper collision with the wall.
sync on : sync rate 60 : randomize timer() : autocam off : hide mouse
make matrix 9,1000.0,1000.0,25,25
position matrix 9,0,0,0
for c = 1 to 1500
ink rgb(rnd(128) + 127,rnd(128) + 127,rnd(128) + 127),0
x = rnd(242) : y = rnd(242) : sz = rnd(13) + 1
box x,y,x + sz,y+sz
next c
get image 9,0,0,256,256
cls
prepare matrix texture 9,9,2,2
update matrix 9
position camera 200,10,200
make object box 100,500.0,40.0,20.0
color object 100,rgb(136,0,21) : set object ambience 100,rgb(136,0,21)
set object collision to boxes 100
make object sphere 101,8 : hide object 101 : set object collision to spheres 101
position object 100,587.5,20.0,400.0
repeat
oldx# = object position x(101) : oldy# = object position y(101) : oldz# = object position z(101)
control camera using arrowkeys 0,5.0,2.0
x# = camera position x() : z# = camera position z()
y# = get ground height(9,x#,z#) + 10.0
position camera x#,y#,z# : position object 101,x#,y#,z#
if object collision(101,100) > 0
position camera oldx#,oldy#,oldz# : position object 101,oldx#,oldy#,oldz#
endif
sync
until mouseclick() > 0
delete matrix 9
delete image 9
end