I am trying to make a 3d space game and have got all the movement down pat except for on the Y axis.....
what kind of formula would i use to calculate the speed to increment the Y axis according to the camera Angle Y?
here is my code if it helps out to show what i am doing
rem old camera angles for mouse movement
oldcAY# = cAY#
oldcAX# = cAX#
rem new camera angles for mouse movement
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
caZ# = Camera angle Z()
rem ship movement
rem upkey = forward
if upkey()=1
X#=Newxvalue(X#,cAY#,7)
Z#=Newzvalue(Z#,cAY#,7)
endif
rem downkey = back
if downkey()=1
X#=Newxvalue(X#,Wrapvalue(cAY#-180),7)
Z#=Newzvalue(Z#,Wrapvalue(cAY#-180),7)
endif
rem leftkey = strafe left
if leftkey()=1
bdX#=bdX#-1
X#=Newxvalue(X#,Wrapvalue(cAY#-90),7)
Z#=Newzvalue(Z#,Wrapvalue(cAY#-90),7)
scroll backdrop bdX#,bdY#
endif
rem rightkey = strafe right
if rightkey()=1
bdX#=bdX#+1
X#=Newxvalue(X#,Wrapvalue(cAY#+90),7)
Z#=Newzvalue(Z#,Wrapvalue(cAY#+90),7)
scroll backdrop bdX#,bdY#
endif
rem rotate camera according to mouse movement
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
rem scroll background according to mouse movement
mmy#=mousemovey()
mmx#=mousemovex()
rem if mouse moves on the Y axis move it accordingly
rem if mouse moves up mmy is a negative number
rem if mouse moves down mmy is positive so all you have to do is just
rem add it in since mmy will determine if it adds or subtracts
if mousemovey()<>0
bdY#=bdY#+mmy#
scroll backdrop bdX#,bdY#
endif
rem if mouse moves on the X axis move it accordingly
rem if mouse moves left mmx is a negative number
rem if mouse moves right mmx is positive so all you have to do is just
rem add it in since mmx will determine if it adds or subtracts
if mousemovex()<>0
bdX#=bdX#+mmx#
scroll backdrop bdX#,bdY#
endif
rem repositions camera according to the new coordinates
Position Camera X#,Y#,Z#
sync
loop