Generate a terrain with : CreateGroundFromTopographic


Right now I was looking for an accurate terrain generation method. The creation of heightMap is a solution, but there is also the topography which I think is more precise and easier to design. It works almost the same as the heigtmap and I thought it might be something Babylon might have :

BABYLON.MeshBuilder.CreateGroundFromTopographic("name", "textures/Topographic.png", { width: 100, height: 100, subdivisions: 100, topographicScale: 20 });

In the options there is no longer necessarily need for heightMin and HeightMax, but instead something like topographicScale which would be the elevation scale in units. (It’s just an idea)

Instead of loading a HeightMap image, a topographic image is loaded and the terrain is generated.

I think it could allow to create terrain with more precision.
What do you think about this idea ?

Here is an image of a topographic terrain:

I kinda like it but wonder how efficient the parsing would look like as a simple fetch would not be enough.

It should work a bit like the hightmap I think, right? Except that there are more levels of black and white

the thing is to know the elevation in one place you need to parse the full texture to count how many closed lines you crossed :slight_smile: might not be as simple but totally doable.

Ah yes, I see what you mean. Yes I imagine it should not be so easy to set up. I thought this could be a nice addition for Babylon. The generation of terrain by topography is more precise and easier to draw.

[edit] Arf it’s easy to draw, but not easy to import and to configure into 3ds max.

You could do this no problem!

The question would be how you decide to interpolate between zones!

I could mock up and example for you.

Is that image a good example of a map you would like to convert?

Hi Prime,

No the map topographic was just to show an example.

In fact with 3ds max you need a dwg file made with AutoCAD that I don’t have. I tried to convert a jpg to dwg and 3ds max gave me a header error.

I think to stay with a heightmap that I will draw with sketchbook pro.

But thank you for your Prime proposal.

Agreed. I believe there’s not enough information in this to do it properly. Same as a topographic map, I rather think colors would be needed to provide more information on the type of terrain/interpolation.
Else, I actually like the idea. But I think it would require a lot more work to turn this into a useable and recommendable feature for creating a terrain. I suspect in the end, we would end up with a heightmap except it’s drawn with lines, colors and elevation points, yes?

Yeah the map would need more info I would imagine, or you would have to make assumptions in an example like this.

If you had a gradient value for each zone you could tell by how much each one is going up or down. Could do a flood fill algo over the image to fill each zone but you would have to make the assumption that they are all going up each new one or down.

I think some topology maps come with information on the lines, if we were able to get those paths converted into actual segmented splines or curves then you could do a closest path algorithm to find the line to reference.

This would be fun as heck to do I just don’t have the time right this second.

my original idea was to add elevation information in the CreateGroundFromTopographic() constructor options.

I thought that each zone receives the same height scale (like 20 units multiply by the number of zones gives the total height of a mountain)
Then the more space there is between the lines of each zone, the softer the slope and the tighter the lines, the steeper the slope.

I think the height is a single scale that needs to be set in the options. no other color information needed.

[edit] After I am aware that this would mean that each mountain would all have the same heights, so the idea is not so good when you think about it.