I am almost there if you look at the Free flight example I have modified I have manged with a help from Jess Ticular to get 1st and 3rd person views as a fairly decent H.O.T.A.S joystick controlled plane but I am still having problems with the Joystick Hat commands, I want to get the camera , in the 1st person, to loook around the cockpit and look left, right up and just like most flight and space simulator games
rem DARK BASIC EXAMPLE PROGRAM 18
rem ==========================================
rem This program shows free flight movement with H.O.T.A.S sticks
rem ------------------------------------------
rem updated by Vampyre(Ian George)
autocam off
hide mouse
sync on
rem Make wire sky sphere
make object sphere 1,5000
set object 1,0,0,0
rem Make flying object
make object box 2,150,5,20
make mesh from object 2,2
delete object 2
make object box 2,25,15,100
add limb 2,1,2
position object 2,0,0,500
rem Make drone to mark a back position
make object sphere 3,10
rem Set camera range
set camera range 1,10000
rem Set text font
set text font "Arial"
ink rgb(255,255,0),0
set text size 30
rem Main loop
do
rem User prompt
center text 320,0,"FREE FLIGHT ORIENTATION"
center text 320,25,"If you Have any H.O.T.A.S System ,"
center text 320,50,"Use the Joystick to Pitch Up and Down"
center text 320,70,"Use Your H.O.T.A.S. Rudders to Roll"
center text 320,90,"Use Your Joystick Throttle to Move"
center text 320,110,"Use SPACE to Reset"
rem Control free flight object
if joystick up() then pitch object up 2,5
if joystick down() then pitch object down 2,5
if joystick twist z()=1000 then turn object left 2,5
if joystick twist z()=-1000 then turn object right 2,5
if joystick left()= 1 then roll object left 2,5
if joystick right()= 1 then roll object right 2,5
if joystick slider a()=0 then move camera 20 : move object 2,20
if spacekey()=1 then rotate object 2,0,0,0
rem Get back position of object for camera
pitch object down 2,11
move object 2,-150
position object 3,object position x(2),object position y(2),object position z(2)
move object 2,150
pitch object up 2,11
Rem switch camera's from 1st to 3rd person camera's
If InKey$() = "3" And cammode = 0 Then cammode = 1 : `Set the camera mode to third person
If InKey$() = "1" And cammode = 1 Then cammode = 0 : `Set the camera mode to first person
rem do first person
If cammode = 0
position camera object position x(2),object position y(2),object position z(2)
set camera to object orientation 2
EndIf
if joystick hat angle(0)=0 then pitch camera up 2.5
if joystick hat angle(0)=18000 then pitch camera down 2.5
if joystick hat angle(0)=27000 then turn camera left 2.5
if joystick hat angle(0)=9000 then turn camera right 2.5
rem do third person
If cammode = 1
position camera object position x(3),object position y(3),object position z(3)
set camera to object orientation 2
EndIf
rem Update screen
sync
loop
I know I have asked this before but I really need help from someone with a joystick with a hat control, I am really close and I need to have it in this example,
Sorry I should have said that the joystick hat commands don't work it this code snippet. Is there anyone from Starwraith 3D an get in touch with? I really need help with this