For the snipering use "set camera fov" - this provides an effective zoom.
`Sniper zoom example
`Author - Ben aka Mop
`[email protected]
`http://www.binarymoon.co.uk
`Date - 24/6/2001
`if anyone makes any improvements email them to me or post them
`on the DB forum for all to see
`and give me credit if you use it in a game of yours :)
`NOTE
`the set camera fov command forces a sync so you should remove
`the sync command from your game (only if you call the set fov
`command every loop)
sync on
sync rate 60
hide mouse
set camera range 1,3000
fog on
fog distance 1000
fog color RGB(255,128,128)
`-------------
`camera object
`-------------
make object cube 1,10
scale object 1,100,300,100
position object 1,0,15,0
fix object pivot 1
hide object 1
`-------------------------------------------------------------
`from here to the main loop you would put your load world stuff
`-------------------------------------------------------------
`------------
`set up world
`------------
make matrix 1,1000,1000,20,20
load image "floor1.bmp",1
prepare matrix texture 1,1,2,2
randomize matrix 1,30
`----------
`simple sky
`----------
make object sphere 10,2000
color object 10,RGB(255,255,0)
scale object 10,100,20,100
set object 10,1,1,0
`----------------------------
`create some boxes to look at
`----------------------------
for i=1 to 50
make object cube i+100,10+rnd(4)
x#=rnd(1000)
z#=rnd(1000)
y#=get ground height(1,x#,z#)+30+rnd(20)
position object i+100,x#,y#,z#
next i
`------------------
`set start location
`------------------
position object 1,500,0,500
`---------
`main loop
`---------
main:
do
`---------------
`camera controls
`---------------
if upkey()=1 then move object 1,5
if downkey()=1 then move object 1,-5
if leftkey()=1 then yrotate object 1,wrapvalue(a#-90) : move object 1,2 : yrotate object 1,a#
if rightkey()=1 then yrotate object 1,wrapvalue(a#+90) : move object 1,2 : yrotate object 1,a#
mx#=mousemovex()/2
my#=mousemovey()/4
a#=curveangle(a#+mx#,a#,1.5)
cama#=curveangle(cama#+my#,cama#,1.5)
`------------------
`position character
`------------------
x#=object position x(1)
z#=object position z(1)
y#=get ground height(1,x#,z#)+15
yrotate object 1,a#
position object 1,x#,y#,z#
position camera x#,y#,z#
rotate camera cama#,a#,0
`------------
`position sky
`------------
position object 10,x#,y#,z#
`-----------------
`SNIPER ZOOM STUFF
`-----------------
`ythis took some playing but once I worked out what was going
`on it was easy to do - in fact it was easier than I thought it
`would be (well... used less code anyway)
`don't make maxzoom# any lower than -0.8
`if you make the number positive you will zoom out
`if you make the number closer to 0 you won't zoom so close
if mouseclick()=2 then maxzoom#=-0.8
if mouseclick()=0 then maxzoom#=0 : zoom#=0
zoom#=curvevalue(maxzoom#,zoom#,20)
set camera fov zoom#+70
text 10,10, "Sniper zoom example - by Ben aka Mop"
text 10,30, "FPS = "+str$(screen fps())
text 10,50, "Zoom amount = "+str$(int(zoom#*-100)/0.8)+"%"
loop
One file needed, "floor1.bmp".
Visit [url]www.lightning-systems.co.uk[/url]
You are the

th person to view this signature.