Its not that i'm blaming the language for my imperfect use of it, but as far as i can tell, using newvalue to strafe of position a 3rd person camera only works... somewhat. tinker with this code, you'll see. either i've done something wrong or newvalue only works when facing one direction.. (i think its a problem with wrapping)
if wrapping is the problem, then the solution would be to use the x z and object angle values to triangulate the coorodinates for the camera no?(tell me theres another way...)
make matrix 1,1000,10003,35,35
make object cube 1,35
position object 1,500,35,530
position camera 500,45,455
sync on : sync rate 100
do
if upkey()=1 then move object 1,10
if downkey()=1 then move object 1,-10
if leftkey()=1 then turn object left 1,5
if rightkey()=1 then turn object right 1,5
set cursor 0,0
print "X array= ";x#
print "Y array= ";y#
print "Z array= ";z#
print "angarray= ";ang#
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
ang#=object angle y(1)
camx#=0
camz#=0
point camera x#,y#,z#
camx#=newxvalue(x#,wrapvalue(ang#+180),75)
camz#=newzvalue(z#,wrapvalue(ang#+180),75)
if scancode()=44
x#=newxvalue(x#,wrapvalue(ang#+90),5)
z#=newzvalue(z#,wrapvalue(ang#+90),5)
endif
if scancode()=42
x#=newxvalue(x#,wrapvalue(ang#+270),5)
z#=newzvalue(z#,wrapvalue(ang#+270),5)
endif
Position Object 1,x#,y#,z#
position camera camx#,75,camz#
sync
loop
keys to move, shift and z to strafe.
Hilarious signature to be released 02-07-04