hi
Nintendo Zelder3D,Mario3D style,
third person viewpoint movement.
I want a method to work smoothly.
This is a sample program.
Rem Third Person Camera View
create bitmap 1,32,32 : cls rgb(0,155,0) : ink rgb(0,145,0),0 : box 4,4,12,12
get image 1,0,0,32,32 : delete bitmap 1
make matrix 1,10000.0,10000.0,25,25
prepare matrix texture 1,1,2,2
randomize matrix 1,100.0
set matrix height 1,12,12,300.0
update matrix 1
make object cube 1,100.0
make object cube 2,50
POSITION OBJECT 2,0,50,50
PERFORM CSG UNION 1,2
DELETE OBJECT 2
x#=500
z#=500
SET CAMERA RANGE 1,30000
sync rate 60 : sync on
rem Game loop
do
if upkey()=1 then x#=newxvalue(x#,a#, 10) : z#=newzvalue(z#,a#, 10):an=0
if downkey()=1 then x#=newxvalue(x#,a#,-10) : z#=newzvalue(z#,a#,-10):an=180
if leftkey()=1 then a#=wrapvalue(a#-2.0):an=270
if rightkey()=1 then a#=wrapvalue(a#+2.0):an=90
rem character
cx#=newxvalue(x#,wrapvalue(a#),500)
cz#=newzvalue(z#,wrapvalue(a#),500)
cy#=get ground height(1,cx#,cz#)+50.0
position object 1,cx#,cy#,cz#
rem camera
y#=get ground height(1,x#,z#)+200.0
position camera x#,y#,z#
yrotate object 1,a#+an
point camera cx#,cy#,cz#
sync
loop