I am writing a 3D flying starwars game, but I don't know how to overlay a bitmap so that it looks like you are in a cockpit. How do I do this, and can I have it in good detail?
Rem ++++++++++++++++++++++++++++++++++++++++++++
Rem +++++++++ Star Wars - Hoth wars ++++++++++++
Rem ++++++++++++++++++++++++++++++++++++++++++++
rem Initialisation
sync on
sync rate 30
hide mouse
autocam off
rem Make a terrain to fly over
make matrix 1,10000,10000,50,50
rem texture matrix
load image "grass10.bmp",2
Prepare matrix texture 1,2,2,2
rem skysphere
make object sphere 2,10000
load image "test1.bmp",1
set object 2,1,0,0
Texture object 2,1
rem tie fighter
load object "Tie fighter.x",1
position object 1,0,0,100
rem background texture
texture backdrop 1
REm load the bullet
Make object sphere 3,3
rem Set up initial positions and angles
x#=5000
y#=200
z#=5000
theta#=0
phi#=0
thruststep#=0.1
do
rem Mouseclicks control speed
`if mouseclick()=1 then thrust#=thrust#+thruststep#
`if mouseclick()=2 then thrust#=thrust#-thruststep#
rem Now the joystick button controls speed
if joystick fire b()=1 then thrust#=thrust#+thruststep#
rem fill
rem Mouse movements control angles
`theta#=wrapvalue(theta#+mousemovex())
`phi#=wrapvalue(phi#+mousemovey())
rem Joystick controls angles
rem Change the value (currently 0.005) to set sensitivity
theta#=wrapvalue(theta#+(joystick x()*0.005))
phi#=wrapvalue(phi#-(joystick y()*0.005))
rem Decay the thrust so you don't go really fast
thrust#=thrust#*0.9
xaxisstrafe#=xaxisstrafe#*0.9
yaxisstrafe#=yaxisstrafe#*0.9
rem Accelerate the velocities (this took ages to work out)
xvel#=xvel#+(sin(theta#)*cos(phi#)*thrust#)
yvel#=yvel#-(sin(phi#)*thrust#)
zvel#=zvel#+(cos(theta#)*cos(phi#)*thrust#)
xvel#=xvel#+(sin(theta#+90)*xaxisstrafe#)
zvel#=zvel#+(cos(theta#+90)*xaxisstrafe#)
xvel#=xvel#+(sin(theta#)*cos(phi#+90)*yaxisstrafe#)
yvel#=yvel#-(sin(phi#+90)*yaxisstrafe#)
zvel#=zvel#+(cos(theta#)*cos(phi#+90)*yaxisstrafe#)
rem Some friction to stop you going too fast
xvel#=xvel#*0.99
yvel#=yvel#*0.99
zvel#=zvel#*0.99
rem Simple velocity
x#=x#+xvel#
y#=y#+yvel#
z#=z#+zvel#
rem Rotate and position the camera
position camera x#,y#,z#
yrotate camera theta#
xrotate camera phi#
Rem shoot bullet
if joystick fire a()=1 and BulletLife=0
Position object 3,x#,y#,z#
Set object to camera orientation 3
BulletLife =25
Show object 3
Endif
Rem where the bullet moves
if BulletLife > 0
Dec BulletLife
Move object 3,20
if BulletLife = 0 then Hide object 3
Endif
sync
loop