I'm trying to learn how I can import my own terrains a .x files and I can do that but now I want to keep my sphere ontop of the terrain so I use intersect object(...,...,...,...,...,...,...) but im doing something wrong because it never places itself on the terrain
Load object "terrain1.x",1
load image "grass.bmp",1
texture object 1,1
make object sphere 2,1
position object 1,0,0,0
position object 2,10,intersect object(1,10,5000,-10,10,-5000,-10),-10
position camera 0+(object size x(1)/2),50,0-(object size z(1)/2)
point camera 0+(object size x(1)/2),0,0-(object size z(1)/2)
do
if upkey()=1
move object 2,0.05
posx = object position x(2)
posy = object position y(2)
posz = object position z(2)
position object 2,posx,intersect object (1,posx,5000,posz,posx,-5000,posz),posz
endif
if leftkey()=1
yrotate object 2,object angle y(2)-2
endif
if rightkey()=1
yrotate object 2,object angle y(2)+2
endif
camx = newxvalue(posx,180,1)
camy = newyvalue(posy,180,1)
camz = newzvalue(posz,180,1)
position camera camx,camy+30,camz
point camera posx,posy,posz
sync
loop
Thankyou in advance
Daniel
*For every problem you come across you gain something from correcting it, I hope.