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 Professional Discussion / Heightmaps, Memblocks and HUGE terrains

Author
Message
Daryn Alsup
18
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 14th Jul 2010 04:24 Edited at: 14th Jul 2010 16:02
Okay so here's what I've done - I've loaded an image and gathered the color byte values through the memblock commands. Using a matrix it was very easy to (1 dbpro unit = 3ft) read the color values, * it by 0.33 and raise the matrix height at each corresponding point and create a matrix terrain from the image - but the scale is always wrong and when I scale it to the correct size - the amount of detail becomes lacking - as it must i suppose. The trouble is I need to create HUGE landscapes with as much detail as possible while using very little system resource. There are two options for the user which also keep me from using the Adv. Terrain commands - one being that every landscape will be terraformable and the other is purely to do with the scaling of each terrain. The user has the option to load a height map - each map can be different and the scale must be adjusted... so I'm wondering - How do I split up an image so that different portions of that image can be applied to different objects i use as terrains (like sections of an adv. terrain object) - How do I then split up an object into sections for said images? I've already gathered how to create vertices but not how to separate an image or a plane into sections. Any method or small examples would really help - but I am predominately looking for understanding.

EDIT-
Okay I've figured out the image splitting for the most part. I have to designate a limit for the amount of pixels when using a memblock... like this sort of



That's just an example but it revolves around the same premise - splitting an image and I suppose in one way or another it can be used to divide one object into several. But then the question becomes - HOW do I attain which vertices on each side of every object to align with the others? - (As to keep the terrain seamless).

The only limitation I can see for the user is that the pixel to feet ratio isn't stated any where... so depending on how far the image of the terrain was taken in conjunction to the camera which took the image (of the real world heightmap) - 1 pixel could = anywhere from 1 foot to a million feet. The scale of the image (pixel - foot ratio) would be what you use to divide the image into segments - you then would make a memblock and create an image from it - then apply it to the object through another memblock (or set of them for multiple objects) - The smaller the objects - the more you hide, the less amount of cpu/ram used. Oh the life of a programmer!!!

That's all for now

EDIT II:
Here's what I've got but I'm getting lost in my own work!


The height map I used is here

-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
RiiDii
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Jul 2010 22:01
Quote: "There are two options for the user which also keep me from using the Adv. Terrain commands - one being that every landscape will be terraformable and the other is purely to do with the scaling of each terrain."


Would it help if you knew this was possible with Advanced Terrain? It is.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Jul 2010 23:53
I'd use BlitzTerrain. It's like advanced terrain, but better, and has built in commands for terraforming. (And LOD which is even cooler!)

My signature is NOT a moderator plaything! Stop changing it!
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 22nd Aug 2010 21:11
hi

I ran your example with the image provided

the first 7 times nothing showed up
I had some other program running
a paused that

then tried it again

it created 7 squares with with triangles
grey set first then black for the other 6
started the squares on the right side corner
then when to the back left side corner

I even converted the image over to a bmp with
the same results

is that what it suppose to do ?

all I did was copy and past and now it has it's own folder
.dba and .dbpro extensions

please give me a shout back

[email protected]

If a thought is Just a thought ~ so whats the main thought ?
Daryn Alsup
18
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 23rd Aug 2010 13:17
Lol - that example was only to show how much of the systems resources are used when making planes with multiple plane segments. using bliz terrain now

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 23rd Aug 2010 13:40
well it seemed like it was basically ready to use
now it seems there was a bit more work needed to finish it

it was only that one command that did not work

[email protected]

If a thought is Just a thought ~ so whats the main thought ?
Daryn Alsup
18
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 24th Aug 2010 07:14
If you'd simply like to create a small terrain scaled accuratly to feet/km - I'd use a matrix and just clarify the amount of feet by vertex... works fine.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2026-07-23 07:42:58
Your offset time is: 2026-07-23 07:42:58