Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Darkbasic Classic and heightmaps...

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 2nd Dec 2004 01:58
Can DBC Convert heightmaps to matrices,if so how? And if not can DBPro Do it, if so how?

MAIN GAMES PRESENTS: Catz
Turn Based War Game
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 2nd Dec 2004 04:18
Yes I've done it in DBC.. har har.

Yes there will be coding problems.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 2nd Dec 2004 13:12
You'll have to divide the width and height of the heightmap up since matrices can only be so big.

some pseudo code:,1
create matrix xsize,ysize
xskip=image_width/xsize
yskip=image_height/ysize
dim Matrix(xsize,ysize)

multiplier=1

xloc=0
yloc=0
load bitmap "heightmap.bmp",1
for x=0 to image_width step xskip
for y=0 to image_height step yskip
Matrix(xloc,yloc)=point(x,y)
y=y+1
next y
x=x+1
next x

for x=0 to xsize
for y=0 to ysize
set matrix height 1,x,y,Matrix(x,y)*multiplier
next y
next x


Somethin like that.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 2nd Dec 2004 18:13 Edited at: 2nd Dec 2004 18:21
I've got a piece of code that loads or dumps heightmaps into a matrix in my "memblock matrices" thread (look for the include at the bottom of the thread; the function's name is "setMemMatrixFromHeightmap").

http://forum.thegamecreators.com/?m=forum_view&t=42441&b=10

It's made for memblock matrices, but it shouldn't be too hard to adapt for DBC matrices...

Ideas: memories of things which did not occur yet...

Login to post a reply

Server time is: 2025-05-24 19:39:20
Your offset time is: 2025-05-24 19:39:20