Here's that example. It's the same example by EVOLVED, so credits go to him. I just changed a bit to suit your needs, I hope?
If there are some things you don't understand, then just ask, and I'll try to answer as good as I can.
`Set Up Display
Sw=1024:Sh=768
set display mode Sw,Sh,32,1
sync on : sync rate 0
hide mouse
`Set Text
set text font "Verdana"
set text size 15
set text to bold
ink rgb(200,200,0),0
`Setup Camera
backdrop on
color backdrop rgb(28,28,28)
autocam off
position camera 0,0,-150
set camera fov 85
xrotate camera 30
CamDis#=-100
`Load Textures
load image "Media/Wood.tga",1 : image=1
load image "Media/Wood_n.tga",2
make camera 1
set camera to image 1,3,512,512
color backdrop 1,rgb(255,255,255)
Make Dynamic Cube Map 1,512
`Create Object
load effect "FX/CubicShadowMapping.fx",1,0
load object "Media/t-pot.x",1 : object=1
scale object 1,3500,3500,3500
scale object texture 1,0,4,3
texture object 1,0,1
texture object 1,1,2
Apply Cube Map To Object 1,2,1
set object effect 1,1
`Create floor + wall
load object "Media/platform.x",2
MAKE OBJECT PLANE 3,100,100
LOAD IMAGE "Media/wall.tga", 3
LOAD IMAGE "Media/wall_n.tga", 4
scale object 2,850,850,850
scale object 3,850,850,850
position object 2,0,-105,0
position object 3,0,105,250
texture object 2,0,1
texture object 2,1,2
texture object 3,0,3
texture object 3,1,4
Apply Cube Map To Object 2,2,1
Apply Cube Map To Object 3,2,1
scale object texture 2,0,5,5
scale object texture 3,0,5,5
set object effect 2,1
set object effect 3,1
`Create other objects
MAKE OBJECT CUBE 5,42
POSITION OBJECT 5,-100,0,0
load image "Media/Fieldstone.tga",5
load image "Media/Fieldstone_n.tga",6
texture object 5,0,5
texture object 5,1,6
Apply Cube Map To Object 5,2,1
set object effect 5,1
`Light Flare
load image "Media/Flare.JPG",20
make object plain 20,50,50
texture object 20,20
POSITION OBJECT 20, 0, 60, 0
ghost object on 20
set object ambient 20,0
vec=make vector4(1)
`Start loop
do
`Control Camera
position camera 0,0,0
if mouseclick()=0
xrotate camera camera angle x()-mousemovey()*0.25
yrotate camera camera angle y()+mousemovex()*0.25
if camera angle x()>80 then xrotate camera 80
if camera angle x()<-60 then xrotate camera -60
endif
if mouseclick()>0 then CamDis#=CamDis#-mousemovey()*0.25
CamDis#=CamDis#+mousemovez()*0.25
if upkey()=1 then CamDis#=CamDis#+2.5
if downkey()=1 then CamDis#=CamDis#-2.5
if CamDis#>-40 then CamDis#=-40
if CamDis#<-430 then CamDis#=-430
move camera CamDis#
if camera position y()<-60 then position camera camera position x(),-60,camera position z()
mousemovex()=0
mousemovey()=0
`Rotate object
if KEYSTATE(19)=1 and rotate=1 and nopress=0 then rotate=0:nopress=1
if KEYSTATE(19)=1 and rotate=0 and nopress=0 then rotate=1:nopress=1
if rotate=0
rotate object 1,0,object angle y(1)+0.5,0
endif
IF LEFTKEY() = 1
MOVE OBJECT LEFT 20, 1
ENDIF
IF RIGHTKEY() = 1
MOVE OBJECT RIGHT 20, 1
ENDIF
set vector4 1,object position x(20),object position y(20),object position z(20),0
set effect constant vector 1,"LightPosition",1
`Change Texture
if KEYSTATE(20)=1 and nopress=0
delete image 1:delete image 2
inc image
if image>4 then image=1
if image=1 then load image "Media/Wood.tga",1:load image "Media/Wood_n.tga",2
if image=2 then load image "Media/Fieldstone.tga",1:load image "Media/Fieldstone_n.tga",2
if image=3 then load image "Media/wall.tga",1 :load image "Media/wall_n.tga",2
if image=4 then load image "Media/rockwall.tga",1 :load image "Media/rockwall_n.tga",2
texture object 1,0,1:texture object 1,1,2
texture object 2,0,1:texture object 2,1,2
nopress=1
endif
`Change Object
if Spacekey()=1 and nopress=0
delete object 1
inc object
if object>5 then object=1
if object=1 then load object "Media/t-pot.x",1:scale object 1,4500,4500,4500:scale object texture 1,0,4,3
if object=2 then load object "Media/Tosus.x",1:scale object texture 1,0,1.5,1
if object=3 then make object box 1,75,75,75
if object=4 then make object sphere 1,75,40,40:scale object texture 1,0,2,1
if object=5 then make object cylinder 1,75:scale object texture 1,0,3,1
texture object 1,0,1:texture object 1,1,2:Apply Cube Map To Object 1,2,1:texture object 1,3,3
set object effect 1,1
nopress=1
endif
if scancode()=0 then nopress=0
`Text
center text sw/2,15,"T - Change Texture Space - Change Object R - Rotate Object Left-Right arrows: Move Light Mouse: Rotate and move camera"
center text sw/2,40,"FPS "+str$(screen fps())
`Render shadiow map
set effect technique 1,"DepthMap"
Render Dynamic Cube Map 1,1,object position x(20),object position y(20),object position z(20)
`Main Scene
set effect technique 1,"ShadowMapping"
sync mask 2^0
`End loop
sync
loop
Did this help you?
Cheers
Slayer rules!!! Yeaaah, man!