hey chris!
here is a basic "moving ontop of matrix and camera follow" program:
(its an exerpt from my rpg)
Rem Project: Basic_RPG_Test_(soon to be awesome)
Rem Created: 1/30/2006 4:52:32 PM
Rem ***** Main Source File *****
remstart __________________________________________
| |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|<------------Part 1-setting up game------------->|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|_________________________________________________|
remend
`-------------------------------------------------------------------------------------------------------------------
`--------------------------
`Chapter 1-Create world |
`--------------------------
`Setup
sync on
sync rate 0
color backdrop rgb(0,0,0)
make matrix 1,10000,10000,100,100
randomize matrix 1,75
position matrix 1,500,5,500
update matrix 1
`----------------------------
`Chapter 2-Load all media |
`----------------------------
rem Activate and distance fogging
fog on
fog distance 3000
fog color RGB(0,0,0)
rem make character
make object sphere 1,50
`place player near the center of the matrix
position object 1,500,5,500
`-----------------------
`Chapter 4-Main loop |
`-----------------------
do
`player movement and turning
if keystate (17)=1 then move object 1, .50
if keystate (31)=1 then move object 1, -.3
if keystate (30)=1 then yrotate object 1, object angle y(1) - .3
if keystate (32)=1 then yrotate object 1, object angle y(1) +.3
`make it so that the character stays above the matrix
x# = object position x(1)
y# = get ground height(1,x#,z#)
z# = object position z(1)
`render all of above X# Y# and Z#
position object 1,x#,y#,z#
`place the camera at the players position and face it the same angles it faces
position camera x#, y#, z#
`set camera to object orientation 1
rotate camera object angle x(1), object angle y(1), object angle z(1)
`move camera straight up
xrotate camera 90
move camera -70
`set camera back to players angles and move it behind him
`set camera to object orientation 1
rotate camera object angle x(1), object angle y(1), object angle z(1)
move camera -200
`draw changes
sync
`end loop
loop
and what i do for my rpg in loading maps is:
load_map:
M=2
if matrix exist(1) then delete matrix 1
load bitmap "LVLHM3.bmp",1
set current bitmap 1
bw=bitmap width(1)-1
bh=bitmap height(1)-1
masix=(bw*100)*M
masiz=(bh*100)*M
make matrix 1,masix,masiz,bw,bh
smx#=((bw*-500)*m)/2
smz#=((bh*-500)*m)/2
if image exist(1) then delete image 1
load image "LVLHM3.bmp",1
prepare matrix texture 1,1,bw,bh
in=0
`bw-1
for x=bh to 1 step -1
for z=1 to bw
in=in+1
set matrix tile 1,z-1,x-1,in
next z
next x
for x=0 to bw
iz=bh+1
for z=0 to bh
iz=iz-1
h=point(x,iz)
h=(rgbr(h)+rgbg(h)+rgbb(h))/3
set matrix height 1,x,z,h*(m+1)
next z
next x
update matrix 1
delete bitmap 1
return
all its doing is calling an image and making a mesh out of it. and turning it into a matrix.
replace the images that are there with yours. (i found this in codebase it helps a ton!)
also.
right before your main loop put
hope this helps,
-Snowfall Studios
(on more thing chris, your heightmap needs to be in bitmap form for this to work. Go into photo shop and make a simple 50x50 thing and make it a bitmap. (remember. when using this the lighter the color the heigher the point goes))
-Snowfall.