hi there i belive you will find this helpfull are using it my self. Dont remember the author.It was somewhere on the snippets board i found it?
the ability to load x models are disabled in the code so you nead to remove the snippets that create an cube and enable the routine to load in x models simplier the it sounds.
Rem Project: drag
Rem Created: 2005-03-04 18:18:14
Rem ***** Main Source File *****
`editor
sync on
autocam off
color backdrop 0
make matrix 1,1100,1100,20,20
position matrix 1,0,-50,0
r#=10 `cam distance
CamSpeed#=2
dim filename$(3001000)
dim scale#(3001000)
`***** load objects from editor *******
if file exist ("level.dat")=1
open to read 10,"level.dat"
read file 10,numberoftsos
for object=3000001 to 3000000+numberoftsos
read string 10,filename$(object)
read float 10,tsox#
read float 10,tsoy#
read float 10,tsoz#
read float 10,scale#(object)
load object filename$(object),object
position object object,tsox#,tsoy#,tsoz#
scale object object,100+scale#(object),100+scale#(object),100+scale#(object)
next object
close file 10
endif
do
if inkey$()="l" then gosub newobject
if inkey$()="s" then gosub writedata
gosub textguide
gosub camera
gosub moveobject
sync
loop
writedata:
if numberoftsos>0
delete file "level.dat"
open to write 10,"level.dat"
write file 10,numberoftsos
for object=3000001 to 3000000+numberoftsos
write string 10,filename$(object)
write float 10,object position x(object)
write float 10,object position y(object)
write float 10,object position z(object)
write float 10,scale#(object)
next object
endif
text 0,100,"Data saved"
sync
wait 1000
return
newobject:
object=3000001
while object exist (object)=1
inc object
endwhile
sync
text 0,0,"Enter filename of new object: "
sync
wait 1000
`input filename$(object)
`load object filename$(object),object
make object cube object,100
position object object,camera position x(),camera position y(),camera position z()
yrotate object object,camera angle y()
move object object,20
yrotate object object,0
return
textguide:
if texton=0
text 0,0,"Press 'h' for help"
if inkey$()="h" then texton=1
endif
if texton=1
cls
text 0,0,"Press l to load new object"
text 0,20,"Press s to save datafile"
text 0,40,"Mouse and arrow keys control camera"
text 0,80,"When object is selected with left mouse button:-"
text 0,100,"Move object by dragging with mouse"
text 0,120,"Up and down arrow keys move object up and down"
text 0,140,"Left and right arrow keys scale object"
text 0,160,"Press "a" to align object to grid"
text 0,180,"Press any key to return to editor"
sync
wait key
texton=0
endif
return
camera:
if mouseclick()=0 then 3D_Move_Cam(CamSpeed#)
return
FUNCTION 3D_Move_Cam(CamSpeed#)
IF CamSpeed# = 0 THEN EXITFUNCTION
cam_x# = CAMERA ANGLE X() + MOUSEMOVEY() * .2
cam_y# = CAMERA ANGLE Y() + MOUSEMOVEX() * .2
cam_z# = CAMERA ANGLE Z() + MOUSEMOVEZ() * .2
IF upkey() = 1
polarity=1
MOVE CAMERA CamSpeed#
XROTATE CAMERA cam_x#
ENDIF
IF downkey() = 1
polarity=-1
MOVE CAMERA -CamSpeed#
XROTATE CAMERA cam_x#
ENDIF
IF leftkey() = 1
ROTATE CAMERA 0, cam_y#-90, 0
MOVE CAMERA CamSpeed#
ROTATE CAMERA cam_x#, cam_y#, 0
ENDIF
IF rightkey() = 1
ROTATE CAMERA 0, cam_y#+90, 0
MOVE CAMERA CamSpeed#
ROTATE CAMERA cam_x#, cam_y#, 0
ENDIF
ROTATE CAMERA cam_x#, cam_y#, cam_z#
ENDFUNCTION
moveobject:
if picked=0 then object = pick object(mousex(),mousey(),3000001,3001000)
if object>0 and mouseclick()=1 then picked=1
if mouseclick()=2 then picked=0
if picked=1 and mouseclick()=1
hide mouse
recentobject=object
set object emissive object,rgb(255,255,255)
y#=0
if upkey()=1 then y#=0.1
if downkey()=1 then y#=-0.1
if leftkey()=1 then dec scale#(object)
if rightkey()=1 then inc scale#(object)
ang#=object angle y(object)
yrotate object object,camera angle y():move object object,-mousemovey()
yrotate object object,camera angle y()+90:move object object,mousemovex()
yrotate object object,ang#
position object object,object position x(object),object position y(object)+y#,object position z(object)
if inkey$()="a"
position object object,int(object position x(object)/10)*10,int(object position y(object)/10)*10,int(object position z(object)/10)*10
make object cube 4000001,1
position object 4000001,object position x(object)-100,object position y(object),object position z(object)
make object cube 4000002,1
position object 4000002,object position x(object)+100,object position y(object),object position z(object)
make object cube 4000003,1
position object 4000003,object position x(object),object position y(object),object position z(object)-100
make object cube 4000004,1
position object 4000004,object position x(object),object position y(object),object position z(object)+100
line object screen x(4000001),object screen y(4000001),object screen x(4000002),object screen y(4000002)
line object screen x(4000003),object screen y(4000003),object screen x(4000004),object screen y(4000004)
delete object 4000001
delete object 4000002
delete object 4000003
delete object 4000004
endif
scale object object,100+scale#(object),100+scale#(object),100+scale#(object)
endif
if picked=0
show mouse
text 0,20,"No object selected"
y#=0
if recentobject>0 then set object emissive recentobject,rgb(0,0,0)
endif
return
AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).