Personally this is what I would do:
Make your planet, either a sphere, or whatever, maybe a model with some hills etc. Don't use a matrix.
you then have to calculate the coords of where on the planet you want to be at (roughly).
Then, to stay above the mountains, you would cast a ray from yourself to the center of the planet. Then find your distance, from the planet.
Then, the next stage is pretty much like the first one, instead we need to calculate it using the distances we just found.
So, lets say the distance we just found in that picture was called d, the angles between you and the center of the planet are called, ax, and ay. This is how we calculate the coords that we wanna land on:
Land Pos X = Planet Pos X + (sin(ay)*cos(ax))*d
Land Pos Y = Planet pos Y - (sin(ax)*d)
Land Pos Z = Planet Pos Z + (cos(ay)*cos(ax))*d
Then, if you wanna land, just use the curvevalue command to turn your current values into land pos x etc.
One thing: DBC doesn't suppost ray casting, check out sparky's collision dll
[edit]
Here's a small example of it in 2d, obviously it's not as fully made as it should because it doesn't have mountins and stuff, but just to show you roughly what I mean. It will calculate roughly where you want to land, excluding hills and stuff, but this is in 2d, the equations in 3D are slightly difernt because youve to take another angle value into account.
`Setup
Sync on : Sync rate 60
Set display mode 1024,768,16 : Hide Mouse
`Setup Planet
PlanetX=Screen Width()/2
PlanetY=Screen Height()/2
Radius=200
`**Main Loop**
Do
Cls
`Stuff
MX=MouseX()
MY=MouseY()
MC=MouseClick()
`Draw Player
Ink rgb(128,128,128),0
box mx-5,my-5,mx+5,my+5
`Draw Planet
Ink rgb(0,255,0),0
Circle planetX,PlanetY,Radius
`Show position to land (2D)
If mc=1
showray=1
else
showray=0
endif
a=atanfull(mx-planetx,my-planety)
landx=planetx+(sin(a)*radius)
landy=planety+(cos(a)*radius)
ink rgb(255,0,0),0
circle landx,landy,5
`Info
if showray=1
ink rgb(255,0,255),0 : line planetx,planety,mx,my
ink rgb(255,255,255),0 : text landx+10,landy+10,"Point where you wanna land"
endif
ink rgb(255,255,255),0
Text 10,10,"Press the left mouse button to see the ray."
`**End Loop**
Sync
Loop