Hallo z_man....I made something as you say...and it works perfect...calculating the height of two object, we can point our object to a direccion or roll it to the correct ground angle
I,v got a small code that uses three hidden object in order to roll our object as we need...
I translated some words into English
YOU DON´T NEED MEDIA FILES.... I HOPE YOU LIKE IT ¡¡
`AJUSTE DE UN TANQUE CON EL TERRENO :EJEMPLO 2
create bitmap 1,50,50:for i= 1 to 1550:ink rgb(230,95,55),0:line rnd(60),i,i,rnd(130)
next i:blur bitmap 1,6:get image 1,10,10,50,50:delete bitmap 1
make matrix 1,10000.0,10000.0,25,25
prepare matrix texture 1,1,1,1
randomize matrix 1,350.0
rem set matrix height 1,12,12,700.0
update matrix 1
set ambient light 20
`we create informers objects
make object sphere 1,10
make object sphere 4,10
make object sphere 5,10
`------------------------------------------------------
`---our object with some limbs-------------
make object box 2,50,5,80:color object 2,rgb(50,100,100)
make object box 3,40,20,50
make mesh from object 1,3 :delete object 3
add limb 2,1,1 :add limb 2,2,1
scale limb 2,2,10,10,120 :offset limb 2,2,0,22,30:offset limb 2,1,0,10,0
color limb 2,2,rgb(0,0,200):color limb 2,1,rgb(0,50,170)
x#=500
z#=500
sync on
do
if upkey()=1 then x#=newxvalue(x#,a#,1) : z#=newzvalue(z#,a#,1)
if downkey()=1 then x#=newxvalue(x#,a#,-1) : z#=newzvalue(z#,a#,-1)
if leftkey()=1 then a#=wrapvalue(a#-1)
if rightkey()=1 then a#=wrapvalue(a#+1)
`we find out all "Y" of informers objects
yb#=get ground height(1,object position x(1),object position z(1))
yb2#=get ground height(1,object position x(5),object position z(5))
yb3#=get ground height(1,object position x(4),object position z(4))
`the "y" of our car
y#=get ground height(1,x#,z#)
`pocisionamos a los objetos
position object 1,x#,yb#+40,z#
position object 2,x#,y#+30,z#
position object 5,x#,yb2#,z#
position object 4,x#,yb3#,z#
`rotamos a los objetos
yrotate object 1,a#
yrotate object 2,a#
yrotate object 5,a#
yrotate object 4,a#
`desplazamos al objeto chivato que lleva el blindado, para calcular la inclinacion
move object 1,80
`desplazamos al segundo chivato, que comprobara los alaveos
move object left 5,30
move object right 4,30
`our object points x y z of informer
`just with that , we`v got , this work
point object 2,object position x(1),object position y(1),object position z(1)
`we make our object , roll left or right , our object y height less
`informer height
roll object left 2,y#-yb2#
roll object right 2,y#-yb3#
`Posiciona la cámara por detrás del objeto
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+100.0
position camera cx#,cy#+200,cz#
`enfoca la cámara al objeto
point camera x#,y#,z#
sync
loop
oh my god