i have a zooming / orbiting camera ,fixed to an offset limb of the player model, mousewheel offsets the limb(also as you zoom "into" the ship it locks into a cockpit view )otherwise camera always points at player model, mousemove orbits the camera. its in space,no terrain to worry about . ... ill make a lill demo...
rem medialess example code by zootan for DBPro
set display mode 1024,768,32
make object cube 1,10
make mesh from object 1,1
add limb 1,1,1
offset limb 1,1,0,0,60
delete mesh 1
hide object 1
make object cube 2,10
rem make some sceenery
for objno = 10 to 200
make object sphere objno,rnd(50)+5
if object collision (objno,1) = 1
position object objno,rnd(1000)-500,rnd(1000)-500,rnd(1000)-500
endif
next objno
do
position object 1,object position x(2),object position y(2),object position z(2)
position camera (0),limb position x(1,1),limb position y(1,1),limb position z(1,1)
offset limb 1,1,0,0,mousez()/12
if mouseclick()=1
xrotate object 1, mousey()
yrotate object 1, mousex()
endif
point camera (0),object position x(1),object position y(1),object position z(1)
rem cockpitview
if (mousez()/12) < 30 and (mousez()/12) > -30 rem mousez() referes to the wheel
position camera (0),object position x(2),object position y(2),object position z(2)
rotate camera (0),object angle x(2),object angle y(2),object angle z(2)
text (1024/2)-10,768/2,"(X)"
rem here i also paste in a cockpit image which pastes over part of the ship model to give the impression of cockpit details
endif
rem ship controls, this is the simple version, my code has inertia and thrust physics
if keystate(32) = 1 then roll object left 2,.05
if keystate(30) = 1 then roll object right 2,.05
if keystate(17) = 1 then move object 2,.05
if keystate(31) = 1 then move object 2,-.05
rem ship turning , this way splits the screen into 4, top left, top right ,bottom left, bottom right, the cursor in each quad turnes the ship
if mouseclick()=2
if mousex()>1024/2 then mx#=-.05
if mousex()<1024/2 then mx#=.05
if mousey()>768/2 then my#=-.05
if mousey()<768/2 then my#=.05
if mousex()=0 then mx#=0
if mousey()=0 then my#=0
pitch object up (2), my#
turn object left (2), mx#
endif
text 20,20,"W,S forward back. A,D roll left right, Mouse 2 hold + mouse move to pitch and turn "
text 20,40,"mousewheel to zoom, left click to orbit camera. "
loop
there a room to play in
this is just the ship controls , not the net game!
the main reason i wish to send all info in one message is because of dropped packages messing the results of the net int and net floats,which results in a jittery player 2