I had very same problem with project of mine.Instead of moving my object around the space i move everything else in a manner that resembles traveling.It was sci-fi rpg and the travel was trough space, i'm not sure if this can help you or if it is even possible to do it with terrain but it works really well, so there is the code.
sync on: sync rate 60
type offset_positions
x# as float
y# as float
z# as float
x_larger as byte
y_larger as byte
z_larger as byte
endtype
dim offset(20,20) as offset_positions
for i = 11 to 18
make object cube i,10
position object i,rnd(80)-rnd(80),rnd(80)-rnd(80),rnd(80)-rnd(80)
next i
for i = 11 to 18
for n = 11 to 18
offset(i,n).x# = sqrt(((object position x(n) - object position x(i)))^2)
offset(i,n).y# = sqrt(((object position y(n) - object position y(i)))^2)
offset(i,n).z# = sqrt(((object position z(n) - object position z(i)))^2)
if object position x(n) > object position x(i)
offset(i,n).x_larger = 0
else
offset(i,n).x_larger = 1
endif
if object position y(n) > object position y(i)
offset(i,n).y_larger = 0
else
offset(i,n).y_larger = 1
endif
if object position z(n) > object position z(i)
offset(i,n).z_larger = 0
else
offset(i,n).z_larger = 1
endif
next n
next i
make object sphere 1,10,20,20
position object 1,0,0,0
`MAKE DUMMY OBJECT
make object sphere 100,0.1,20,20
position object 100,0,0,0
`CAMERA STUFF
ZOOM#=-1.100
SPEED# = 0.5
CameraControl(1,3,1,0,0.200,ZOOM#,0,0,0,SPEED#,1,1,0,0,-120,50,0,0)
do
if mouseclick()=1
selected_object = pick object (mousex(),mousey(),2,22)
endif
if selected_object <> 0 then poi = selected_object
if poi <> 0
Dist# = GetDistance#(object position x(1),object position y(1),object position z(1),object position x(poi),object position y(poi),object position z(poi))
if Dist# > 10
if move = 0
position object 100,object position x(poi),object position y(poi),object position z(poi)
point object 100,object position x(1),object position y(1),object position z(1)
move = 1
endif
move object 100,1
position object poi,object position x(100),object position y(100),object position z(100)
for n = 11 to 18
if offset(poi,n).x_larger = 1
obj_pos_x# = object position x(poi) - offset(poi,n).x#
else
obj_pos_x# = object position x(poi) + offset(poi,n).x#
endif
if offset(poi,n).y_larger = 1
obj_pos_y# = object position y(poi) - offset(poi,n).y#
else
obj_pos_y# = object position y(poi) + offset(poi,n).y#
endif
if offset(poi,n).z_larger = 1
obj_pos_z# = object position z(poi) - offset(poi,n).z#
else
obj_pos_z# = object position z(poi) + offset(poi,n).z#
endif
position object n,obj_pos_x#,obj_pos_y#,obj_pos_z#
next n
else
move = 0
endif
endif
if mouseclick() = 2
INC ZOOM#,MOUSEMOVEZ()*.05
CameraControl(1,3,1,0,0.200,ZOOM#,0,0,0,SPEED#,1,1,0,0,-120,50,0,0)
endif
CamY#=CamY#+MOUSEMOVEX()*SPEED#
CamX#=CamX#+MOUSEMOVEY()*SPEED#
INC ZOOM#,MOUSEMOVEZ()*.05
Zoom(1,3,1,0,0.200,ZOOM#,0,0,0,SPEED#,1,1,0,0,-120,50,0,0)
text 0,0,"last_: "+str$(last_poi)
text 0,20,"poi: "+str$(poi)
text 0,40,"Dist#: "+str$(Dist#)
text 0,60,"distz: "+str$(distz#)
text 0,80,"offset(12).x#: "+str$(offset(12,11).x#)
text 0,100,"offset(12).y#: "+str$(offset(12,11).y#)
text 0,120,"offset(12).z#: "+str$(offset(12,11).z#)
text 0,140,"offset(11).x#: "+str$(offset(11,12).x#)
text 0,160,"offset(11).y#: "+str$(offset(11,12).y#)
text 0,180,"offset(11).z#: "+str$(offset(11,12).z#)
text 0,200,"move: "+str$(move)
sync
loop
function points(poi)
if poi <> 0
angleX1# = object angle x(1)
angleY1# = object angle y(1)
angleZ1# = object angle z(1)
point object 1, object position x(poi), object position y(poi), object position z(poi)
rotate object 1, curveangle(object angle x(1), angleX1#, 400.0), curveangle(object angle y(1), angleY1#, 400.0), angleZ1#
endif
endfunction
FUNCTION CameraControl(Object, Dummy, Mesh, X#, Y#, Z#, XTilt#,YTilt#,ZTilt#, Speed#, DumX, DumY, ObjX, ObjY, MaxUp#, MaxDown#, MaxLeft#, MaxRight#)
IF OBJECT EXIST(Dummy)=0
DIM CamX#(0)
DIM CamY#(0)
MAKE OBJECT TRIANGLE Dummy, 0,0,0,0,0,0,0,0,0
MAKE MESH FROM OBJECT Mesh, Dummy
ADD LIMB Dummy, 1, Mesh
DELETE MESH Mesh
ENDIF
IF OBJECT EXIST(Dummy)=1
OFFSET LIMB Dummy, 1, X#, Y#, Z#
IF Speed#=0
IF X#=0 AND Y#=0 AND Z#=0
POSITION CAMERA OBJECT POSITION X(Object),OBJECT POSITION Y(Object),OBJECT POSITION Z(Object)
POINT CAMERA OBJECT POSITION X(Object), OBJECT POSITION Y(Object), OBJECT POSITION Z(Object)
ENDIF
ENDIF
IF X#>0 OR Y#>0 OR Z#>0
POSITION OBJECT Dummy, OBJECT POSITION X(Object),OBJECT POSITION Y(Object), OBJECT POSITION Z(Object)
POSITION CAMERA LIMB POSITION X(Dummy, 1),LIMB POSITION Y(Dummy, 1),LIMB POSITION Z(Dummy, Object)
POINT CAMERA OBJECT POSITION X(Object)+XTilt#, OBJECT POSITION Y(Object)+YTilt#, OBJECT POSITION Z(Object)+ZTilt#
ENDIF
IF Speed#>0
IF X#=0 AND Y#=0 AND Z#=0
POSITION CAMERA OBJECT POSITION X(Object),OBJECT POSITION Y(Object),OBJECT POSITION Z(Object)
XROTATE CAMERA CamX#(0)
YROTATE CAMERA CamY#(0)
ENDIF
CamY#(0)=CamY#(0)+MOUSEMOVEX()*Speed#
CamX#(0)=CamX#(0)+MOUSEMOVEY()*Speed#
IF MaxUp#>0 OR MaxUp#<0
`IF CamX#(0)<MaxUp# THEN CamX#(0)=MaxUp#
ENDIF
IF MaxDown#>0 OR MaxDown#<0
`IF CamX#(0)>MaxDown# THEN CamX#(0)=MaxDown#
ENDIF
IF MaxLeft#>0 OR MaxLeft#<0
IF CamY#(0)<MaxLeft# THEN CamY#(0)=MaxLeft#
ENDIF
IF MaxRight#>0 OR MaxRight#<0
IF CamY#>MaxRight# THEN CamY#=MaxRight#
ENDIF
IF DumX=1
XROTATE OBJECT Dummy,CamX#(0)
ENDIF
IF DumY=1
YROTATE OBJECT Dummy,CamY#(0)
ENDIF
IF ObjX=1
XROTATE OBJECT Object, CamX#(0)
ENDIF
IF ObjY=1
YROTATE OBJECT Object, CamY#(0)
ENDIF
ENDIF
ENDIF
ENDFUNCTION CameraControl
`ZOOM
Function Zoom(Object, Dummy, Mesh, X#, Y#, Z#, XTilt#,YTilt#,ZTilt#, Speed#, DumX, DumY, ObjX, ObjY, MaxUp#, MaxDown#, MaxLeft#, MaxRight#)
IF OBJECT EXIST(Dummy)=0
DIM CamX#(0)
DIM CamY#(0)
MAKE OBJECT TRIANGLE Dummy, 0,0,0,0,0,0,0,0,0
MAKE MESH FROM OBJECT Mesh, Dummy
ADD LIMB Dummy, 1, Mesh
DELETE MESH Mesh
ENDIF
IF OBJECT EXIST(Dummy)=1
OFFSET LIMB Dummy, 1, X#, Y#, Z#
IF Speed#=0
IF Z#=0
POSITION CAMERA OBJECT POSITION X(Object),OBJECT POSITION Y(Object),OBJECT POSITION Z(Object)
POINT CAMERA OBJECT POSITION X(Object), OBJECT POSITION Y(Object), OBJECT POSITION Z(Object)
ENDIF
ENDIF
POSITION OBJECT Dummy, OBJECT POSITION X(Object),OBJECT POSITION Y(Object), OBJECT POSITION Z(Object)
POSITION CAMERA LIMB POSITION X(Dummy, 1),LIMB POSITION Y(Dummy, 1),LIMB POSITION Z(Dummy, Object)
POINT CAMERA OBJECT POSITION X(Object)+XTilt#, OBJECT POSITION Y(Object)+YTilt#, OBJECT POSITION Z(Object)+ZTilt#
IF Speed#>0
IF Z#=0
POSITION CAMERA OBJECT POSITION X(Object),OBJECT POSITION Y(Object),OBJECT POSITION Z(Object)
XROTATE CAMERA CamX#(0)
YROTATE CAMERA CamY#(0)
ENDIF
CamY#(0)=CamY#(0)+MOUSEMOVEX()*Speed#
CamX#(0)=CamX#(0)+MOUSEMOVEY()*Speed#
IF MaxUp#>0 OR MaxUp#<0
IF CamX#(0)<MaxUp# THEN CamX#(0)=MaxUp#
ENDIF
IF MaxDown#>0 OR MaxDown#<0
IF CamX#(0)>MaxDown# THEN CamX#(0)=MaxDown#
ENDIF
IF MaxLeft#>0 OR MaxLeft#<0
IF CamY#(0)<MaxLeft# THEN CamY#(0)=MaxLeft#
ENDIF
IF MaxRight#>0 OR MaxRight#<0
IF CamY#>MaxRight# THEN CamY#=MaxRight#
ENDIF
IF DumX=1
XROTATE OBJECT Dummy,CamX#(0)
ENDIF
IF DumY=1
YROTATE OBJECT Dummy,CamY#(0)
ENDIF
IF ObjX=1
XROTATE OBJECT Object, CamX#(0)
ENDIF
IF ObjY=1
YROTATE OBJECT Object, CamY#(0)
ENDIF
ENDIF
ENDIF
endfunction Zoom
Function GetDistance#( X1#, Y1#, Z1#, X2#, Y2#, Z2# )
Dist_X# = X1# - X2#
Dist_Y# = Y1# - Y2#
Dist_Z# = Z1# - Z2#
Distance# = Sqrt(Dist_X# * Dist_X# + Dist_Y# * Dist_Y# + Dist_Z# * Dist_Z#)
EndFunction Distance#
Coding is My Kung Fu!
And My Kung Fu is better than Yours!