Hey everyone!!,
Once again I AM a newbie, and once again I also have another question. Im having trouble coming up with a mathmatical way of makeing basic flight sim controls (i.e... roll,pitch,yaw) without the controls getting mixed up when I try to "fly". For instance, on some cases the camera is pointed 1 direction and moves in another. Well anyway, i fiddled and farted around with the numbers and eventually came up with this
Rem ***** Main Source File *****
autocam off : hide mouse
rem load world
make matrix 1,2000,2000,50,50
randomize matrix 1, 30
position matrix 1,0,0,0
rem "i" stands for initial position
ix#=1000
iy#=get ground height (1,ix#,iz#)
iz#=1000
rem "r" stands for rotation
rx#=0
ry#=0
rz#=0
rem int position camera
position camera ix#,iy#,iz#
rem ----------------------------------------------------------
rem main loop
rem ----------------------------------------------------------
do
rem camera
rem controls
rem control camera using arrowkeys 0,.5,.5
if leftkey()=1 then rotate camera rx#,ry#,rz#+1 : if leftkey()=1 then rz#=rz#-1
if rightkey()=1 then rotate camera rx#,ry#,rz#-1 : if rightkey()=1 then rz#=rz#+1
if upkey()=1 then rotate camera rx#+1,ry#,rz# : if upkey()=1 then rx#=rx#+1
if downkey()=1 then rotate camera rx#-1,ry#,rz# : if downkey()=1 then rx#=rx#-1
if spacekey()=1 then position camera ux#,uy#,uz#
rem "p" stands for position
px#= camera position x(0)
py#= camera position y(0)
pz#= camera position z(0)
rem "u" stands for updated position
ux#=newxvalue(px#,rx#,1)
uy#=newyvalue(py#,ry#,1)
uz#=newzvalue(pz#,rz#,1)
dx=camera position x(0)
dy=camera position y(0)
dz=camera position z(0)
rem Control player movement
print "Xposition-",dx," Yposition-",dy," Zposition-",dz
loop
i tried to make it possible for any1 to run it without downloading anything like textures or objects. Umm thats about it i think
Those who Fight with swords get killed by those who don't