hey ive had 3 people now asking me about how to do this and since someone asked me a few hours ago on youtube, due to my good Christmas spirit mood i made a quick run through of what i do to load a heightmap - terrain in db
using advanced terrain dll
this prolly wont help anyone and will be flamed at but some new person may benefit.
im gona link up the vid when its uploaded but for now heres the code.
the models will be in the same download as vid
(apart from i think i can get vid streamed, its 14mins which is too long for youtube.)
this isnt a tutorial, more of a run thro.
Rem Project: testterrain
Rem Created: Thursday, December 25, 2008
Rem ***** Main Source File *****
set display mode 800,600,32
sync on : sync rate 60
`load textures
load image "texture2.bmp",1
load image "detail.tga",2
`make terrain
make object terrain 1
set terrain heightmap 1, "heightmap.bmp"
set terrain scale 1,6,0.5,6
set terrain split 1, 16
set terrain tiling 1, 8
set terrain light 1, 1, -0.25, 0, 1, 1, 0.78, 0.5
set terrain texture 1, 1, 2
build terrain 1
set object texture 1, 1, 2
position object 1, 0, 0 ,0
make object sphere 2, 1
`the loop
do
`define variables to make it faster
playerx#=object position x (2)
playery#=object position y (2)
playerz#=object position z (2)
text 0,0,"arrow keys + WASD keys to move"
text 0,10,"Q and E key to rotate camera"
text 0,20,"have fun =D"
`movement 17 = W key
`31 = S key
`30 = A key
`32 = D key
if upkey()=1 or keystate(17)=1 then move object 2, 1
if downkey()=1 or keystate(31)=1 then move object 2, -1
if leftkey()=1 or keystate(30)=1 then move object left 2, 1
if rightkey()=1 or keystate(32)=1 then move object right 2, 1
`find out where on the terrain the player is
height#=get terrain ground height(1, playerx#, playerz#)
`rotation of player
`keystate 16=Q and 18=E
if keystate(16)=1 then turn object left 2, 1
if keystate(18)=1 then turn object right 2, 1
`this command keeps the camera and object facing the same way
rotate camera object angle x(2), object angle y(2), object angle z(2)
`this positions the camera at the players position, but just above the terrain so u dont see holes in the floor.
position camera playerx#, height#+5, playerz#
sync
loop
woot i made the lamest sig ever!
Your signature has been erased by a mod <- YOU MEANIE!