I want to make a rts game.
I started with object following the mouse.
Here's my code so far:
sync on
fov#=1
set camera fov fov#
set camera range 1,10000
ink rgb(0,100,0),0
box 0,0,100,100
for x=1 to 75
ink rgb(0,rnd(255),0),0
dot rnd(100),rnd(100)
next x
get image 1,0,0,100,100
`make object
make object cube 1,20
`make world
make matrix 1,5000,5000,50,50
prepare matrix texture 1,1,1,1
`positioning
position object 1,2500,0,2500
point object 1,2500,0,2000
position camera 2500,150,2000
point camera 2500,0,2500
do
camy#=camera position y()
camz#=camera position z()
angx#=camera angle x()
angy#=camera angle y()
`calc minz and maxz
minz#=camy#*tan((90-angx#)-fov#)
maxz#=camy#*tan((90-angx#)+fov#)
dist#=maxz#-minz#
`calculate object position
posz#=camz#+minz#+(dist#/480*(480-mousey()))
position object 1,2500,0,posz#
sync
loop
I think it's something with the fov command.
Is that angle really 1°???
greets