Hi, Im having trouble getting the mouse to make a ship roll correctly. Then I want the camera to follow with the ship, so Later I can replace the ship model with a cockpit model.
The problem Im having, is that once you turn the ship around, the roll is like reverse...I dont know how to explain it, but the controls get really twacked out.
Here's my code. Hope someone can tell me what I did wrong.
LOAD OBJECT "Ship.X",1
set object 1,0,1,1,0,0,0,0
Make CAMERA 1
POSITION CAMERA 1,0,100,-100
HIDE MOUSE
position mouse screen width()/2,screen height()/2
ROTATE OBJECT 1,90,-90,180
fix object pivot 1
REM Variables
acc AS FLOAT
decc AS FLOAT=0.98
StrL AS FLOAT
Cspeed AS FLOAT
Dspeed AS FLOAT
HIspeed=100
REM MATRIX
MAKE MATRIX 1,4000,4000,20,20
sxa#=OBJECT ANGLE X(1)
sya#=OBJECT ANGLE Y(1)
DO
Dspeed=Cspeed+mouseZ()
rem TEMP KEY MANOUVERS
IF UPKEY()=1 THEN inc acc
IF DOWNKEY()=1 THEN dec acc
IF LEFTKEY()=1 THEN inc StrL
IF RIGHTKEY()=1 THEN dec StrL
REM MOVE VEHICLE
MOVE OBJECT 1,curvevalue(Dspeed,Cspeed,HIspeed)
MOVE OBJECT LEFT 1,StrL
sx#=OBJECT POSITION X(1)
sy#=OBJECT POSITION Y(1)
sz#=OBJECT POSITION Z(1)
Position Camera 1,sx#,sy#,sz#
REM decrease speed
IF acc>0 OR acc<0 THEN acc=acc*decc
IF StrL>0 OR StrL<0 THEN StrL=StrL*decc
REM MOUSE MOVE
ROLL OBJECT RIGHT 1,sxa#+mousemovex()/2/2
PITCH OBJECT UP 1,sya#+mousemovey()/2/2
sync
LOOP
Im also having trouble getting the camera to follow the same rules as the object.