@Disrupter52
Try the same code I gave you some time ago and load your tree. In my PC works ok.
hide mouse:autocam off:sync on
set ambient light 90
color backdrop rgb(5,5,5)
ink rgb(0,180,0)
box 0,0,100,100
for i=1 to 5000
cl=rnd(100)
ink rgb(0,100+cl,0)
dot rnd(100),rnd(100)
next i
get image 2,0,0,100,100,1
`****** definimos la posision de partida *********
`============================================================================
x#=50 :z#=-150 :y#=30 :gira#=45 :avance=5 :vol=120 :suavizado=5:jugad=1
`============================================================================
set camera range 10,25000
`******** creamos al protagonista **************
make object cylinder jugad,100
position object jugad,x#,y#,z#
`******** cargamos un escenario .x ************
make object box 1000,25500,1,25500
texture object 1000,2:scale object texture 1000,5,5
for i= 100 to 125
load object "treetest.x",i
position object i,-12000+rnd(12000),0,-12000+rnd(12000)
set object collision off i
scale object i,2000,2000,2000
make object box i+500,100,300,100
next i
for i= 600 to 625
position object i,object position x(i-500),object position y(i-500),object position z(i-500)
next i
do
set cursor 0,0
print screen fps()
gosub control
sync
loop
control:
oldx#=x#
oldz#=z#
y#=object position y(1)
`controlamos la vista de camara
gira#=wrapvalue(gira#+mousemovex()*0.7):cam#=wrapvalue(cam#+mousemovey()*0.7)
`limitamos el subir y bajar la cabeza(vista de camara)
if cam#<=290 and cam#>180 then cam#=290
if cam#>=70 and cam#<180 then cam#=70
rotate camera cam#,gira#,0
`********* movimientos del jugador *************
if upkey()=1 THEN x#=NEWXVALUE(x#,gira#,avance):z#=NEWZVALUE(z#,gira#,avance)
if downkey()=1 THEN x#=NEWXVALUE(x#,gira#,0-avance):z#=NEWZVALUE(z#,gira#,-avance)
`nos desplazamos lateralmente a la izquierda
if leftkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,avance):z#=NEWZVALUE(z#,gira#-90,avance)
`nos desplazamos lateralmente a la derecha
if rightkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,0-avance):z#=NEWZVALUE(z#,gira#-90,0-avance)
for i= 1000 to 1010
if object exist (i)
`calculo la distancia con el suelo(cordenada y)
if INTERSECT OBJECT(i,x#,y#,z#,x#,y#-vol,z#)>0 then y#=y#+(vol-INTERSECT OBJECT(i,x#,y#,z#,x#,y#-vol,z#))/suavizado
`si no encontramos suelo en que pisar, CAEMOS POR LA GRAVEDAD
if INTERSECT OBJECT(i,x#,y#,z#,x#,y#-90,z#)=0 then gravedad#=3
endif
next i
rem Actualizar posición del objeto y de la camara
position object jugad,x#,y#-gravedad#,z#
position camera x#,y#-gravedad#+20,z#
`DETECCION DE COLISIONES DESLIZANTES
`-----------------------------------
if object collision(jugad,0)>0:gosub zzol
if object collision(jugad,0)=0:z#=oldz#
endif
endif
if object collision(jugad,0)>0:gosub xxol
if object collision(jugad,0)=0:x#=oldx#
endif
endif
if object collision(jugad,0)>0
x#=oldx#:z#=oldz#
endif
return
`------------------------------------
xxol:
POSITION OBJECT jugad,oldx#,y#-gravedad#,z#
return
zzol:
POSITION OBJECT jugad,x#,y#-gravedad#,oldz#
return
Example attached
Cheers.
I'm not a grumpy grandpa
