heres the code
sync
rem make object plane 1,25,.5
rem position object 1,0,0,0
rem make object cylinder 2,3
rem position object 2,0,1,5
load image "media\f_z_01_d2.dds" ,1
load object "media\HUD.x" ,99
make object cube 3, 5
scale object 3, 1000,1,1000
position object 3, 0,-3,0
texture object 3,1
scale object texture 3,10,10
rotate object 99,0,180,0
scale object 99,6,6,6
load mesh "media\HUD.x" ,1
set camera fov 40
do
camx# = camera position x()
camy# = camera position y () -.5
camz# = camera position z ()
camAx# = camera angle x ()
camAy# = camera angle y () + 180
camAz# = camera angle z ()
rem lock object on
ControlCamera( 0.05 )
position object 99, camx#,camy#,camz#
rotate object 99,camAx#,camAy#,camAz#
loop
function ControlCamera( velocity# as float )
camXSpd# = keystate(17) - keystate(31) : camXSpd# = camXSpd# * velocity#
camZSpd# = keystate(30) - keystate(32) : camZSpd# = camZSpd# * velocity#
camYSpd# = keystate(16) - keystate(18) : camYSpd# = camYSpd# * velocity#
x# = camera position x() : y# = camera position y() : z# = camera position z()
yrotate camera wrapvalue( camera angle y() + mousemovex() / 2.0 )
`90 and 270 are the boundaries for the camera rotation in this case
`If the camera rotates out of those boundaries, the program sets it to the closest boundary
temp= wrapvalue( camera angle x() + mousemovey() / 2.0 )
if temp > 270
xrotate camera temp
else
if temp >= 180 then xrotate camera 270
endif
if temp < 90
xrotate camera temp
else
if temp < 180 then xrotate camera 90
endif
ny# = y# - camYSpd#
nx# = x# + camXSpd# * sin( camera angle y() ) + camZSpd# * sin( camera angle Y() - 90.0 )
nz# = z# + camXSpd# * cos( camera angle y() ) + camZSpd# * cos( camera angle Y() - 90.0 )
position camera (nx#), (ny#), (nz#)
endfunction
i need the gun to move with the camera as it rotates up and down
Also this is my first ever DBpro Projetct so im not the best.
EDIT: How can i improve the resolution? Right now it looks laggy, but its the resolution